xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *, int, char const *);
int /*<<< orphan*/ program_exit(int);
void exit_on_error_m(const char *filename, const char *function_name,
                     int line_number, int error_code) {
  printf("vvv program is stopped on error: %d vvv\n(%s:%d::%s)\n", error_code,
         filename, line_number, function_name);
  program_exit(error_code);
}


x86 assembly (clang, -O0):
<exit_on_error_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%edi
call   1030 <program_exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_on_error_m>:
push   %rbx
mov    %ecx,%ebx
mov    %edx,%ecx
mov    %rsi,%r8
mov    %rdi,%rdx
lea    0xece(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <program_exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"vvv program is stopped on error: %d vvv\0A(%s:%d::%s)\0A\00"
define void @exit_on_error_m(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %7
%12 = load i8*, i8** %6
%13 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10, i32 %11, i8* %12)
%14 = load i32, i32* %8
%15 = call i32 @program_exit(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"vvv program is stopped on error: %d vvv\0A(%s:%d::%s)\0A\00"
define void @exit_on_error_m(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %0, i32 %2, i8* %1)
%6 = tail call i32 @program_exit(i32 %3)
ret void
}
/* Variables and functions */
int do_send(int, char *);
int irc_v3_cap_start(int fd) { return do_send(fd, "CAP REQ"); }


x86 assembly (clang, -O0):
<irc_v3_cap_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <do_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_v3_cap_start>:
lea    0xee9(%rip),%rsi
jmp    1030 <do_send@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"CAP REQ\00"
define i32 @irc_v3_cap_start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @do_send(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"CAP REQ\00"
define i32 @irc_v3_cap_start(i32 %0) {
%2 = tail call i32 @do_send(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xd7() {
  Assert_real((islower(215) == 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_islower.c",
              1080, ("islower should be 0 for 0xd7"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xd7>:
push   %rax
mov    $0xd7,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x438,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xd7\00"
define void @t_islower_0xd7() {
%1 = call i64 @islower(i32 215)
%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 1080, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xd7\00"
define void @t_islower_0xd7() {
%1 = tail call i64 @islower(i32 215)
%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 1080, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double fabs(double);
int /*<<< orphan*/ getNumber(double *);
double valorAbsoluto(double a) {
  getNumber(&a);
  return (fabs(a));
}


x86 assembly (clang, -O0):
<valorAbsoluto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <getNumber@plt>
movsd  -0x8(%rbp),%xmm0
movaps 0xece(%rip),%xmm1
pand   %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valorAbsoluto>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <getNumber@plt>
movsd  (%rsp),%xmm0
andps  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @valorAbsoluto(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @getNumber(double* %2)
%4 = load double, double* %2
%5 = call double @llvm.fabs.f64(double %4)
ret double %5
}

LLVM IR (-O2):
define double @valorAbsoluto(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @getNumber(double* %2)
%4 = load double, double* %2
%5 = call double @llvm.fabs.f64(double %4)
ret double %5
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int x;
  x = fact(7);
  print_int(x);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
call   1050 <fact@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
lea    0xeac(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1050 <fact@plt>
mov    %eax,%edi
call   1040 <print_int@plt>
lea    0xeb7(%rip),%rdi
pop    %rax
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @fact(i32 7)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @print_int(i32 %3)
%5 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @fact(i32 7)
%2 = tail call i32 @print_int(i32 %1)
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_76int8_reg(signed char val) {
  return ((val) & (0x76 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_76int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 118
%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_76int8_reg(i8 signext %0) {
%2 = and i8 %0, 118
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *getWlanIfName_web();
char *getWlanIfName(void) { return getWlanIfName_web(); }


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

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

LLVM IR (-O0):
define i8* @getWlanIfName() {
%1 = call i8* (...) @getWlanIfName_web()
ret i8* %1
}

LLVM IR (-O2):
define i8* @getWlanIfName() {
%1 = tail call i8* (...) @getWlanIfName_web()
ret i8* %1
}
/* Variables and functions */
size_t util_strnlen(const char *s, size_t maxlen) {
  const char *char_ptr;
  size_t len;
  char_ptr = s;
  len = 0;
  while (len < maxlen && *char_ptr) {
    char_ptr++;
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<util_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x21(%rbp)
jae    113f <util_strnlen+0x3f>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    114f <util_strnlen+0x4f>
jmp    116c <util_strnlen+0x6c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <util_strnlen+0x1c>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <util_strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <util_strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <util_strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @util_strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %11, %9 ], [ 0, %2 ]
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add nuw i64 %5, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %2
%14 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %14
}
void Clear_Image(unsigned short a) {}


x86 assembly (clang, -O0):
<Clear_Image>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Clear_Image(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
ret void
}

LLVM IR (-O2):
define void @Clear_Image(i16 zeroext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test3();
int main() {
  int i = 0;
  test3();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test3()
ret i32 0
}
/* Variables and functions */
scalar_t__ __VERIFIER_nondet_int();
void *malloc(unsigned int);
int main() {
  union {
    void *p0;
    struct {
      char c[2];
      int p1;
      int p2;
    } str;
  } data;
  data.p0 = malloc(37U);
  if (__VERIFIER_nondet_int()) {
    data.str.p2 = 20;
  } else {
    data.str.p2 = 30;
  }
  if (25 > data.str.p2) {
    data.str.c[1] = sizeof data.str.p1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x25,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%rax
je     115a <main+0x3a>
movl   $0x14,-0x10(%rbp)
jmp    1161 <main+0x41>
movl   $0x1e,-0x10(%rbp)
mov    $0x19,%eax
cmp    -0x10(%rbp),%eax
jle    1173 <main+0x53>
movb   $0x4,-0x17(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i8*, [8 x i8] }
%struct.anon = type { [2 x i8], i32, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
store i32 0, i32* %1
%3 = call i8* @malloc(i32 37)
%4 = bitcast %union.anon* %2 to i8**
store i8* %3, i8** %4
%5 = call i64 (...) @__VERIFIER_nondet_int()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = bitcast %union.anon* %2 to %struct.anon*
%9 = getelementptr inbounds %struct.anon, %struct.anon* %8, i32 0, i32 2
store i32 20, i32* %9
br label %13
10: ; preds = %0
%11 = bitcast %union.anon* %2 to %struct.anon*
%12 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 2
store i32 30, i32* %12
br label %13
13: ; preds = %10, %7
%14 = bitcast %union.anon* %2 to %struct.anon*
%15 = getelementptr inbounds %struct.anon, %struct.anon* %14, i32 0, i32 2
%16 = load i32, i32* %15
%17 = icmp sgt i32 25, %16
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = bitcast %union.anon* %2 to %struct.anon*
%20 = getelementptr inbounds %struct.anon, %struct.anon* %19, i32 0, i32 0
%21 = getelementptr inbounds [2 x i8], [2 x i8]* %20, i64 0, i64 1
store i8 4, i8* %21
br label %22
22: ; preds = %18, %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @__VERIFIER_nondet_int()
ret i32 0
}
int strLen(char str[]) {
  int length = 0;
  for (; str[length] != '\0'; length++)
    ;
  return length;
}


x86 assembly (clang, -O0):
<strLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <strLen+0x37>
jmp    1129 <strLen+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strLen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strLen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strLen+0x10>
ret

LLVM IR (-O0):
define i32 @strLen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %4
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @strLen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int len2(int a[]) {
  int len = 0;
  while (*a++)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<len2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
cmpl   $0x0,(%rax)
je     1135 <len2+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <len2+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len2>:
cmpl   $0x0,(%rdi)
je     111c <len2+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,0x4(%rdi,%rax,4)
lea    0x1(%rax),%rax
jne    1110 <len2+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @len2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i32 1
store i32* %6, i32** %2
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @len2(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ cu(void **);
void cu2(void **ptrp) { cu(ptrp); }


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

x86 assembly (clang, -O2):
<cu2>:
jmp    1030 <cu@plt>

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

LLVM IR (-O2):
define void @cu2(i8** %0) {
%2 = tail call i32 @cu(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void tree_destroy(void **root) { free(root); }


x86 assembly (clang, -O0):
<tree_destroy>:
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):
<tree_destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @tree_destroy(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 @tree_destroy(i8** nocapture %0) {
%2 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xc2() {
  Assert_real((isprint(194) == 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_isprint.c",
              975, ("isprint should be 0 for 0xc2"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xc2>:
push   %rax
mov    $0xc2,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3cf,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xc2\00"
define void @t_isprint_0xc2() {
%1 = call i64 @isprint(i32 194)
%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 975, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xc2\00"
define void @t_isprint_0xc2() {
%1 = tail call i64 @isprint(i32 194)
%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 975, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fcntl(int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void zap() {
  endwin();
  fcntl(fileno(stdin), F_SETFL, 0);
  exit(1);
}


x86 assembly (clang, -O0):
<zap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <endwin@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
mov    %eax,%edi
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<zap>:
push   %rax
xor    %eax,%eax
call   1050 <endwin@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
mov    0x2e7b(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
@F_SETFL = global i32 0
define void @zap() {
%1 = call i32 (...) @endwin()
%2 = load i32, i32* @stdin
%3 = call i32 @fileno(i32 %2)
%4 = load i32, i32* @F_SETFL
%5 = call i32 @fcntl(i32 %3, i32 %4, i32 0)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdin = global i32 0
@F_SETFL = global i32 0
define void @zap() {
%1 = tail call i32 (...) @endwin()
%2 = load i32, i32* @stdin
%3 = tail call i32 @fileno(i32 %2)
%4 = load i32, i32* @F_SETFL
%5 = tail call i32 @fcntl(i32 %3, i32 %4, i32 0)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *intToRoman(int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *ret = intToRoman(1994);
  printf("%s\n", ret);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7ca,%edi
call   1030 <intToRoman@plt>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @intToRoman(i32 1994)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @intToRoman(i32 1994)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
float blendScreen(float base, float blend) {
  return 1.0f - ((1.0f - base) * (1.0f - blend));
}


x86 assembly (clang, -O0):
<blendScreen>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xeea(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
movss  0xedd(%rip),%xmm1
subss  -0x8(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xebf(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<blendScreen>:
movss  0xef8(%rip),%xmm2
movaps %xmm2,%xmm3
subss  %xmm0,%xmm3
movaps %xmm2,%xmm0
subss  %xmm1,%xmm0
mulss  %xmm3,%xmm0
subss  %xmm0,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @blendScreen(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fsub float 1.000000e+00, %5
%7 = load float, float* %4
%8 = fsub float 1.000000e+00, %7
%9 = fneg float %6
%10 = call float @llvm.fmuladd.f32(float %9, float %8, float 1.000000e+00)
ret float %10
}

LLVM IR (-O2):
define float @blendScreen(float %0, float %1) {
%3 = fsub float 1.000000e+00, %0
%4 = fsub float 1.000000e+00, %1
%5 = fneg float %3
%6 = tail call float @llvm.fmuladd.f32(float %5, float %4, float 1.000000e+00)
ret float %6
}
int main() { return sizeof(int); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void disp_version() { printf("%s %s by Joel Kenny\n", "kbdleds", "0.3"); }


x86 assembly (clang, -O0):
<disp_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef3(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp_version>:
lea    0xee9(%rip),%rdi
lea    0xef7(%rip),%rsi
lea    0xef8(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"%s %s by Joel Kenny\0A\00"
@.str.1 = [8 x i8] c"kbdleds\00"
@.str.2 = [4 x i8] c"0.3\00"
define void @disp_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s %s by Joel Kenny\0A\00"
@.str.1 = [8 x i8] c"kbdleds\00"
@.str.2 = [4 x i8] c"0.3\00"
define void @disp_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void LPCCOMxIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(ulBase == 0x40080000);
  DEBUG_ASSERT((ulIntFlags & ~(0x00200000 | 0x00100000 | 0x00080000)) == 0);
  (*((volatile unsigned long *)(ulBase + 0x00000120))) &= ~ulIntFlags;
}


x86 assembly (clang, -O0):
<LPCCOMxIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40080000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0xffffffffffc7ffff,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x120(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x120(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCCOMxIntDisable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x40080000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xffffffffffc7ffff,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
not    %rbx
and    %rbx,0x120(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @LPCCOMxIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074266112
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = and i64 %9, -3670017
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load i64, i64* %4
%15 = xor i64 %14, -1
%16 = load i64, i64* %3
%17 = add i64 %16, 288
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = and i64 %19, %15
store volatile i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @LPCCOMxIntDisable(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074266112
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = and i64 %1, -3670017
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = xor i64 %1, -1
%11 = add i64 %0, 288
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %10
store volatile i64 %14, i64* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ scanf(char *, char *);
int getstr(char str[], char *pdel) {
  scanf("%[^\n]", str);
  getchar();
  scanf("%c", pdel);
  getchar();
}


x86 assembly (clang, -O0):
<getstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1040 <scanf@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0x18(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1040 <scanf@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getstr>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1040 <scanf@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <getchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%[^\0A]\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @getstr(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 (...) @getchar()
%9 = load i8*, i8** %5
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 (...) @getchar()
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [6 x i8] c"%[^\0A]\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @getstr(i8* %0, i8* %1) {
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @getchar()
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%6 = tail call i32 (...) @getchar()
ret i32 undef
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRAF_get(void) { return U_WMRCORENONE_get("U_WMRAF"); }


x86 assembly (clang, -O0):
<U_WMRAF_get>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <U_WMRCORENONE_get@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMRAF_get>:
lea    0xee9(%rip),%rdi
jmp    1030 <U_WMRCORENONE_get@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRAF\00"
define i32 @U_WMRAF_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRAF\00"
define i32 @U_WMRAF_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ dynamic_test();
int main() { dynamic_test(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @dynamic_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fatal(char *, char const *, int /*<<< orphan*/);
int open(char const *, int, int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void cli_file_open(const char *fpath, int flags, int *fd) {
  if ((*fd = open(fpath, flags, 0644)) == -1)
    fatal("cli_file_open(%s): %s", fpath, strerror(errno));
}


x86 assembly (clang, -O0):
<cli_file_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1a4,%edx
call   1030 <open@plt>
mov    -0x18(%rbp),%rcx
mov    %eax,(%rcx)
cmp    $0xffffffff,%eax
jne    118b <cli_file_open+0x5b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe7a(%rip),%rdi
call   1050 <fatal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_file_open>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    $0x1a4,%edx
call   1030 <open@plt>
mov    %eax,(%rbx)
cmp    $0xffffffff,%eax
je     1153 <cli_file_open+0x23>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xe98(%rip),%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <fatal@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"cli_file_open(%s): %s\00"
@errno = global i32 0
define void @cli_file_open(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 @open(i8* %7, i32 %8, i32 420)
%10 = load i32*, i32** %6
store i32 %9, i32* %10
%11 = icmp eq i32 %9, -1
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i8*, i8** %4
%14 = load i32, i32* @errno
%15 = call i32 @strerror(i32 %14)
%16 = call i32 @fatal(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %15)
br label %17
17: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"cli_file_open(%s): %s\00"
@errno = global i32 0
define void @cli_file_open(i8* %0, i32 %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 420)
store i32 %4, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 @fatal(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %8)
br label %10
10: ; preds = %6, %3
ret void
}
/* Variables and functions */
char *emalloc(int);
int /*<<< orphan*/ sprintf(char *, char *, double);
char *double_toString(double x) {
  char *s = emalloc(256);
  sprintf(s, "%e", x);
  return s;
}


x86 assembly (clang, -O0):
<double_toString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x100,%edi
call   1030 <emalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_toString>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x100,%edi
call   1030 <emalloc@plt>
mov    %rax,%rbx
lea    0xec1(%rip),%rsi
mov    %rax,%rdi
movsd  0x8(%rsp),%xmm0
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%e\00"
define i8* @double_toString(double %0) {
%2 = alloca double
%3 = alloca i8*
store double %0, double* %2
%4 = call i8* @emalloc(i32 256)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load double, double* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%e\00"
define i8* @double_toString(double %0) {
%2 = tail call i8* @emalloc(i32 256)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ oled_SendCommand(unsigned char *, int);
void SetHigherColumnAddress(char x) {
  unsigned char d[] = {0x10 | (x & 0x0F)};
  oled_SendCommand(d, sizeof(d));
}


x86 assembly (clang, -O0):
<SetHigherColumnAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
or     $0x10,%eax
mov    %al,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x1,%esi
call   1030 <oled_SendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetHigherColumnAddress>:
push   %rax
and    $0xf,%dil
or     $0x10,%dil
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <oled_SendCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @SetHigherColumnAddress(i8 signext %0) {
%2 = alloca i8
%3 = alloca [1 x i8]
store i8 %0, i8* %2
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = and i32 %6, 15
%8 = or i32 16, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %4
%10 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%11 = call i32 @oled_SendCommand(i8* %10, i32 1)
ret void
}

LLVM IR (-O2):
define void @SetHigherColumnAddress(i8 signext %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%4 = and i8 %0, 15
%5 = or i8 %4, 16
store i8 %5, i8* %3
%6 = call i32 @oled_SendCommand(i8* %3, i32 1)
ret void
}
/* Type definitions */
struct itimerspec {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, int, struct itimerspec const *, struct itimerspec *);
int timerfd_settime(int fd, int flags, const struct itimerspec *new_value,
                    struct itimerspec *curr_value) {
  return syscall(286, fd, flags, new_value, curr_value);
}


x86 assembly (clang, -O0):
<timerfd_settime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x11e,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerfd_settime>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x11e,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.itimerspec = type { i32 }
define i32 @timerfd_settime(i32 %0, i32 %1, %struct.itimerspec* %2, %struct.itimerspec* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.itimerspec*
%8 = alloca %struct.itimerspec*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.itimerspec* %2, %struct.itimerspec** %7
store %struct.itimerspec* %3, %struct.itimerspec** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load %struct.itimerspec*, %struct.itimerspec** %7
%12 = load %struct.itimerspec*, %struct.itimerspec** %8
%13 = call i32 @syscall(i32 286, i32 %9, i32 %10, %struct.itimerspec* %11, %struct.itimerspec* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.itimerspec = type { i32 }
define i32 @timerfd_settime(i32 %0, i32 %1, %struct.itimerspec* %2, %struct.itimerspec* %3) {
%5 = tail call i32 @syscall(i32 286, i32 %0, i32 %1, %struct.itimerspec* %2, %struct.itimerspec* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xde() {
  Assert_real((islower(222) == 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_islower.c",
              1115, ("islower should be 0 for 0xde"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xde>:
push   %rax
mov    $0xde,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x45b,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xde\00"
define void @t_islower_0xde() {
%1 = call i64 @islower(i32 222)
%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 1115, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xde\00"
define void @t_islower_0xde() {
%1 = tail call i64 @islower(i32 222)
%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 1115, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void set_sdramc_priorities(unsigned int mppriority) {
  *((unsigned int *)(0xFFC20000 + 0x50AC)) = mppriority;
  return;
}


x86 assembly (clang, -O0):
<set_sdramc_priorities>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffc250ac,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_sdramc_priorities>:
mov    $0xffc250ac,%eax
mov    %edi,(%rax)
ret

LLVM IR (-O0):
define void @set_sdramc_priorities(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* inttoptr (i64 4290924716 to i32*)
ret void
}

LLVM IR (-O2):
define void @set_sdramc_priorities(i32 %0) {
store i32 %0, i32* inttoptr (i64 4290924716 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("Nested parallelism is %s\n", 0 ? "supported" : "not supported");
#pragma omp parallel
  {
    printf("Thread %d executes the outer parallel region\n", 0);
#pragma omp parallel num_threads(2)
    { printf("  Thread %d executes the inner parallel region\n", 0); }
  }
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Nested parallelism is %s\0A\00"
@.str.1 = [14 x i8] c"not supported\00"
@.str.2 = [46 x i8] c"Thread %d executes the outer parallel region\0A\00"
@.str.3 = [48 x i8] c" Thread %d executes the inner parallel region\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i8* null)
%4 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i8* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Nested parallelism is %s\0A\00"
@.str.1 = [14 x i8] c"not supported\00"
@.str.2 = [46 x i8] c"Thread %d executes the outer parallel region\0A\00"
@.str.3 = [48 x i8] c" Thread %d executes the inner parallel region\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), i8* null)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i8* null)
ret i32 0
}
unsigned addval_423(unsigned x) { return x + 985909769U; }


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

x86 assembly (clang, -O2):
<addval_423>:
lea    0x3ac3ca09(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_423(i32 %0) {
%2 = add i32 %0, 985909769
ret i32 %2
}
void x86sse_dummy(void) {}


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

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

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

LLVM IR (-O2):
define void @x86sse_dummy() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
uint32_t htonf(float hostfloat) {
  union {
    float _float;
    uint32_t _int;
  } val;
  val._float = hostfloat;
  return htonl(val._int);
}


x86 assembly (clang, -O0):
<htonf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <htonl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonf>:
movd   %xmm0,%edi
jmp    1030 <htonl@plt>

LLVM IR (-O0):
%union.anon = type { float }
define i32 @htonf(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = call i32 @htonl(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @htonf(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @htonl(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int foo(int /*<<< orphan*/);
int main(void) { return foo(bar(10)); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <bar@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <foo@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bar(i32 10)
%3 = call i32 @foo(i32 %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 10)
%2 = tail call i32 @foo(i32 %1)
ret i32 %2
}