xunge/DecIR huggingface dataset:
int main(void) {
  int k = 5;
  while (k <= 1000) {
    if (k == 0) {
      break;
    }
    if (k == 1) {
      break;
    } else if (k == 2) {
      break;
    } else if (k == 3) {
      break;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jg     116a <main+0x6a>
cmpl   $0x0,-0x8(%rbp)
jne    112e <main+0x2e>
jmp    116a <main+0x6a>
cmpl   $0x1,-0x8(%rbp)
jne    113d <main+0x3d>
jmp    116a <main+0x6a>
cmpl   $0x2,-0x8(%rbp)
jne    114c <main+0x4c>
jmp    116a <main+0x6a>
cmpl   $0x3,-0x8(%rbp)
jne    115b <main+0x5b>
jmp    116a <main+0x6a>
jmp    1160 <main+0x60>
jmp    1165 <main+0x65>
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
br label %3
3: ; preds = %24, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 1000
br i1 %5, label %6, label %25
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
br label %25
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %10
br label %25
14: ; preds = %10
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %18
17: ; preds = %14
br label %25
18: ; preds = %14
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 3
br i1 %20, label %21, label %22
21: ; preds = %18
br label %25
22: ; preds = %18
br label %23
23: ; preds = %22
br label %24
24: ; preds = %23
br label %3
25: ; preds = %21, %17, %13, %9, %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int strcmp(char *, char *);
unsigned char aclpolicy(char *p) {
  if (strcmp(p, "accept") == 0)
    return (1);
  if (strcmp(p, "reject") == 1)
    return (2);
  return (255);
}


x86 assembly (clang, -O0):
<aclpolicy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    113e <aclpolicy+0x2e>
movb   $0x1,-0x1(%rbp)
jmp    1164 <aclpolicy+0x54>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x1,%eax
jne    1160 <aclpolicy+0x50>
movb   $0x2,-0x1(%rbp)
jmp    1164 <aclpolicy+0x54>
movb   $0xff,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aclpolicy>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1145 <aclpolicy+0x35>
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
cmp    $0x1,%eax
mov    $0x2,%ecx
mov    $0xff,%eax
cmove  %ecx,%eax
pop    %rbx
ret
mov    $0x1,%al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"accept\00"
@.str.1 = [7 x i8] c"reject\00"
define zeroext i8 @aclpolicy(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 1, i8* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strcmp(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 2, i8* %2
br label %14
13: ; preds = %8
store i8 -1, i8* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
@.str = [7 x i8] c"accept\00"
@.str.1 = [7 x i8] c"reject\00"
define zeroext i8 @aclpolicy(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i8 2, i8 -1
br label %8
8: ; preds = %4, %1
%9 = phi i8 [ 1, %1 ], [ %7, %4 ]
ret i8 %9
}
void deref_after_null_check_bad(int *x) {
  if (x == 0) {
    *x = 1;
  }
}


x86 assembly (clang, -O0):
<deref_after_null_check_bad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111d <deref_after_null_check_bad+0x1d>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @deref_after_null_check_bad(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32*, i32** %2
store i32 1, i32* %6
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @deref_after_null_check_bad(i32* readnone %0) {
%2 = icmp ne i32* %0, null
tail call void @llvm.assume(i1 %2)
ret void
}
void *occampi_matchedformal_chook_copy(void *chook) { return chook; }


x86 assembly (clang, -O0):
<occampi_matchedformal_chook_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<occampi_matchedformal_chook_copy>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @occampi_matchedformal_chook_copy(i8* readnone returned %0) {
ret i8* %0
}
int is_in(char i, char const *str) {
  char const *p = str;
  while (*p != '\0' && *p != i)
    p++;
  return (*p == '\0' ? -1 : p - str);
}


x86 assembly (clang, -O0):
<is_in>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     113e <is_in+0x3e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114e <is_in+0x4e>
jmp    115f <is_in+0x5f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <is_in+0x16>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    117f <is_in+0x7f>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
jmp    118e <is_in+0x8e>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi),%eax
add    $0x1,%ecx
test   %al,%al
je     1123 <is_in+0x23>
add    $0x1,%rsi
cmp    %dil,%al
jne    1110 <is_in+0x10>
cmp    $0x1,%al
sbb    %eax,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @is_in(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
br label %7
7: ; preds = %21, %2
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %15, %17
br label %19
19: ; preds = %12, %7
%20 = phi i1 [ false, %7 ], [ %18, %12 ]
br i1 %20, label %21, label %24
21: ; preds = %19
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %5
br label %7
24: ; preds = %19
%25 = load i8*, i8** %5
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %24
br label %36
30: ; preds = %24
%31 = load i8*, i8** %5
%32 = load i8*, i8** %4
%33 = ptrtoint i8* %31 to i64
%34 = ptrtoint i8* %32 to i64
%35 = sub i64 %33, %34
br label %36
36: ; preds = %30, %29
%37 = phi i64 [ -1, %29 ], [ %35, %30 ]
%38 = trunc i64 %37 to i32
ret i32 %38
}

LLVM IR (-O2):
define i32 @is_in(i8 signext %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %0
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
%11 = ptrtoint i8* %4 to i64
%12 = ptrtoint i8* %1 to i64
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
%15 = select i1 %6, i32 -1, i32 %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ jr();
void opcode_18() { jr(); }


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

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

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

LLVM IR (-O2):
define void @opcode_18() {
%1 = tail call i32 (...) @jr()
ret void
}
int test19_remove_eldest_1(const struct l_hashtbl *h, unsigned long count) {
  (void)(h);
  (void)(count);
  return (count > 3) ? 1 : 0;
}


x86 assembly (clang, -O0):
<test19_remove_eldest_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x3,%rdx
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test19_remove_eldest_1>:
xor    %eax,%eax
cmp    $0x4,%rsi
setae  %al
ret

LLVM IR (-O0):
%struct.l_hashtbl = type opaque
define i32 @test19_remove_eldest_1(%struct.l_hashtbl* %0, i64 %1) {
%3 = alloca %struct.l_hashtbl*
%4 = alloca i64
store %struct.l_hashtbl* %0, %struct.l_hashtbl** %3
store i64 %1, i64* %4
%5 = load %struct.l_hashtbl*, %struct.l_hashtbl** %3
%6 = load i64, i64* %4
%7 = load i64, i64* %4
%8 = icmp ugt i64 %7, 3
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
%struct.l_hashtbl = type opaque
define i32 @test19_remove_eldest_1(%struct.l_hashtbl* nocapture readnone %0, i64 %1) {
%3 = icmp ugt i64 %1, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x3e() {
  Assert_real((isdigit(62) == 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_isdigit.c",
              315, ("isdigit should be 0 for >"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x3e>:
push   %rax
mov    $0x3e,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x13b,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for >\00"
define void @t_isdigit_0x3e() {
%1 = call i64 @isdigit(i32 62)
%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 315, 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for >\00"
define void @t_isdigit_0x3e() {
%1 = tail call i64 @isdigit(i32 62)
%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 315, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned xrop3_81_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = S & stk3;
  stk1 = D | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_81_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_81_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_81_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = xor i32 %31, -1
store i32 %32, i32* %8
%33 = load i32, i32* %8
%34 = load i32, i32* %6
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_81_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i32 %4, -256
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ oh_no();
int /*<<< orphan*/ slinky(int);
void dinky(int i) {
  if (i == 1) {
    oh_no();
  } else {
    slinky(i);
  }
}


x86 assembly (clang, -O0):
<dinky>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1141 <dinky+0x21>
mov    $0x0,%al
call   1030 <oh_no@plt>
jmp    1149 <dinky+0x29>
mov    -0x4(%rbp),%edi
call   1040 <slinky@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dinky>:
cmp    $0x1,%edi
jne    112c <dinky+0xc>
xor    %eax,%eax
jmp    1030 <oh_no@plt>
jmp    1040 <slinky@plt>

LLVM IR (-O0):
define void @dinky(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @oh_no()
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @slinky(i32 %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @dinky(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @oh_no()
br label %7
5: ; preds = %1
%6 = tail call i32 @slinky(i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}
void profiler_init(void) {}


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

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

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

LLVM IR (-O2):
define void @profiler_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ echo(int);
main() { echo(4294967296); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @echo(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @echo(i32 0)
ret i32 0
}
/* Variables and functions */
int bench_fcntl();
int main() { return -bench_fcntl(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @bench_fcntl()
%3 = sub nsw i32 0, %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bench_fcntl()
%2 = sub nsw i32 0, %1
ret i32 %2
}
void write_to_buf(char c, void *output) { *((char *)output) = c; }


x86 assembly (clang, -O0):
<write_to_buf>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_to_buf>:
mov    %dil,(%rsi)
ret

LLVM IR (-O0):
define void @write_to_buf(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = load i8*, i8** %4
store i8 %5, i8* %6
ret void
}

LLVM IR (-O2):
define void @write_to_buf(i8 signext %0, i8* nocapture writeonly %1) {
store i8 %0, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ end(int);
int /*<<< orphan*/ subr(int);
int /*<<< orphan*/ subr2(int);
int main() {
  subr(1);
  end(1);
  subr(2);
  end(2);
  subr(3);
  end(3);
  subr(4);
  end(4);
  subr(5);
  subr2(5);
  end(5);
  subr(6);
  subr2(6);
  end(6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <subr@plt>
mov    $0x1,%edi
call   1040 <end@plt>
mov    $0x2,%edi
call   1030 <subr@plt>
mov    $0x2,%edi
call   1040 <end@plt>
mov    $0x3,%edi
call   1030 <subr@plt>
mov    $0x3,%edi
call   1040 <end@plt>
mov    $0x4,%edi
call   1030 <subr@plt>
mov    $0x4,%edi
call   1040 <end@plt>
mov    $0x5,%edi
call   1030 <subr@plt>
mov    $0x5,%edi
call   1050 <subr2@plt>
mov    $0x5,%edi
call   1040 <end@plt>
mov    $0x6,%edi
call   1030 <subr@plt>
mov    $0x6,%edi
call   1050 <subr2@plt>
mov    $0x6,%edi
call   1040 <end@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <subr@plt>
mov    $0x1,%edi
call   1040 <end@plt>
mov    $0x2,%edi
call   1030 <subr@plt>
mov    $0x2,%edi
call   1040 <end@plt>
mov    $0x3,%edi
call   1030 <subr@plt>
mov    $0x3,%edi
call   1040 <end@plt>
mov    $0x4,%edi
call   1030 <subr@plt>
mov    $0x4,%edi
call   1040 <end@plt>
mov    $0x5,%edi
call   1030 <subr@plt>
mov    $0x5,%edi
call   1050 <subr2@plt>
mov    $0x5,%edi
call   1040 <end@plt>
mov    $0x6,%edi
call   1030 <subr@plt>
mov    $0x6,%edi
call   1050 <subr2@plt>
mov    $0x6,%edi
call   1040 <end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @subr(i32 1)
%3 = call i32 @end(i32 1)
%4 = call i32 @subr(i32 2)
%5 = call i32 @end(i32 2)
%6 = call i32 @subr(i32 3)
%7 = call i32 @end(i32 3)
%8 = call i32 @subr(i32 4)
%9 = call i32 @end(i32 4)
%10 = call i32 @subr(i32 5)
%11 = call i32 @subr2(i32 5)
%12 = call i32 @end(i32 5)
%13 = call i32 @subr(i32 6)
%14 = call i32 @subr2(i32 6)
%15 = call i32 @end(i32 6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @subr(i32 1)
%2 = tail call i32 @end(i32 1)
%3 = tail call i32 @subr(i32 2)
%4 = tail call i32 @end(i32 2)
%5 = tail call i32 @subr(i32 3)
%6 = tail call i32 @end(i32 3)
%7 = tail call i32 @subr(i32 4)
%8 = tail call i32 @end(i32 4)
%9 = tail call i32 @subr(i32 5)
%10 = tail call i32 @subr2(i32 5)
%11 = tail call i32 @end(i32 5)
%12 = tail call i32 @subr(i32 6)
%13 = tail call i32 @subr2(i32 6)
%14 = tail call i32 @end(i32 6)
ret i32 0
}
int SocketOf(int sock) { return sock; }


x86 assembly (clang, -O0):
<SocketOf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SocketOf>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @SocketOf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @SocketOf(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dv_crypto_free(void *ptr, const char *file, int line) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @dv_crypto_free(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @free(i8* %0)
ret void
}
int cyttsp4_devtree_register_devices(struct device *adap_dev) { return 0; }


x86 assembly (clang, -O0):
<cyttsp4_devtree_register_devices>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cyttsp4_devtree_register_devices>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.device = type opaque
define i32 @cyttsp4_devtree_register_devices(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @cyttsp4_devtree_register_devices(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x92() {
  Assert_real((isalpha(146) == 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_isalpha.c",
              735, ("isalpha should be 0 for 0x92"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x92>:
push   %rax
mov    $0x92,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2df,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x92\00"
define void @t_isalpha_0x92() {
%1 = call i64 @isalpha(i32 146)
%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 735, i8* getelementptr inbounds ([29 x i8], [29 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x92\00"
define void @t_isalpha_0x92() {
%1 = tail call i64 @isalpha(i32 146)
%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 735, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ EC_GROUP;

/* Variables and functions */
int PEM_ASN1_write(int /*<<< orphan*/ *, int /*<<< orphan*/,
                   int /*<<< orphan*/ *, void *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *, int /*<<< orphan*/,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_ECPARAMETERS;
scalar_t__ i2d_ECPKParameters;
int PEM_write_ECPKParameters(FILE *fp, const EC_GROUP *x) {
  return PEM_ASN1_write((i2d_of_void *)i2d_ECPKParameters,
                        PEM_STRING_ECPARAMETERS, fp, (void *)x, NULL, NULL, 0,
                        NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_ECPKParameters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_ECPKParameters>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb7(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_ECPKParameters = global i64 0
@PEM_STRING_ECPARAMETERS = global i32 0
define i32 @PEM_write_ECPKParameters(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_ECPKParameters
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_ECPARAMETERS
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = bitcast i32* %9 to i8*
%11 = call i32 @PEM_ASN1_write(i32* %6, i32 %7, i32* %8, i8* %10, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %11
}

LLVM IR (-O2):
@i2d_ECPKParameters = global i64 0
@PEM_STRING_ECPARAMETERS = global i32 0
define i32 @PEM_write_ECPKParameters(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_ECPKParameters
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_ECPARAMETERS
%6 = bitcast i32* %1 to i8*
%7 = tail call i32 @PEM_ASN1_write(i32* %4, i32 %5, i32* %0, i8* %6, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %7
}
void removeTopWall(int (*maze)[25], int startRow, int startCol) {
  int removeRow, removeCol;
  removeRow = ((startRow - 1) + 1) * 2;
  removeCol = (startCol)*2 - 1 + 2;
  maze[removeRow][removeCol] = 0;
}


x86 assembly (clang, -O0):
<removeTopWall>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
add    $0x1,%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x64,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeTopWall>:
add    %esi,%esi
lea    (%rdx,%rdx,1),%eax
add    $0x1,%eax
movslq %esi,%rcx
cltq
imul   $0x64,%rcx,%rcx
add    %rdi,%rcx
movl   $0x0,(%rcx,%rax,4)
ret

LLVM IR (-O0):
define void @removeTopWall([25 x i32]* %0, i32 %1, i32 %2) {
%4 = alloca [25 x i32]*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store [25 x i32]* %0, [25 x i32]** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = add nsw i32 %10, 1
%12 = mul nsw i32 %11, 2
store i32 %12, i32* %7
%13 = load i32, i32* %6
%14 = mul nsw i32 %13, 2
%15 = sub nsw i32 %14, 1
%16 = add nsw i32 %15, 2
store i32 %16, i32* %8
%17 = load [25 x i32]*, [25 x i32]** %4
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [25 x i32], [25 x i32]* %17, i64 %19
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [25 x i32], [25 x i32]* %20, i64 0, i64 %22
store i32 0, i32* %23
ret void
}

LLVM IR (-O2):
define void @removeTopWall([25 x i32]* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 1
%5 = shl nsw i32 %2, 1
%6 = or i32 %5, 1
%7 = sext i32 %4 to i64
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds [25 x i32], [25 x i32]* %0, i64 %7, i64 %8
store i32 0, i32* %9
ret void
}
/* Variables and functions */
int _stat_no_arg();
int _stat_with_arg(char const *);
int /*<<< orphan*/ strlen(char const *);
int do_stat(const char *cmd_arg) {
  if (!strlen(cmd_arg)) {
    return _stat_no_arg();
  }
  return _stat_with_arg(cmd_arg);
}


x86 assembly (clang, -O0):
<do_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%eax
jne    115d <do_stat+0x2d>
mov    $0x0,%al
call   1030 <_stat_no_arg@plt>
mov    %eax,-0x4(%rbp)
jmp    1169 <do_stat+0x39>
mov    -0x10(%rbp),%rdi
call   1050 <_stat_with_arg@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_stat>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
test   %eax,%eax
je     1146 <do_stat+0x16>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <_stat_with_arg@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <_stat_no_arg@plt>

LLVM IR (-O0):
define i32 @do_stat(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 (...) @_stat_no_arg()
store i32 %8, i32* %2
br label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @_stat_with_arg(i8* %10)
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @do_stat(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @_stat_no_arg()
br label %8
6: ; preds = %1
%7 = tail call i32 @_stat_with_arg(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %7, %6 ], [ %5, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int *);
scalar_t__ malloc(int);
int nondet_uint();
void test() {
  int size = nondet_uint();
  if (size > 0) {
    int *array = (int *)(malloc(size * sizeof(int)));
    __ESBMC_assume(array);
    int x = size - 1;
    int y = size - 1;
    int index = (x + y) / 2;
    int c = array[index];
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <nondet_uint@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1199 <test+0x69>
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <__ESBMC_assume@plt>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %eax,%eax
call   1040 <nondet_uint@plt>
test   %eax,%eax
jle    114f <test+0x1f>
shl    $0x2,%eax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <__ESBMC_assume@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = call i32 (...) @nondet_uint()
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %32
10: ; preds = %0
%11 = load i32, i32* %1
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 4
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %2
%17 = load i32*, i32** %2
%18 = call i32 @__ESBMC_assume(i32* %17)
%19 = load i32, i32* %1
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %3
%21 = load i32, i32* %1
%22 = sub nsw i32 %21, 1
store i32 %22, i32* %4
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = add nsw i32 %23, %24
%26 = sdiv i32 %25, 2
store i32 %26, i32* %5
%27 = load i32*, i32** %2
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
%31 = load i32, i32* %30
store i32 %31, i32* %6
br label %32
32: ; preds = %10, %0
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @nondet_uint()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = shl i32 %1, 2
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @__ESBMC_assume(i32* %6)
br label %8
8: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x5d() {
  Assert_real((isascii(93)),
              "/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_isascii.c",
              470, ("isascii should be 1 for ]"));
}


x86 assembly (clang, -O0):
<t_isascii_0x5d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5d,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1d6,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x5d>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x1d6,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for ]\00"
define void @t_isascii_0x5d() {
%1 = call i32 @isascii(i32 93)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 470, 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for ]\00"
define void @t_isascii_0x5d() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 470, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t mmio_readl(void *addr) { return *(volatile uint32_t *)addr; }


x86 assembly (clang, -O0):
<mmio_readl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmio_readl>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @mmio_readl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @mmio_readl(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
int process_m_filter(const char *line) { return -1; }


x86 assembly (clang, -O0):
<process_m_filter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_m_filter>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @process_m_filter(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 -1
}

LLVM IR (-O2):
define i32 @process_m_filter(i8* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ RgbToCmyk(scalar_t__ *);
void rgb_store(int c) {
  static uint8_t rgb_store[(3)];
  static int idx = 0;
  rgb_store[idx++] = (uint8_t)c;
  if (idx == (3)) {
    RgbToCmyk(rgb_store);
    idx = 0;
  }
}


x86 assembly (clang, -O0):
<rgb_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdx
mov    0x2f33(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f28(%rip)
movslq %eax,%rcx
lea    0x2f06(%rip),%rax
mov    %rdx,(%rax,%rcx,8)
cmpl   $0x3,0x2f13(%rip)
jne    1161 <rgb_store+0x51>
lea    0x2eee(%rip),%rdi
call   1030 <RgbToCmyk@plt>
movl   $0x0,0x2ef7(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_store>:
push   %rax
movslq %edi,%rax
movslq 0x2f3d(%rip),%rcx
lea    0x1(%rcx),%edx
mov    %edx,0x2f34(%rip)
lea    0x2f15(%rip),%rsi
mov    %rax,(%rsi,%rcx,8)
cmp    $0x3,%edx
jne    114a <rgb_store+0x3a>
lea    0x2f05(%rip),%rdi
call   1030 <RgbToCmyk@plt>
movl   $0x0,0x2f0e(%rip)
pop    %rax
ret

LLVM IR (-O0):
@rgb_store.rgb_store = internal global [3 x i64] zeroinitializer
@rgb_store.idx = internal global i32 0
define void @rgb_store(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = load i32, i32* @rgb_store.idx
%6 = add nsw i32 %5, 1
store i32 %6, i32* @rgb_store.idx
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds [3 x i64], [3 x i64]* @rgb_store.rgb_store, i64 0, i64 %7
store i64 %4, i64* %8
%9 = load i32, i32* @rgb_store.idx
%10 = icmp eq i32 %9, 3
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @RgbToCmyk(i64* getelementptr inbounds ([3 x i64], [3 x i64]* @rgb_store.rgb_store, i64 0, i64 0))
store i32 0, i32* @rgb_store.idx
br label %13
13: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
@rgb_store.rgb_store = internal global [3 x i64] zeroinitializer
@rgb_store.idx = internal unnamed_addr global i32 0
define void @rgb_store(i32 %0) {
%2 = sext i32 %0 to i64
%3 = load i32, i32* @rgb_store.idx
%4 = add nsw i32 %3, 1
store i32 %4, i32* @rgb_store.idx
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds [3 x i64], [3 x i64]* @rgb_store.rgb_store, i64 0, i64 %5
store i64 %2, i64* %6
%7 = icmp eq i32 %4, 3
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 @RgbToCmyk(i64* getelementptr inbounds ([3 x i64], [3 x i64]* @rgb_store.rgb_store, i64 0, i64 0))
store i32 0, i32* @rgb_store.idx
br label %10
10: ; preds = %8, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
struct udcFile {
  int dummy;
};

/* Variables and functions */
float byteSwapFloat(float);
int /*<<< orphan*/ udcMustRead(struct udcFile *, float *, int);
float udcReadFloat(struct udcFile *file, int isSwapped) {
  float val;
  udcMustRead(file, &val, sizeof(val));
  if (isSwapped)
    val = byteSwapFloat(val);
  return val;
}


x86 assembly (clang, -O0):
<udcReadFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <udcMustRead@plt>
cmpl   $0x0,-0xc(%rbp)
je     115a <udcReadFloat+0x3a>
movss  -0x10(%rbp),%xmm0
call   1030 <byteSwapFloat@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udcReadFloat>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1040 <udcMustRead@plt>
movss  0xc(%rsp),%xmm0
test   %ebx,%ebx
je     1145 <udcReadFloat+0x25>
call   1030 <byteSwapFloat@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.udcFile = type { i32 }
define float @udcReadFloat(%struct.udcFile* %0, i32 %1) {
%3 = alloca %struct.udcFile*
%4 = alloca i32
%5 = alloca float
store %struct.udcFile* %0, %struct.udcFile** %3
store i32 %1, i32* %4
%6 = load %struct.udcFile*, %struct.udcFile** %3
%7 = call i32 @udcMustRead(%struct.udcFile* %6, float* %5, i32 4)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load float, float* %5
%12 = call float @byteSwapFloat(float %11)
store float %12, float* %5
br label %13
13: ; preds = %10, %2
%14 = load float, float* %5
ret float %14
}

LLVM IR (-O2):
%struct.udcFile = type { i32 }
define float @udcReadFloat(%struct.udcFile* %0, i32 %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = call i32 @udcMustRead(%struct.udcFile* %0, float* %3, i32 4)
%6 = icmp eq i32 %1, 0
%7 = load float, float* %3
br i1 %6, label %10, label %8
8: ; preds = %2
%9 = call float @byteSwapFloat(float %7)
br label %10
10: ; preds = %2, %8
%11 = phi float [ %9, %8 ], [ %7, %2 ]
ret float %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ror32_1(uint32_t v) { return ((v & 0x1u) << 30) | (v >> 1); }


x86 assembly (clang, -O0):
<ror32_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x1e,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ror32_1>:
mov    %edi,%eax
and    $0x1,%eax
shl    $0x1e,%eax
sar    %edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ror32_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = shl i32 %4, 30
%6 = load i32, i32* %2
%7 = ashr i32 %6, 1
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @ror32_1(i32 %0) {
%2 = shl i32 %0, 30
%3 = and i32 %2, 1073741824
%4 = ashr i32 %0, 1
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int getpid() {
  printf("Entering kernal to get pid...\n");
  return syscall(0, 0, 0);
}


x86 assembly (clang, -O0):
<getpid>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1040 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpid>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <syscall@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Entering kernal to get pid...\0A\00"
define i32 @getpid() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @syscall(i32 0, i32 0, i32 0)
ret i32 %2
}

LLVM IR (-O2):
@str = [30 x i8] c"Entering kernal to get pid...\00"
define i32 @getpid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @syscall(i32 0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ test_default_mpool();
int /*<<< orphan*/ test_grow_mpool();
int main(int argc, char **argv) {
  test_default_mpool();
  test_grow_mpool();
  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   1040 <test_default_mpool@plt>
mov    $0x0,%al
call   1030 <test_grow_mpool@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_default_mpool@plt>
xor    %eax,%eax
call   1030 <test_grow_mpool@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 (...) @test_default_mpool()
%7 = call i32 (...) @test_grow_mpool()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_default_mpool()
%4 = tail call i32 (...) @test_grow_mpool()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
unsigned long gen_hash(char *key) {
  unsigned long hash = 5381;
  char *iter = key;
  while (*++iter) {
    hash = ((hash << 5) ^ hash) + *iter;
  }
  free(key);
  return hash;
}


x86 assembly (clang, -O0):
<gen_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
cmpb   $0x0,0x1(%rax)
je     1165 <gen_hash+0x55>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
xor    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <gen_hash+0x1c>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_hash>:
push   %rbx
mov    0x1(%rdi),%al
test   %al,%al
je     114e <gen_hash+0x3e>
lea    0x2(%rdi),%rcx
mov    $0x1505,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdx
shl    $0x5,%rdx
xor    %rbx,%rdx
movsbq %al,%rbx
add    %rdx,%rbx
movzbl (%rcx),%eax
add    $0x1,%rcx
test   %al,%al
jne    1130 <gen_hash+0x20>
jmp    1153 <gen_hash+0x43>
mov    $0x1505,%ebx
call   1030 <free@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @gen_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
store i64 5381, i64* %3
%5 = load i8*, i8** %2
store i8* %5, i8** %4
br label %6
6: ; preds = %11, %1
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %4
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %6
%12 = load i64, i64* %3
%13 = shl i64 %12, 5
%14 = load i64, i64* %3
%15 = xor i64 %13, %14
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i64
%19 = add i64 %15, %18
store i64 %19, i64* %3
br label %6
20: ; preds = %6
%21 = load i8*, i8** %2
%22 = call i32 @free(i8* %21)
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @gen_hash(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %3, %1 ]
%7 = phi i8* [ %13, %5 ], [ %2, %1 ]
%8 = phi i64 [ %12, %5 ], [ 5381, %1 ]
%9 = shl i64 %8, 5
%10 = xor i64 %9, %8
%11 = sext i8 %6 to i64
%12 = add i64 %10, %11
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %1
%17 = phi i64 [ 5381, %1 ], [ %12, %5 ]
%18 = tail call i32 @free(i8* %0)
ret i64 %17
}
void nseel_asm_shl_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_shl_end() {
ret void
}