xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int strlen(char *);
int str_isascii(char *s) {
  int L = strlen(s);
  int i;
  for (i = 0; i < L; i++) {
    if (!(((s[i]) & ~0x7f) == 0))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<str_isascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1172 <str_isascii+0x62>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xffffff80,%eax
cmp    $0x0,%eax
je     115f <str_isascii+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1179 <str_isascii+0x69>
jmp    1164 <str_isascii+0x54>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112f <str_isascii+0x1f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_isascii>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jle    113f <str_isascii+0x2f>
mov    %ecx,%ecx
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rbx,%rdx,1)
js     1141 <str_isascii+0x31>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1130 <str_isascii+0x20>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @str_isascii(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %23, %1
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %26
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = and i32 %18, -128
%20 = icmp eq i32 %19, 0
br i1 %20, label %22, label %21
21: ; preds = %12
store i32 0, i32* %2
br label %27
22: ; preds = %12
br label %23
23: ; preds = %22
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %8
26: ; preds = %8
store i32 1, i32* %2
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @str_isascii(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp sgt i8 %11, -1
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %6, label %14
14: ; preds = %8, %6, %1
%15 = phi i32 [ 1, %1 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %15
}
/* Variables and functions */
int runClient(int, char **);
int main(int argc, char *argv[]) { return runClient(argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <runClient@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <runClient@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @runClient(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @runClient(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct option *);
int /*<<< orphan*/ free(struct option *);
void optionlist_done(struct option *o) {
  assert(o);
  free(o);
}


x86 assembly (clang, -O0):
<optionlist_done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optionlist_done>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define void @optionlist_done(%struct.option* %0) {
%2 = alloca %struct.option*
store %struct.option* %0, %struct.option** %2
%3 = load %struct.option*, %struct.option** %2
%4 = call i32 @assert(%struct.option* %3)
%5 = load %struct.option*, %struct.option** %2
%6 = call i32 @free(%struct.option* %5)
ret void
}

LLVM IR (-O2):
%struct.option = type { i32 }
define void @optionlist_done(%struct.option* %0) {
%2 = tail call i32 @assert(%struct.option* %0)
%3 = tail call i32 @free(%struct.option* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eraseLine(char *const, int /*<<< orphan*/,
                             unsigned int const, unsigned int, unsigned int);
int /*<<< orphan*/ goxy(unsigned int, unsigned int);
int /*<<< orphan*/ memset(char *const, int /*<<< orphan*/, int const);
void clrcmdline_oxy_d(char *const str, const int maxlen,
                      const unsigned charcount, unsigned orgx, unsigned orgy) {
  eraseLine(str, 0, charcount, orgx, orgy);
  goxy(orgx, orgy);
  memset(str, 0, maxlen);
}


x86 assembly (clang, -O0):
<clrcmdline_oxy_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
xor    %esi,%esi
call   1030 <eraseLine@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <goxy@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrcmdline_oxy_d>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r15d
mov    %ecx,%ebp
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <eraseLine@plt>
mov    %ebp,%edi
mov    %r15d,%esi
call   1050 <goxy@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <memset@plt>

LLVM IR (-O0):
define void @clrcmdline_oxy_d(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %8
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = call i32 @eraseLine(i8* %11, i32 0, i32 %12, i32 %13, i32 %14)
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = call i32 @goxy(i32 %16, i32 %17)
%19 = load i8*, i8** %6
%20 = load i32, i32* %7
%21 = call i32 @memset(i8* %19, i32 0, i32 %20)
ret void
}

LLVM IR (-O2):
define void @clrcmdline_oxy_d(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @eraseLine(i8* %0, i32 0, i32 %2, i32 %3, i32 %4)
%7 = tail call i32 @goxy(i32 %3, i32 %4)
%8 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ read_ble8(void const *);
uint8_t read_le8(const void *src) { return read_ble8(src); }


x86 assembly (clang, -O0):
<read_le8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_ble8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_le8>:
jmp    1030 <read_ble8@plt>

LLVM IR (-O0):
define i32 @read_le8(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @read_ble8(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @read_le8(i8* %0) {
%2 = tail call i32 @read_ble8(i8* %0)
ret i32 %2
}
unsigned int rshift_rnd_us_sf(unsigned int x, unsigned int a) {
  return ((x + (1 << (a - 1))) >> a);
}


x86 assembly (clang, -O0):
<rshift_rnd_us_sf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rshift_rnd_us_sf>:
lea    -0x1(%rsi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    %edi,%eax
mov    %esi,%ecx
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rshift_rnd_us_sf(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub i32 %6, 1
%8 = shl i32 1, %7
%9 = add i32 %5, %8
%10 = load i32, i32* %4
%11 = lshr i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @rshift_rnd_us_sf(i32 %0, i32 %1) {
%3 = add i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = add i32 %4, %0
%6 = lshr i32 %5, %1
ret i32 %6
}
int test_imm_E8uint8_reg(unsigned char val) {
  return ((val) & (-0xE8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E8uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff18,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E8uint8_reg>:
test   $0x18,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E8uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -232
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_E8uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 24
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void UARTBreakCtl(unsigned int baseAdd, unsigned int breakState) {
  (*((volatile unsigned int *)(baseAdd + (0xC)))) &= ~((0x00000040u));
  (*((volatile unsigned int *)(baseAdd + (0xC)))) |=
      (breakState & (0x00000040u));
}


x86 assembly (clang, -O0):
<UARTBreakCtl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffbf,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x40,%edx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTBreakCtl>:
add    $0xc,%edi
andl   $0xffffffbf,(%rdi)
and    $0x40,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTBreakCtl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add i32 %5, 12
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -65
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 64
%13 = load i32, i32* %3
%14 = add i32 %13, 12
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @UARTBreakCtl(i32 %0, i32 %1) {
%3 = add i32 %0, 12
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -65
store volatile i32 %7, i32* %5
%8 = and i32 %1, 64
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DH;

/* Variables and functions */
int /*<<< orphan*/ *DH_get_1024_160();
DH *get_dh512() { return DH_get_1024_160(); }


x86 assembly (clang, -O0):
<get_dh512>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DH_get_1024_160@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dh512>:
xor    %eax,%eax
jmp    1030 <DH_get_1024_160@plt>

LLVM IR (-O0):
define i32* @get_dh512() {
%1 = call i32* (...) @DH_get_1024_160()
ret i32* %1
}

LLVM IR (-O2):
define i32* @get_dh512() {
%1 = tail call i32* (...) @DH_get_1024_160()
ret i32* %1
}
/* Variables and functions */
void *LoadLibrary(char const *);
void *Parrot_dlopen(const char *filename) { return LoadLibrary(filename); }


x86 assembly (clang, -O0):
<Parrot_dlopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <LoadLibrary@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Parrot_dlopen>:
jmp    1030 <LoadLibrary@plt>

LLVM IR (-O0):
define i8* @Parrot_dlopen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @LoadLibrary(i8* %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @Parrot_dlopen(i8* %0) {
%2 = tail call i8* @LoadLibrary(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ do_it(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int (*)(), int *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main() {
  int a = 0;
  fprintf(stderr, " *** Main func: %p sp: %p\n", main, &a);
  printf("Result is %lld\n", do_it(10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
mov    0x2e8b(%rip),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <fprintf@plt>
mov    $0xa,%edi
call   1050 <do_it@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
mov    0x2e98(%rip),%rdx
lea    0x4(%rsp),%rcx
call   1040 <fprintf@plt>
mov    $0xa,%edi
call   1050 <do_it@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c" *** Main func: %p sp: %p\0A\00"
@.str.1 = [16 x i8] c"Result is %lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 (...)* bitcast (i32 ()* @main to i32 (...)*), i32* %2)
%5 = call i32 @do_it(i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c" *** Main func: %p sp: %p\0A\00"
@.str.1 = [16 x i8] c"Result is %lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 (...)* bitcast (i32 ()* @main to i32 (...)*), i32* %1)
%5 = call i32 @do_it(i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void sanitize_options() {}


x86 assembly (clang, -O0):
<sanitize_options>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanitize_options>:
ret

LLVM IR (-O0):
define void @sanitize_options() {
ret void
}

LLVM IR (-O2):
define void @sanitize_options() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void hot_mem_Free(void *mem) { free(mem); }


x86 assembly (clang, -O0):
<hot_mem_Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hot_mem_Free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @hot_mem_Free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @hot_mem_Free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void fs_posix_init(void) { return; }


x86 assembly (clang, -O0):
<fs_posix_init>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_posix_init>:
ret

LLVM IR (-O0):
define void @fs_posix_init() {
ret void
}

LLVM IR (-O2):
define void @fs_posix_init() {
ret void
}
long read_synchsafe_size_integer(char bytes[]) {
  long total = 0;
  for (int i = 0; i < 4; ++i) {
    total += (bytes[i] & 0x7F) << (3 - i) * 7;
  }
  return total;
}


x86 assembly (clang, -O0):
<read_synchsafe_size_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1155 <read_synchsafe_size_integer+0x55>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    $0x7f,%eax
mov    $0x3,%ecx
sub    -0x14(%rbp),%ecx
imul   $0x7,%ecx,%ecx
shl    %cl,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <read_synchsafe_size_integer+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_synchsafe_size_integer>:
movzbl (%rdi),%eax
and    $0x7f,%eax
shl    $0x15,%rax
movzbl 0x1(%rdi),%ecx
and    $0x7f,%ecx
shl    $0xe,%rcx
or     %rax,%rcx
movzbl 0x2(%rdi),%edx
and    $0x7f,%edx
shl    $0x7,%rdx
or     %rcx,%rdx
movzbl 0x3(%rdi),%eax
and    $0x7f,%eax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @read_synchsafe_size_integer(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i8* %0, i8** %2
store i64 0, i64* %3
store i32 0, i32* %4
br label %5
5: ; preds = %23, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = and i32 %14, 127
%16 = load i32, i32* %4
%17 = sub nsw i32 3, %16
%18 = mul nsw i32 %17, 7
%19 = shl i32 %15, %18
%20 = sext i32 %19 to i64
%21 = load i64, i64* %3
%22 = add nsw i64 %21, %20
store i64 %22, i64* %3
br label %23
23: ; preds = %8
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %5
26: ; preds = %5
%27 = load i64, i64* %3
ret i64 %27
}

LLVM IR (-O2):
define i64 @read_synchsafe_size_integer(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 127
%4 = zext i8 %3 to i64
%5 = shl nuw nsw i64 %4, 21
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = and i8 %7, 127
%9 = zext i8 %8 to i64
%10 = shl nuw nsw i64 %9, 14
%11 = or i64 %5, %10
%12 = getelementptr inbounds i8, i8* %0, i64 2
%13 = load i8, i8* %12
%14 = and i8 %13, 127
%15 = zext i8 %14 to i64
%16 = shl nuw nsw i64 %15, 7
%17 = or i64 %11, %16
%18 = getelementptr inbounds i8, i8* %0, i64 3
%19 = load i8, i8* %18
%20 = and i8 %19, 127
%21 = zext i8 %20 to i64
%22 = or i64 %17, %21
ret i64 %22
}
/* Variables and functions */
int bs_format_size(char const *);
unsigned bs_format_byte_size(const char *format) {
  return bs_format_size(format) / 8;
}


x86 assembly (clang, -O0):
<bs_format_byte_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bs_format_size@plt>
mov    $0x8,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_format_byte_size>:
push   %rax
call   1030 <bs_format_size@plt>
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovs  %ecx,%eax
sar    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bs_format_byte_size(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @bs_format_size(i8* %3)
%5 = sdiv i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @bs_format_byte_size(i8* %0) {
%2 = tail call i32 @bs_format_size(i8* %0)
%3 = sdiv i32 %2, 8
ret i32 %3
}
int xtensa_y(v)
int v;
{
  switch (v) {
  case 2:
  case 3: {
    return 1;
  } break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<xtensa_y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffe,%eax
sub    $0x1,%eax
ja     1127 <xtensa_y+0x27>
jmp    111b <xtensa_y+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    112e <xtensa_y+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtensa_y>:
and    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xtensa_y(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 2, label %5
i32 3, label %5
]
5: ; preds = %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @xtensa_y(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
float f_initial_lives() { return (float)5; }


x86 assembly (clang, -O0):
<f_initial_lives>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_initial_lives>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @f_initial_lives() {
ret float 5.000000e+00
}

LLVM IR (-O2):
define float @f_initial_lives() {
ret float 5.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x7d() {
  Assert_real((isupper(125) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              630, ("isupper should be 0 for }"));
}


x86 assembly (clang, -O0):
<t_isupper_0x7d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7d,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x276,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x7d>:
push   %rax
mov    $0x7d,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x276,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for }\00"
define void @t_isupper_0x7d() {
%1 = call i64 @isupper(i32 125)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 630, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for }\00"
define void @t_isupper_0x7d() {
%1 = tail call i64 @isupper(i32 125)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 630, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uc_uart_init();
void dbg_init() { uc_uart_init(); }


x86 assembly (clang, -O0):
<dbg_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <uc_uart_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_init>:
xor    %eax,%eax
jmp    1030 <uc_uart_init@plt>

LLVM IR (-O0):
define void @dbg_init() {
%1 = call i32 (...) @uc_uart_init()
ret void
}

LLVM IR (-O2):
define void @dbg_init() {
%1 = tail call i32 (...) @uc_uart_init()
ret void
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glutSolidSphere(double, int, int);
void display() {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glutSolidSphere(1.0, 20, 16);
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
movsd  0xead(%rip),%xmm0
mov    $0x14,%edi
mov    $0x10,%esi
call   1050 <glutSolidSphere@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
movsd  0xeb0(%rip),%xmm0
mov    $0x14,%edi
mov    $0x10,%esi
call   1050 <glutSolidSphere@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 @glutSolidSphere(double 1.000000e+00, i32 20, i32 16)
%6 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 @glutSolidSphere(double 1.000000e+00, i32 20, i32 16)
%6 = tail call i32 (...) @glFlush()
ret void
}
void XtResizeWindow() {}


x86 assembly (clang, -O0):
<XtResizeWindow>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XtResizeWindow>:
ret

LLVM IR (-O0):
define void @XtResizeWindow() {
ret void
}

LLVM IR (-O2):
define void @XtResizeWindow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, one!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, one!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello, one!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void intr_enable(int intr, _Bool enable) {
  if (enable) {
    IntSystemEnable(intr);
  } else {
    IntSystemDisable(intr);
  }
}


x86 assembly (clang, -O0):
<intr_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
and    $0x1,%al
mov    %al,-0x5(%rbp)
testb  $0x1,-0x5(%rbp)
je     114c <intr_enable+0x2c>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <IntSystemEnable@plt>
jmp    1156 <intr_enable+0x36>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <IntSystemDisable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_enable>:
xor    %eax,%eax
test   %esi,%esi
je     112b <intr_enable+0xb>
jmp    1040 <IntSystemEnable@plt>
jmp    1030 <IntSystemDisable@plt>

LLVM IR (-O0):
define void @intr_enable(i32 %0, i1 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
%5 = zext i1 %1 to i8
store i8 %5, i8* %4
%6 = load i8, i8* %4
%7 = trunc i8 %6 to i1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %3
%10 = call i32 (i32, ...) bitcast (i32 (...)* @IntSystemEnable to i32 (i32, ...)*)(i32 %9)
br label %14
11: ; preds = %2
%12 = load i32, i32* %3
%13 = call i32 (i32, ...) bitcast (i32 (...)* @IntSystemDisable to i32 (i32, ...)*)(i32 %12)
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
define void @intr_enable(i32 %0, i1 zeroext %1) {
br i1 %1, label %3, label %5
3: ; preds = %2
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @IntSystemEnable to i32 (i32, ...)*)(i32 %0)
br label %7
5: ; preds = %2
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @IntSystemDisable to i32 (i32, ...)*)(i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
int main(void) {
  ft_putstr("Hey Dude!");
  ft_putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Hey Dude!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ft_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ft_putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hey Dude!\00"
define i32 @main() {
%1 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int retirer();
void *threadB(void *arg) {
  for (int i = 0; i < 1000; i++) {
    int res = retirer();
    (void)res;
  }
  return 0;
}


x86 assembly (clang, -O0):
<threadB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1148 <threadB+0x38>
mov    $0x0,%al
call   1030 <retirer@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <threadB+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadB>:
push   %rbx
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <retirer@plt>
add    $0xffffffff,%ebx
jne    1120 <threadB+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @threadB(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %11, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1000
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = call i32 (...) @retirer()
store i32 %9, i32* %4
%10 = load i32, i32* %4
br label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %5
14: ; preds = %5
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @threadB(i8* nocapture readnone %0) {
br label %3
2: ; preds = %3
ret i8* null
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %6, %3 ]
%5 = tail call i32 (...) @retirer()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 1000
br i1 %7, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int diff(char a, int b) {
  putchar(98);
  if (a > b)
    return a - b;
  else
    return 1 + diff(b, a);
}


x86 assembly (clang, -O0):
<diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x62,%edi
call   1030 <putchar@plt>
movsbl -0x5(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1157 <diff+0x37>
movsbl -0x5(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <diff+0x4c>
mov    -0xc(%rbp),%eax
movsbl -0x5(%rbp),%esi
movsbl %al,%edi
call   1040 <diff@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff>:
push   %rbp
push   %r14
push   %rbx
mov    $0xffffffff,%ebx
nopl   0x0(%rax)
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0x62,%edi
call   1030 <putchar@plt>
movsbl %r14b,%esi
add    $0x1,%ebx
mov    %ebp,%edi
cmp    %esi,%ebp
jge    1120 <diff+0x10>
movsbl %r14b,%eax
sub    %ebp,%eax
add    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @diff(i8 signext %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = call i32 @putchar(i32 98)
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = load i32, i32* %5
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = load i32, i32* %5
%15 = sub nsw i32 %13, %14
store i32 %15, i32* %3
br label %23
16: ; preds = %2
%17 = load i32, i32* %5
%18 = trunc i32 %17 to i8
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = call i32 @diff(i8 signext %18, i32 %20)
%22 = add nsw i32 1, %21
store i32 %22, i32* %3
br label %23
23: ; preds = %16, %11
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @diff(i8 signext %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %11, %3 ]
%5 = phi i8 [ %0, %2 ], [ %10, %3 ]
%6 = phi i32 [ %1, %2 ], [ %8, %3 ]
%7 = tail call i32 @putchar(i32 98)
%8 = sext i8 %5 to i32
%9 = icmp slt i32 %6, %8
%10 = trunc i32 %6 to i8
%11 = add nuw nsw i32 %4, 1
br i1 %9, label %12, label %3
12: ; preds = %3
%13 = sub i32 %4, %6
%14 = add i32 %13, %8
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int main() {
  while (1)
    getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @getchar()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @getchar()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void version(void) {
  printf(" CMatrix version %s by Chris Allegretta (compiled %s, %s)\n", "1.1b",
         "07:30:02", "Mar 17 2022");
  printf(" Email: cmatrix@asty.org  Web: http://www.asty.org/cmatrix\n");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf19(%rip),%rsi
lea    0xf17(%rip),%rdx
lea    0xf19(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf0c(%rip),%rsi
lea    0xf0a(%rip),%rdx
lea    0xf0c(%rip),%rcx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf0a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [59 x i8] c" CMatrix version %s by Chris Allegretta (compiled %s, %s)\0A\00"
@.str.1 = [5 x i8] c"1.1b\00"
@.str.2 = [9 x i8] c"07:30:02\00"
@.str.3 = [12 x i8] c"Mar 17 2022\00"
@.str.4 = [60 x i8] c" Email: cmatrix@asty.org Web: http://www.asty.org/cmatrix\0A\00"
define void @version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c" CMatrix version %s by Chris Allegretta (compiled %s, %s)\0A\00"
@.str.1 = [5 x i8] c"1.1b\00"
@.str.2 = [9 x i8] c"07:30:02\00"
@.str.3 = [12 x i8] c"Mar 17 2022\00"
@str = [59 x i8] c" Email: cmatrix@asty.org Web: http://www.asty.org/cmatrix\00"
define void @version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int const, char const *);
char system(char *);
char view_image_file(const char *fname, const int duration) {
  char resx = 0, cmdx[500];
  snprintf(cmdx, 500, "fbi -noverbose -a -1 -T 1 -t %d \"%s\"", duration,
           fname);
  resx = system(cmdx);
  return resx;
}


x86 assembly (clang, -O0):
<view_image_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movb   $0x0,-0xd(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%r8
mov    $0x1f4,%esi
lea    0xeb0(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <system@plt>
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<view_image_file>:
push   %rbx
sub    $0x200,%rsp
mov    %esi,%ecx
mov    %rdi,%r8
lea    0xecc(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1f4,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"fbi -noverbose -a -1 -T 1 -t %d \22%s\22\00"
define signext i8 @view_image_file(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
%6 = alloca [500 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8 0, i8* %5
%7 = getelementptr inbounds [500 x i8], [500 x i8]* %6, i64 0, i64 0
%8 = load i32, i32* %4
%9 = load i8*, i8** %3
%10 = call i32 @snprintf(i8* %7, i32 500, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
%11 = getelementptr inbounds [500 x i8], [500 x i8]* %6, i64 0, i64 0
%12 = call signext i8 @system(i8* %11)
store i8 %12, i8* %5
%13 = load i8, i8* %5
ret i8 %13
}

LLVM IR (-O2):
@.str = [37 x i8] c"fbi -noverbose -a -1 -T 1 -t %d \22%s\22\00"
define signext i8 @view_image_file(i8* %0, i32 %1) {
%3 = alloca [500 x i8]
%4 = getelementptr inbounds [500 x i8], [500 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 500, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
%6 = call signext i8 @system(i8* %4)
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ m136_setParams4102(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m172doBitRev(int /*<<< orphan*/);
void m172_setParams4102(uint16_t addr, uint8_t val) {
  m136_setParams4102(addr, m172doBitRev(val));
}


x86 assembly (clang, -O0):
<m172_setParams4102>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <m172doBitRev@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <m136_setParams4102@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m172_setParams4102>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <m172doBitRev@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <m136_setParams4102@plt>

LLVM IR (-O0):
define void @m172_setParams4102(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @m172doBitRev(i32 %6)
%8 = call i32 @m136_setParams4102(i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @m172_setParams4102(i32 %0, i32 %1) {
%3 = tail call i32 @m172doBitRev(i32 %1)
%4 = tail call i32 @m136_setParams4102(i32 %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void burn_stack(int bytes) {
  char buf[128];
  memset(buf, 0, sizeof buf);
  bytes -= sizeof buf;
  if (bytes > 0)
    burn_stack(bytes);
}


x86 assembly (clang, -O0):
<burn_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
movslq -0x4(%rbp),%rax
sub    $0x80,%rax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1160 <burn_stack+0x40>
mov    -0x4(%rbp),%edi
call   1040 <burn_stack@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<burn_stack>:
push   %rbx
sub    $0x80,%rsp
mov    %edi,%ebx
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
add    $0xffffff80,%ebx
test   %ebx,%ebx
jle    1147 <burn_stack+0x27>
mov    %ebx,%edi
call   1040 <burn_stack@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @burn_stack(i32 %0) {
%2 = alloca i32
%3 = alloca [128 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 128)
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = sub i64 %7, 128
%9 = trunc i64 %8 to i32
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
define void @burn_stack(i32 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 128)
%5 = add i32 %0, -128
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ greeting();
int main(int argc, char *argv[]) {
  greeting();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <greeting@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <greeting@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @greeting()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @greeting()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: vm [options] IMAGE\n"
                  "Available options are:\n"
                  "  -d       Set breakpoint at startup\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [87 x i8] c"Usage: vm [options] IMAGE\0AAvailable options are:\0A -d Set breakpoint at startup\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [87 x i8] c"Usage: vm [options] IMAGE\0AAvailable options are:\0A -d Set breakpoint at startup\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
struct mempool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mempool *);
int /*<<< orphan*/ mempool_destroy(struct mempool *);
void mempool_delete(struct mempool *__restrict pool) {
  mempool_destroy(pool);
  free(pool);
}


x86 assembly (clang, -O0):
<mempool_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mempool_destroy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mempool_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mempool_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.mempool = type { i32 }
define void @mempool_delete(%struct.mempool* noalias %0) {
%2 = alloca %struct.mempool*
store %struct.mempool* %0, %struct.mempool** %2
%3 = load %struct.mempool*, %struct.mempool** %2
%4 = call i32 @mempool_destroy(%struct.mempool* %3)
%5 = load %struct.mempool*, %struct.mempool** %2
%6 = call i32 @free(%struct.mempool* %5)
ret void
}

LLVM IR (-O2):
%struct.mempool = type { i32 }
define void @mempool_delete(%struct.mempool* noalias %0) {
%2 = tail call i32 @mempool_destroy(%struct.mempool* %0)
%3 = tail call i32 @free(%struct.mempool* %0)
ret void
}
OP(dd, ec) { op_ec(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_ec@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_ec@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @op_ec()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_ec()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ output;

/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ mmx_601(int, unsigned long *);
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char);
int main(int argc, char *argv[]) {
  unsigned char output[16];
  memset(output, 0, sizeof(output));
  mmx_601(1, (unsigned long *)output);
  printf("%02x%02x\n", *(unsigned char *)&output[1],
         *(unsigned char *)&output[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rsi
mov    $0x1,%edi
call   1050 <mmx_601@plt>
mov    -0x1f(%rbp),%al
lea    0xe92(%rip),%rdi
movzbl %al,%esi
movzbl -0x20(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1050 <mmx_601@plt>
movzbl 0x1(%rsp),%esi
movzbl (%rsp),%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%02x%02x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%8 = call i32 @memset(i8* %7, i32 0, i32 16)
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%10 = bitcast i8* %9 to i64*
%11 = call i32 @mmx_601(i32 1, i64* %10)
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 1
%13 = load i8, i8* %12
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 zeroext %13, i8 zeroext %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%02x%02x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 16)
%6 = bitcast [16 x i8]* %3 to i64*
%7 = call i32 @mmx_601(i32 1, i64* %6)
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 1
%9 = load i8, i8* %8
%10 = load i8, i8* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 zeroext %9, i8 zeroext %10)
ret i32 0
}