
@context = internal global { { ptr, ptr, ptr }, ptr } zeroinitializer
@g_should_call = internal global i1 false
@str = private unnamed_addr constant [9 x i8] c"getValue\00", align 1
@str.1 = private unnamed_addr constant [4 x i8] c"()D\00", align 1
@SX_JNI_CLS_getValue____D = internal global ptr null
@SX_JNI_MID_getValue____D = internal global ptr null
@str.2 = private unnamed_addr constant [4 x i8] c"ok\0A\00", align 1
@str.3 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1

; Function Attrs: nounwind
declare void @out(ptr) #0

declare ptr @malloc(i64)

declare ptr @memcpy(ptr, ptr, i64)

declare ptr @memset(ptr, i32, i64)

declare void @free(ptr)

; Function Attrs: nounwind
declare void @GPA.create(ptr sret({ ptr, ptr, ptr }), ptr) #0

; Function Attrs: nounwind
define internal ptr @GPA.alloc(ptr %0, i64 %1) #0 {
entry:
  %alloca = alloca ptr, align 8
  store ptr %0, ptr %alloca, align 8
  %allocaN = alloca i64, align 8
  store i64 %1, ptr %allocaN, align 8
  %load = load ptr, ptr %alloca, align 8
  %gep = getelementptr inbounds { i64 }, ptr %load, i32 0, i32 0
  %loadN = load i64, ptr %gep, align 8
  %add = add i64 %loadN, 1
  store i64 %add, ptr %gep, align 8
  %loadN = load i64, ptr %allocaN, align 8
  %malloc = call ptr @malloc(i64 %loadN)
  ret ptr %malloc
}

; Function Attrs: nounwind
define internal void @GPA.dealloc(ptr %0, ptr %1) #0 {
entry:
  %alloca = alloca ptr, align 8
  store ptr %0, ptr %alloca, align 8
  %allocaN = alloca ptr, align 8
  store ptr %1, ptr %allocaN, align 8
  %load = load ptr, ptr %alloca, align 8
  %gep = getelementptr inbounds { i64 }, ptr %load, i32 0, i32 0
  %loadN = load i64, ptr %gep, align 8
  %sub = sub i64 %loadN, 1
  store i64 %sub, ptr %gep, align 8
  %loadN = load ptr, ptr %allocaN, align 8
  call void @free(ptr %loadN)
  ret void
}

; Function Attrs: nounwind
declare void @Arena.add_chunk(ptr, i64) #0

; Function Attrs: nounwind
declare void @Arena.create(ptr sret({ ptr, ptr, ptr }), ptr, ptr, i64) #0

; Function Attrs: nounwind
declare void @Arena.reset(ptr) #0

; Function Attrs: nounwind
declare void @Arena.deinit(ptr) #0

; Function Attrs: nounwind
declare ptr @Arena.alloc(ptr, i64) #0

; Function Attrs: nounwind
declare void @Arena.dealloc(ptr, ptr) #0

; Function Attrs: nounwind
declare void @BufAlloc.create(ptr sret({ ptr, ptr, ptr }), ptr, ptr, i64) #0

; Function Attrs: nounwind
declare void @BufAlloc.reset(ptr) #0

; Function Attrs: nounwind
declare ptr @BufAlloc.alloc(ptr, i64) #0

; Function Attrs: nounwind
declare void @BufAlloc.dealloc(ptr, ptr) #0

; Function Attrs: nounwind
define internal { ptr, i64 } @cstring(i64 %0) #0 {
entry:
  %alloca = alloca i64, align 8
  store i64 %0, ptr %alloca, align 8
  %load = load i64, ptr %alloca, align 8
  %add = add i64 %load, 1
  %heap = call ptr @malloc(i64 %add)
  %allocaN = alloca ptr, align 8
  store ptr %heap, ptr %allocaN, align 8
  %loadN = load ptr, ptr %allocaN, align 8
  %loadN = load i64, ptr %alloca, align 8
  %addN = add i64 %loadN, 1
  %1 = call ptr @memset(ptr %loadN, i32 0, i64 %addN)
  %allocaN = alloca { ptr, i64 }, align 8
  store { ptr, i64 } undef, ptr %allocaN, align 8
  %loadN = load ptr, ptr %allocaN, align 8
  %gep = getelementptr inbounds { ptr, i64 }, ptr %allocaN, i32 0, i32 0
  %pti = ptrtoint ptr %loadN to i64
  store i64 %pti, ptr %gep, align 8
  %loadN = load i64, ptr %alloca, align 8
  %gepN = getelementptr inbounds { ptr, i64 }, ptr %allocaN, i32 0, i32 1
  store i64 %loadN, ptr %gepN, align 8
  %loadN = load { ptr, i64 }, ptr %allocaN, align 8
  ret { ptr, i64 } %loadN
}

; Function Attrs: nounwind
declare ptr @int_to_string(i64) #0

; Function Attrs: nounwind
declare ptr @bool_to_string(i1) #0

; Function Attrs: nounwind
declare ptr @float_to_string(double) #0

; Function Attrs: nounwind
declare void @hex_group(ptr, i64, i64) #0

; Function Attrs: nounwind
declare ptr @int_to_hex_string(i64) #0

; Function Attrs: nounwind
define internal { ptr, i64 } @concat({ ptr, i64 } %0, { ptr, i64 } %1) #0 {
entry:
  %alloca = alloca { ptr, i64 }, align 8
  store { ptr, i64 } %0, ptr %alloca, align 8
  %allocaN = alloca { ptr, i64 }, align 8
  store { ptr, i64 } %1, ptr %allocaN, align 8
  %load = load { ptr, i64 }, ptr %alloca, align 8
  %len = extractvalue { ptr, i64 } %load, 1
  %allocaN = alloca i64, align 8
  store i64 %len, ptr %allocaN, align 8
  %loadN = load { ptr, i64 }, ptr %allocaN, align 8
  %lenN = extractvalue { ptr, i64 } %loadN, 1
  %allocaN = alloca i64, align 8
  store i64 %lenN, ptr %allocaN, align 8
  %loadN = load i64, ptr %allocaN, align 8
  %loadN = load i64, ptr %allocaN, align 8
  %add = add i64 %loadN, %loadN
  %call = call { ptr, i64 } @cstring(i64 %add)
  %allocaN = alloca { ptr, i64 }, align 8
  store { ptr, i64 } %call, ptr %allocaN, align 8
  %loadN = load { ptr, i64 }, ptr %allocaN, align 8
  %dptr = extractvalue { ptr, i64 } %loadN, 0
  %loadN = load { ptr, i64 }, ptr %alloca, align 8
  %dptrN = extractvalue { ptr, i64 } %loadN, 0
  %loadN = load i64, ptr %allocaN, align 8
  %2 = call ptr @memcpy(ptr %dptr, ptr %dptrN, i64 %loadN)
  %loadN = load i64, ptr %allocaN, align 8
  %loadN = load { ptr, i64 }, ptr %allocaN, align 8
  %igp.data = extractvalue { ptr, i64 } %loadN, 0
  %igp.ptr = getelementptr i8, ptr %igp.data, i64 %loadN
  %loadN = load { ptr, i64 }, ptr %allocaN, align 8
  %dptrN = extractvalue { ptr, i64 } %loadN, 0
  %loadN = load i64, ptr %allocaN, align 8
  %3 = call ptr @memcpy(ptr %igp.ptr, ptr %dptrN, i64 %loadN)
  %loadN = load { ptr, i64 }, ptr %allocaN, align 8
  ret { ptr, i64 } %loadN
}

; Function Attrs: nounwind
define internal { ptr, i64 } @substr({ ptr, i64 } %0, i64 %1, i64 %2) #0 {
entry:
  %alloca = alloca { ptr, i64 }, align 8
  store { ptr, i64 } %0, ptr %alloca, align 8
  %allocaN = alloca i64, align 8
  store i64 %1, ptr %allocaN, align 8
  %allocaN = alloca i64, align 8
  store i64 %2, ptr %allocaN, align 8
  %load = load i64, ptr %allocaN, align 8
  %call = call { ptr, i64 } @cstring(i64 %load)
  %allocaN = alloca { ptr, i64 }, align 8
  store { ptr, i64 } %call, ptr %allocaN, align 8
  %loadN = load { ptr, i64 }, ptr %allocaN, align 8
  %dptr = extractvalue { ptr, i64 } %loadN, 0
  %loadN = load i64, ptr %allocaN, align 8
  %loadN = load { ptr, i64 }, ptr %alloca, align 8
  %igp.data = extractvalue { ptr, i64 } %loadN, 0
  %igp.ptr = getelementptr i8, ptr %igp.data, i64 %loadN
  %loadN = load i64, ptr %allocaN, align 8
  %3 = call ptr @memcpy(ptr %dptr, ptr %igp.ptr, i64 %loadN)
  %loadN = load { ptr, i64 }, ptr %allocaN, align 8
  ret { ptr, i64 } %loadN
}

; Function Attrs: nounwind
declare ptr @any_to_string([2 x i64]) #0

; Function Attrs: nounwind
declare ptr @build_format(ptr) #0

; Function Attrs: nounwind
define internal double @read_double(ptr %0, ptr %1) #0 {
entry:
  %alloca = alloca ptr, align 8
  store ptr %0, ptr %alloca, align 8
  %allocaN = alloca ptr, align 8
  store ptr %1, ptr %allocaN, align 8
  %load = load ptr, ptr %alloca, align 8
  %loadN = load ptr, ptr %allocaN, align 8
  %jni.ifs = load ptr, ptr %load, align 8
  %jni.cached.mid = load ptr, ptr @SX_JNI_MID_getValue____D, align 8
  %jni.is.cached = icmp ne ptr %jni.cached.mid, null
  br i1 %jni.is.cached, label %jni.cont, label %jni.miss

jni.miss:                                         ; preds = %entry
  %2 = getelementptr inbounds ptr, ptr %jni.ifs, i32 31
  %jni.GetObjectClass = load ptr, ptr %2, align 8
  %jni.cls = call ptr %jni.GetObjectClass(ptr %load, ptr %loadN)
  %3 = getelementptr inbounds ptr, ptr %jni.ifs, i32 21
  %jni.NewGlobalRef = load ptr, ptr %3, align 8
  %jni.global.cls = call ptr %jni.NewGlobalRef(ptr %load, ptr %jni.cls)
  store ptr %jni.global.cls, ptr @SX_JNI_CLS_getValue____D, align 8
  %4 = getelementptr inbounds ptr, ptr %jni.ifs, i32 33
  %jni.GetMethodID = load ptr, ptr %4, align 8
  %jni.fresh.mid = call ptr %jni.GetMethodID(ptr %load, ptr %jni.global.cls, ptr @str, ptr @str.1)
  store ptr %jni.fresh.mid, ptr @SX_JNI_MID_getValue____D, align 8
  br label %jni.cont

jni.cont:                                         ; preds = %jni.miss, %entry
  %jni.mid = phi ptr [ %jni.cached.mid, %entry ], [ %jni.fresh.mid, %jni.miss ]
  %5 = getelementptr inbounds ptr, ptr %jni.ifs, i32 58
  %jni.callfn = load ptr, ptr %5, align 8
  %jni.ret = call double %jni.callfn(ptr %load, ptr %loadN, ptr %jni.mid)
  ret double %jni.ret
}

; Function Attrs: nounwind
define i32 @main() #0 {
entry:
  %alloca = alloca { i64 }, align 8
  store { i64 } zeroinitializer, ptr %alloca, align 8
  %si = insertvalue { ptr, ptr, ptr } undef, ptr %alloca, 0
  %siN = insertvalue { ptr, ptr, ptr } %si, ptr @__thunk_GPA_Allocator_alloc, 1
  %siN = insertvalue { ptr, ptr, ptr } %siN, ptr @__thunk_GPA_Allocator_dealloc, 2
  %siN = insertvalue { { ptr, ptr, ptr }, ptr } undef, { ptr, ptr, ptr } %siN, 0
  %siN = insertvalue { { ptr, ptr, ptr }, ptr } %siN, ptr null, 1
  store { { ptr, ptr, ptr }, ptr } %siN, ptr @context, align 8
  %gload = load i1, ptr @g_should_call, align 1
  br i1 %gload, label %if.then.0, label %if.merge.1

if.then.0:                                        ; preds = %entry
  %call = call double @read_double(ptr null, ptr null)
  %allocaN = alloca double, align 8
  store double %call, ptr %allocaN, align 8
  br label %if.merge.1

if.merge.1:                                       ; preds = %if.then.0, %entry
  %allocaN = alloca { ptr, i64 }, align 8
  %gep = getelementptr inbounds { ptr, i64 }, ptr %allocaN, i32 0, i32 0
  store ptr null, ptr %gep, align 8
  %gepN = getelementptr inbounds { ptr, i64 }, ptr %allocaN, i32 0, i32 1
  store i64 0, ptr %gepN, align 8
  %allocaN = alloca { ptr, i64 }, align 8
  store { ptr, i64 } { ptr @str.2, i64 3 }, ptr %allocaN, align 8
  %allocaN = alloca { ptr, i64 }, align 8
  store { ptr, i64 } { ptr @str.3, i64 0 }, ptr %allocaN, align 8
  %load = load { ptr, i64 }, ptr %allocaN, align 8
  %loadN = load { ptr, i64 }, ptr %allocaN, align 8
  %callN = call { ptr, i64 } @substr({ ptr, i64 } %loadN, i64 0, i64 3)
  %callN = call { ptr, i64 } @concat({ ptr, i64 } %load, { ptr, i64 } %callN)
  store { ptr, i64 } %callN, ptr %allocaN, align 8
  %loadN = load { ptr, i64 }, ptr %allocaN, align 8
  %str.ptr = extractvalue { ptr, i64 } %loadN, 0
  %str.len = extractvalue { ptr, i64 } %loadN, 1
  %0 = call i64 @write(i32 1, ptr %str.ptr, i64 %str.len)
  ret i32 0
}

; Function Attrs: nounwind
define internal ptr @__thunk_GPA_Allocator_alloc(ptr %0, i64 %1) #0 {
entry:
  %call = call ptr @GPA.alloc(ptr %0, i64 %1)
  ret ptr %call
}

; Function Attrs: nounwind
define internal void @__thunk_GPA_Allocator_dealloc(ptr %0, ptr %1) #0 {
entry:
  call void @GPA.dealloc(ptr %0, ptr %1)
  ret void
}

declare i64 @write(i32, ptr, i64)


