#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ v;

/* Variables and functions */
int /*<<< orphan*/ all_types();
int /*<<< orphan*/ do_report(char *, int, int);
int /*<<< orphan*/ encode_decode(int /*<<< orphan*/, char *);
int /*<<< orphan*/ erl_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ erl_mk_int(int);
int /*<<< orphan*/ erl_mk_longlong(long long);
int /*<<< orphan*/ erl_mk_uint(unsigned int);
int /*<<< orphan*/ erl_mk_ulonglong(unsigned long long);
void round_trip_conversion(void) {
  int n, i;
  erl_init(NULL, 0);
  encode_decode(all_types(), "ALL");
  {
    int v;
    for (v = 8, n = 0; n < (sizeof(v) * 8 - 4 - 1); v <<= 1, n++) {
      for (i = -4; i < 4; i++) {
        encode_decode(erl_mk_int(v + i), "INT");
        encode_decode(erl_mk_int(-(v + i)), "NEG INT");
      }
    }
  }
  {
    unsigned int v;
    for (v = 8; v; v <<= 1) {
      for (i = -4; i < 4; i++) {
        encode_decode(erl_mk_uint(v + i), "UINT");
      }
    }
  }
  {
    long long v;
    for (v = 8, n = 0; n < (sizeof(v) * 8 - 4 - 1); v <<= 1, n++) {
      for (i = -4; i < 4; i++) {
        encode_decode(erl_mk_longlong(v + i), "LONGLONG");
        encode_decode(erl_mk_longlong(-(v + i)), "NEG LONGLONG");
      }
    }
  }
  {
    unsigned long long v;
    for (v = 8; v; v <<= 1) {
      for (i = -4; i < 4; i++) {
        encode_decode(erl_mk_ulonglong(v + i), "ULONGLONG");
      }
    }
  }
  do_report("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/"
            "erl_interface/test/erl_eterm_SUITE_data/eterm_test.c",
            185, 1);
}


x86 assembly (clang, -O0):
<round_trip_conversion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   10a0 <erl_init@plt>
mov    $0x0,%al
call   1050 <all_types@plt>
mov    %eax,%edi
lea    0xe5d(%rip),%rsi
call   1090 <encode_decode@plt>
movl   $0x8,-0xc(%rbp)
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0x1b,%rax
jae    1235 <round_trip_conversion+0xb5>
movl   $0xfffffffc,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1219 <round_trip_conversion+0x99>
mov    -0xc(%rbp),%edi
add    -0x8(%rbp),%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
lea    0xe1f(%rip),%rsi
call   1090 <encode_decode@plt>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
xor    %edi,%edi
sub    %eax,%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
lea    0xdfe(%rip),%rsi
call   1090 <encode_decode@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11cb <round_trip_conversion+0x4b>
jmp    121e <round_trip_conversion+0x9e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11b6 <round_trip_conversion+0x36>
movl   $0x8,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1291 <round_trip_conversion+0x111>
movl   $0xfffffffc,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    127e <round_trip_conversion+0xfe>
mov    -0x10(%rbp),%edi
add    -0x8(%rbp),%edi
call   1070 <erl_mk_uint@plt>
mov    %eax,%edi
lea    0xda1(%rip),%rsi
call   1090 <encode_decode@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    124d <round_trip_conversion+0xcd>
jmp    1283 <round_trip_conversion+0x103>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    123c <round_trip_conversion+0xbc>
movq   $0x8,-0x18(%rbp)
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rax
cmp    $0x3b,%rax
jae    132f <round_trip_conversion+0x1af>
movl   $0xfffffffc,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    1310 <round_trip_conversion+0x190>
mov    -0x18(%rbp),%rdi
movslq -0x8(%rbp),%rax
add    %rax,%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
lea    0xd3d(%rip),%rsi
call   1090 <encode_decode@plt>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
add    %rcx,%rax
xor    %ecx,%ecx
mov    %ecx,%edi
sub    %rax,%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
lea    0xd14(%rip),%rsi
call   1090 <encode_decode@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12b5 <round_trip_conversion+0x135>
jmp    1315 <round_trip_conversion+0x195>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    12a0 <round_trip_conversion+0x120>
movq   $0x8,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1395 <round_trip_conversion+0x215>
movl   $0xfffffffc,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    137f <round_trip_conversion+0x1ff>
mov    -0x20(%rbp),%rdi
movslq -0x8(%rbp),%rax
add    %rax,%rdi
call   1040 <erl_mk_ulonglong@plt>
mov    %eax,%edi
lea    0xcb2(%rip),%rsi
call   1090 <encode_decode@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1349 <round_trip_conversion+0x1c9>
jmp    1384 <round_trip_conversion+0x204>
mov    -0x20(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1337 <round_trip_conversion+0x1b7>
lea    0xc8c(%rip),%rdi
mov    $0xb9,%esi
mov    $0x1,%edx
call   1030 <do_report@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_trip_conversion>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   10a0 <erl_init@plt>
xor    %eax,%eax
call   1050 <all_types@plt>
lea    0xe61(%rip),%rsi
mov    %eax,%edi
call   1090 <encode_decode@plt>
mov    $0x8,%ebx
mov    $0x1b,%r12d
lea    0xe50(%rip),%r14
lea    0xe45(%rip),%r15
nop
lea    -0x4(%rbx),%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    $0x4,%edi
sub    %ebx,%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
lea    -0x3(%rbx),%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    $0x3,%edi
sub    %ebx,%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
lea    -0x2(%rbx),%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    $0x2,%edi
sub    %ebx,%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
lea    -0x1(%rbx),%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    $0x1,%edi
sub    %ebx,%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
mov    %ebx,%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    %ebx,%edi
neg    %edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
mov    %ebx,%ebp
or     $0x1,%ebp
mov    %ebp,%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
neg    %ebp
mov    %ebp,%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
mov    %ebx,%ebp
or     $0x2,%ebp
mov    %ebp,%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
neg    %ebp
mov    %ebp,%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
mov    %ebx,%ebp
or     $0x3,%ebp
mov    %ebp,%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
neg    %ebp
mov    %ebp,%edi
call   1080 <erl_mk_int@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
add    %ebx,%ebx
add    $0xffffffff,%r12d
jne    11c0 <round_trip_conversion+0x40>
mov    $0x8,%ebx
lea    0xcf5(%rip),%r14
nopw   0x0(%rax,%rax,1)
lea    -0x4(%rbx),%edi
call   1070 <erl_mk_uint@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
lea    -0x3(%rbx),%edi
call   1070 <erl_mk_uint@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
lea    -0x2(%rbx),%edi
call   1070 <erl_mk_uint@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
lea    -0x1(%rbx),%edi
call   1070 <erl_mk_uint@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    %ebx,%edi
call   1070 <erl_mk_uint@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    %ebx,%edi
or     $0x1,%edi
call   1070 <erl_mk_uint@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    %ebx,%edi
or     $0x2,%edi
call   1070 <erl_mk_uint@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    %ebx,%edi
or     $0x3,%edi
call   1070 <erl_mk_uint@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
add    %ebx,%ebx
jne    1320 <round_trip_conversion+0x1a0>
mov    $0x8,%ebp
mov    $0x3b,%r12d
lea    0xc46(%rip),%r14
lea    0xc3b(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
lea    -0x4(%rbp),%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    $0x4,%edi
sub    %rbp,%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
lea    -0x3(%rbp),%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    $0x3,%edi
sub    %rbp,%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
lea    -0x2(%rbp),%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    $0x2,%edi
sub    %rbp,%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
lea    -0x1(%rbp),%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    $0x1,%edi
sub    %rbp,%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
mov    %rbp,%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    %rbp,%rdi
neg    %rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
mov    %rbp,%rbx
or     $0x1,%rbx
mov    %rbx,%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
neg    %rbx
mov    %rbx,%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
mov    %rbp,%rbx
or     $0x2,%rbx
mov    %rbx,%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
neg    %rbx
mov    %rbx,%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
mov    %rbp,%rbx
or     $0x3,%rbx
mov    %rbx,%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
neg    %rbx
mov    %rbx,%rdi
call   1060 <erl_mk_longlong@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1090 <encode_decode@plt>
add    %rbp,%rbp
add    $0xffffffff,%r12d
jne    13e0 <round_trip_conversion+0x260>
mov    $0x8,%ebx
lea    0xacc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x4(%rbx),%rdi
call   1040 <erl_mk_ulonglong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
lea    -0x3(%rbx),%rdi
call   1040 <erl_mk_ulonglong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
lea    -0x2(%rbx),%rdi
call   1040 <erl_mk_ulonglong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
lea    -0x1(%rbx),%rdi
call   1040 <erl_mk_ulonglong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    %rbx,%rdi
call   1040 <erl_mk_ulonglong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    %rbx,%rdi
or     $0x1,%rdi
call   1040 <erl_mk_ulonglong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    %rbx,%rdi
or     $0x2,%rdi
call   1040 <erl_mk_ulonglong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
mov    %rbx,%rdi
or     $0x3,%rdi
call   1040 <erl_mk_ulonglong@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1090 <encode_decode@plt>
add    %rbx,%rbx
jne    1560 <round_trip_conversion+0x3e0>
lea    0xa18(%rip),%rdi
mov    $0xb9,%esi
mov    $0x1,%edx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <do_report@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"ALL\00"
@.str.1 = [4 x i8] c"INT\00"
@.str.2 = [8 x i8] c"NEG INT\00"
@.str.3 = [5 x i8] c"UINT\00"
@.str.4 = [9 x i8] c"LONGLONG\00"
@.str.5 = [13 x i8] c"NEG LONGLONG\00"
@.str.6 = [10 x i8] c"ULONGLONG\00"
@.str.7 = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c\00"
define void @round_trip_conversion() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = call i32 @erl_init(i32* null, i32 0)
%8 = call i32 (...) @all_types()
%9 = call i32 @encode_decode(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 8, i32* %3
store i32 0, i32* %1
br label %10
10: ; preds = %34, %0
%11 = load i32, i32* %1
%12 = sext i32 %11 to i64
%13 = icmp ult i64 %12, 27
br i1 %13, label %14, label %39
14: ; preds = %10
store i32 -4, i32* %2
br label %15
15: ; preds = %30, %14
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 4
br i1 %17, label %18, label %33
18: ; preds = %15
%19 = load i32, i32* %3
%20 = load i32, i32* %2
%21 = add nsw i32 %19, %20
%22 = call i32 @erl_mk_int(i32 %21)
%23 = call i32 @encode_decode(i32 %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32, i32* %3
%25 = load i32, i32* %2
%26 = add nsw i32 %24, %25
%27 = sub nsw i32 0, %26
%28 = call i32 @erl_mk_int(i32 %27)
%29 = call i32 @encode_decode(i32 %28, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %18
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %15
33: ; preds = %15
br label %34
34: ; preds = %33
%35 = load i32, i32* %3
%36 = shl i32 %35, 1
store i32 %36, i32* %3
%37 = load i32, i32* %1
%38 = add nsw i32 %37, 1
store i32 %38, i32* %1
br label %10
39: ; preds = %10
store i32 8, i32* %4
br label %40
40: ; preds = %57, %39
%41 = load i32, i32* %4
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %60
43: ; preds = %40
store i32 -4, i32* %2
br label %44
44: ; preds = %53, %43
%45 = load i32, i32* %2
%46 = icmp slt i32 %45, 4
br i1 %46, label %47, label %56
47: ; preds = %44
%48 = load i32, i32* %4
%49 = load i32, i32* %2
%50 = add i32 %48, %49
%51 = call i32 @erl_mk_uint(i32 %50)
%52 = call i32 @encode_decode(i32 %51, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %53
53: ; preds = %47
%54 = load i32, i32* %2
%55 = add nsw i32 %54, 1
store i32 %55, i32* %2
br label %44
56: ; preds = %44
br label %57
57: ; preds = %56
%58 = load i32, i32* %4
%59 = shl i32 %58, 1
store i32 %59, i32* %4
br label %40
60: ; preds = %40
store i64 8, i64* %5
store i32 0, i32* %1
br label %61
61: ; preds = %87, %60
%62 = load i32, i32* %1
%63 = sext i32 %62 to i64
%64 = icmp ult i64 %63, 59
br i1 %64, label %65, label %92
65: ; preds = %61
store i32 -4, i32* %2
br label %66
66: ; preds = %83, %65
%67 = load i32, i32* %2
%68 = icmp slt i32 %67, 4
br i1 %68, label %69, label %86
69: ; preds = %66
%70 = load i64, i64* %5
%71 = load i32, i32* %2
%72 = sext i32 %71 to i64
%73 = add nsw i64 %70, %72
%74 = call i32 @erl_mk_longlong(i64 %73)
%75 = call i32 @encode_decode(i32 %74, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%76 = load i64, i64* %5
%77 = load i32, i32* %2
%78 = sext i32 %77 to i64
%79 = add nsw i64 %76, %78
%80 = sub nsw i64 0, %79
%81 = call i32 @erl_mk_longlong(i64 %80)
%82 = call i32 @encode_decode(i32 %81, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %83
83: ; preds = %69
%84 = load i32, i32* %2
%85 = add nsw i32 %84, 1
store i32 %85, i32* %2
br label %66
86: ; preds = %66
br label %87
87: ; preds = %86
%88 = load i64, i64* %5
%89 = shl i64 %88, 1
store i64 %89, i64* %5
%90 = load i32, i32* %1
%91 = add nsw i32 %90, 1
store i32 %91, i32* %1
br label %61
92: ; preds = %61
store i64 8, i64* %6
br label %93
93: ; preds = %111, %92
%94 = load i64, i64* %6
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %114
96: ; preds = %93
store i32 -4, i32* %2
br label %97
97: ; preds = %107, %96
%98 = load i32, i32* %2
%99 = icmp slt i32 %98, 4
br i1 %99, label %100, label %110
100: ; preds = %97
%101 = load i64, i64* %6
%102 = load i32, i32* %2
%103 = sext i32 %102 to i64
%104 = add i64 %101, %103
%105 = call i32 @erl_mk_ulonglong(i64 %104)
%106 = call i32 @encode_decode(i32 %105, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %107
107: ; preds = %100
%108 = load i32, i32* %2
%109 = add nsw i32 %108, 1
store i32 %109, i32* %2
br label %97
110: ; preds = %97
br label %111
111: ; preds = %110
%112 = load i64, i64* %6
%113 = shl i64 %112, 1
store i64 %113, i64* %6
br label %93
114: ; preds = %93
%115 = call i32 @do_report(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.7, i64 0, i64 0), i32 185, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"ALL\00"
@.str.1 = [4 x i8] c"INT\00"
@.str.2 = [8 x i8] c"NEG INT\00"
@.str.3 = [5 x i8] c"UINT\00"
@.str.4 = [9 x i8] c"LONGLONG\00"
@.str.5 = [13 x i8] c"NEG LONGLONG\00"
@.str.6 = [10 x i8] c"ULONGLONG\00"
@.str.7 = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c\00"
define void @round_trip_conversion() {
%1 = tail call i32 @erl_init(i32* null, i32 0)
%2 = tail call i32 (...) @all_types()
%3 = tail call i32 @encode_decode(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ 8, %0 ], [ %54, %4 ]
%6 = phi i32 [ 0, %0 ], [ %55, %4 ]
%7 = add nsw i32 %5, -4
%8 = tail call i32 @erl_mk_int(i32 %7)
%9 = tail call i32 @encode_decode(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = sub i32 4, %5
%11 = tail call i32 @erl_mk_int(i32 %10)
%12 = tail call i32 @encode_decode(i32 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%13 = add nsw i32 %5, -3
%14 = tail call i32 @erl_mk_int(i32 %13)
%15 = tail call i32 @encode_decode(i32 %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%16 = sub i32 3, %5
%17 = tail call i32 @erl_mk_int(i32 %16)
%18 = tail call i32 @encode_decode(i32 %17, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%19 = add nsw i32 %5, -2
%20 = tail call i32 @erl_mk_int(i32 %19)
%21 = tail call i32 @encode_decode(i32 %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%22 = sub i32 2, %5
%23 = tail call i32 @erl_mk_int(i32 %22)
%24 = tail call i32 @encode_decode(i32 %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%25 = add nsw i32 %5, -1
%26 = tail call i32 @erl_mk_int(i32 %25)
%27 = tail call i32 @encode_decode(i32 %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%28 = sub i32 1, %5
%29 = tail call i32 @erl_mk_int(i32 %28)
%30 = tail call i32 @encode_decode(i32 %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%31 = tail call i32 @erl_mk_int(i32 %5)
%32 = tail call i32 @encode_decode(i32 %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%33 = sub nsw i32 0, %5
%34 = tail call i32 @erl_mk_int(i32 %33)
%35 = tail call i32 @encode_decode(i32 %34, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%36 = or i32 %5, 1
%37 = tail call i32 @erl_mk_int(i32 %36)
%38 = tail call i32 @encode_decode(i32 %37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%39 = sub nsw i32 0, %36
%40 = tail call i32 @erl_mk_int(i32 %39)
%41 = tail call i32 @encode_decode(i32 %40, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%42 = or i32 %5, 2
%43 = tail call i32 @erl_mk_int(i32 %42)
%44 = tail call i32 @encode_decode(i32 %43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%45 = sub nsw i32 0, %42
%46 = tail call i32 @erl_mk_int(i32 %45)
%47 = tail call i32 @encode_decode(i32 %46, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%48 = or i32 %5, 3
%49 = tail call i32 @erl_mk_int(i32 %48)
%50 = tail call i32 @encode_decode(i32 %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%51 = sub nsw i32 0, %48
%52 = tail call i32 @erl_mk_int(i32 %51)
%53 = tail call i32 @encode_decode(i32 %52, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%54 = shl i32 %5, 1
%55 = add nuw nsw i32 %6, 1
%56 = icmp eq i32 %55, 27
br i1 %56, label %57, label %4
57: ; preds = %4, %57
%58 = phi i32 [ %82, %57 ], [ 8, %4 ]
%59 = add i32 %58, -4
%60 = tail call i32 @erl_mk_uint(i32 %59)
%61 = tail call i32 @encode_decode(i32 %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%62 = add i32 %58, -3
%63 = tail call i32 @erl_mk_uint(i32 %62)
%64 = tail call i32 @encode_decode(i32 %63, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%65 = add i32 %58, -2
%66 = tail call i32 @erl_mk_uint(i32 %65)
%67 = tail call i32 @encode_decode(i32 %66, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%68 = add i32 %58, -1
%69 = tail call i32 @erl_mk_uint(i32 %68)
%70 = tail call i32 @encode_decode(i32 %69, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%71 = tail call i32 @erl_mk_uint(i32 %58)
%72 = tail call i32 @encode_decode(i32 %71, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%73 = or i32 %58, 1
%74 = tail call i32 @erl_mk_uint(i32 %73)
%75 = tail call i32 @encode_decode(i32 %74, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%76 = or i32 %58, 2
%77 = tail call i32 @erl_mk_uint(i32 %76)
%78 = tail call i32 @encode_decode(i32 %77, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%79 = or i32 %58, 3
%80 = tail call i32 @erl_mk_uint(i32 %79)
%81 = tail call i32 @encode_decode(i32 %80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%82 = shl i32 %58, 1
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %57
84: ; preds = %57, %84
%85 = phi i64 [ %134, %84 ], [ 8, %57 ]
%86 = phi i32 [ %135, %84 ], [ 0, %57 ]
%87 = add nsw i64 %85, -4
%88 = tail call i32 @erl_mk_longlong(i64 %87)
%89 = tail call i32 @encode_decode(i32 %88, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%90 = sub i64 4, %85
%91 = tail call i32 @erl_mk_longlong(i64 %90)
%92 = tail call i32 @encode_decode(i32 %91, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%93 = add nsw i64 %85, -3
%94 = tail call i32 @erl_mk_longlong(i64 %93)
%95 = tail call i32 @encode_decode(i32 %94, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%96 = sub i64 3, %85
%97 = tail call i32 @erl_mk_longlong(i64 %96)
%98 = tail call i32 @encode_decode(i32 %97, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%99 = add nsw i64 %85, -2
%100 = tail call i32 @erl_mk_longlong(i64 %99)
%101 = tail call i32 @encode_decode(i32 %100, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%102 = sub i64 2, %85
%103 = tail call i32 @erl_mk_longlong(i64 %102)
%104 = tail call i32 @encode_decode(i32 %103, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%105 = add nsw i64 %85, -1
%106 = tail call i32 @erl_mk_longlong(i64 %105)
%107 = tail call i32 @encode_decode(i32 %106, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%108 = sub i64 1, %85
%109 = tail call i32 @erl_mk_longlong(i64 %108)
%110 = tail call i32 @encode_decode(i32 %109, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%111 = tail call i32 @erl_mk_longlong(i64 %85)
%112 = tail call i32 @encode_decode(i32 %111, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%113 = sub nsw i64 0, %85
%114 = tail call i32 @erl_mk_longlong(i64 %113)
%115 = tail call i32 @encode_decode(i32 %114, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%116 = or i64 %85, 1
%117 = tail call i32 @erl_mk_longlong(i64 %116)
%118 = tail call i32 @encode_decode(i32 %117, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%119 = sub nsw i64 0, %116
%120 = tail call i32 @erl_mk_longlong(i64 %119)
%121 = tail call i32 @encode_decode(i32 %120, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%122 = or i64 %85, 2
%123 = tail call i32 @erl_mk_longlong(i64 %122)
%124 = tail call i32 @encode_decode(i32 %123, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%125 = sub nsw i64 0, %122
%126 = tail call i32 @erl_mk_longlong(i64 %125)
%127 = tail call i32 @encode_decode(i32 %126, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%128 = or i64 %85, 3
%129 = tail call i32 @erl_mk_longlong(i64 %128)
%130 = tail call i32 @encode_decode(i32 %129, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%131 = sub nsw i64 0, %128
%132 = tail call i32 @erl_mk_longlong(i64 %131)
%133 = tail call i32 @encode_decode(i32 %132, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%134 = shl i64 %85, 1
%135 = add nuw nsw i32 %86, 1
%136 = icmp eq i32 %135, 59
br i1 %136, label %137, label %84
137: ; preds = %84, %137
%138 = phi i64 [ %162, %137 ], [ 8, %84 ]
%139 = add i64 %138, -4
%140 = tail call i32 @erl_mk_ulonglong(i64 %139)
%141 = tail call i32 @encode_decode(i32 %140, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%142 = add i64 %138, -3
%143 = tail call i32 @erl_mk_ulonglong(i64 %142)
%144 = tail call i32 @encode_decode(i32 %143, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%145 = add i64 %138, -2
%146 = tail call i32 @erl_mk_ulonglong(i64 %145)
%147 = tail call i32 @encode_decode(i32 %146, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%148 = add i64 %138, -1
%149 = tail call i32 @erl_mk_ulonglong(i64 %148)
%150 = tail call i32 @encode_decode(i32 %149, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%151 = tail call i32 @erl_mk_ulonglong(i64 %138)
%152 = tail call i32 @encode_decode(i32 %151, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%153 = or i64 %138, 1
%154 = tail call i32 @erl_mk_ulonglong(i64 %153)
%155 = tail call i32 @encode_decode(i32 %154, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%156 = or i64 %138, 2
%157 = tail call i32 @erl_mk_ulonglong(i64 %156)
%158 = tail call i32 @encode_decode(i32 %157, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%159 = or i64 %138, 3
%160 = tail call i32 @erl_mk_ulonglong(i64 %159)
%161 = tail call i32 @encode_decode(i32 %160, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%162 = shl i64 %138, 1
%163 = icmp eq i64 %162, 0
br i1 %163, label %164, label %137
164: ; preds = %137
%165 = tail call i32 @do_report(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.7, i64 0, i64 0), i32 185, i32 1)
ret void
}