xunge/DecIR huggingface dataset:
/* Variables and functions */
int get_i8();
int getcc();
int /*<<< orphan*/ setcc(int);
void cwai() { setcc((getcc() & get_i8()) | 0x80); }


x86 assembly (clang, -O0):
<cwai>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getcc@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_i8@plt>
mov    -0x4(%rbp),%edi
and    %eax,%edi
or     $0x80,%edi
call   1050 <setcc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwai>:
push   %rbx
xor    %eax,%eax
call   1030 <getcc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <get_i8@plt>
and    %eax,%ebx
or     $0x80,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1050 <setcc@plt>

LLVM IR (-O0):
define void @cwai() {
%1 = call i32 (...) @getcc()
%2 = call i32 (...) @get_i8()
%3 = and i32 %1, %2
%4 = or i32 %3, 128
%5 = call i32 @setcc(i32 %4)
ret void
}

LLVM IR (-O2):
define void @cwai() {
%1 = tail call i32 (...) @getcc()
%2 = tail call i32 (...) @get_i8()
%3 = and i32 %2, %1
%4 = or i32 %3, 128
%5 = tail call i32 @setcc(i32 %4)
ret void
}
/* Variables and functions */
size_t read(int fd, void *buf, size_t cnt) { return 0; }


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i64 0
}

LLVM IR (-O2):
define i64 @read(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i64 0
}
int precedence(char c) {
  if (c == '(')
    return 0;
  if (c == '+')
    return 1;
  if (c == '.')
    return 2;
  else
    return -1;
}


x86 assembly (clang, -O0):
<precedence>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x28,%eax
jne    1123 <precedence+0x23>
movl   $0x0,-0x4(%rbp)
jmp    115c <precedence+0x5c>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
jne    113c <precedence+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    115c <precedence+0x5c>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
jne    1155 <precedence+0x55>
movl   $0x2,-0x4(%rbp)
jmp    115c <precedence+0x5c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<precedence>:
add    $0xd8,%dil
mov    $0xffffffff,%eax
cmp    $0x6,%dil
ja     111d <precedence+0x1d>
movsbq %dil,%rax
lea    0xee6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @precedence(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 40
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %19
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 43
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %19
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 46
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 2, i32* %2
br label %19
18: ; preds = %13
store i32 -1, i32* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@switch.table.precedence = [7 x i32] [i32 0, i32 -1, i32 -1, i32 1, i32 -1, i32 -1, i32 2]
define i32 @precedence(i8 signext %0) {
%2 = add i8 %0, -40
%3 = icmp ult i8 %2, 7
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.precedence, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ sock_initialize();
void im_thread_init() { sock_initialize(); }


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

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

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

LLVM IR (-O2):
define void @im_thread_init() {
%1 = tail call i32 (...) @sock_initialize()
ret void
}
/* Variables and functions */
int isr_set_software_turnfield_correction(int);
int FS460_set_frame_buffer_pointer_management(int use_software) {
  return isr_set_software_turnfield_correction(use_software);
}


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

x86 assembly (clang, -O2):
<FS460_set_frame_buffer_pointer_management>:
jmp    1030 <isr_set_software_turnfield_correction@plt>

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

LLVM IR (-O2):
define i32 @FS460_set_frame_buffer_pointer_management(i32 %0) {
%2 = tail call i32 @isr_set_software_turnfield_correction(i32 %0)
ret i32 %2
}
extern const char *drwav_version_string(void) {
  return "0"
         "."
         "12"
         "."
         "19";
}


x86 assembly (clang, -O0):
<drwav_version_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<drwav_version_string>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"0.12.19\00"
define i8* @drwav_version_string() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"0.12.19\00"
define i8* @drwav_version_string() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint32_t PICO_TIME_MS(void) {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (uint32_t)((t.tv_sec * 1000) + (t.tv_usec / 1000));
}


x86 assembly (clang, -O0):
<PICO_TIME_MS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PICO_TIME_MS>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @PICO_TIME_MS() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @PICO_TIME_MS() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
/* Variables and functions */
size_t _calculate_new_size(size_t str_length) {
  return ((str_length + 1) * sizeof(char));
}


x86 assembly (clang, -O0):
<_calculate_new_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_calculate_new_size>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @_calculate_new_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 1
%5 = mul i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @_calculate_new_size(i64 %0) {
%2 = add i64 %0, 1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, void *);
scalar_t__ sbrk(int /*<<< orphan*/);
int check_mem_leak(char *where) {
  void *addr;
  addr = (void *)sbrk(0);
  printf("\tsbrk(0) %s: addr = %u\n", where, addr);
  return 0;
}


x86 assembly (clang, -O0):
<check_mem_leak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <sbrk@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_mem_leak>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <sbrk@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\09sbrk(0) %s: addr = %u\0A\00"
define i32 @check_mem_leak(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i64 @sbrk(i32 0)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"\09sbrk(0) %s: addr = %u\0A\00"
define i32 @check_mem_leak(i8* %0) {
%2 = tail call i64 @sbrk(i32 0)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_uhex(int);
int /*<<< orphan*/ stdout_put_char(char);
void print_hex(int hex) {
  if (hex >= 0) {
    print_uhex(hex);
  } else {
    stdout_put_char('-');
    print_uhex(-hex);
  }
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1142 <print_hex+0x22>
mov    -0x4(%rbp),%edi
call   1040 <print_uhex@plt>
jmp    1156 <print_hex+0x36>
mov    $0x2d,%edi
call   1030 <stdout_put_char@plt>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
call   1040 <print_uhex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jns    1133 <print_hex+0x13>
mov    $0x2d,%edi
call   1030 <stdout_put_char@plt>
neg    %ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <print_uhex@plt>

LLVM IR (-O0):
define void @print_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @print_uhex(i32 %6)
br label %13
8: ; preds = %1
%9 = call i32 @stdout_put_char(i8 signext 45)
%10 = load i32, i32* %2
%11 = sub nsw i32 0, %10
%12 = call i32 @print_uhex(i32 %11)
br label %13
13: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @print_hex(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @stdout_put_char(i8 signext 45)
%5 = sub nsw i32 0, %0
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
%8 = tail call i32 @print_uhex(i32 %7)
ret void
}
/* Variables and functions */
int f406(int *);
int f407(int *p) { return f406(p); }


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

x86 assembly (clang, -O2):
<f407>:
jmp    1030 <f406@plt>

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

LLVM IR (-O2):
define i32 @f407(i32* %0) {
%2 = tail call i32 @f406(i32* %0)
ret i32 %2
}
const char *build_time() { return "05:18:52"; }


x86 assembly (clang, -O0):
<build_time>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_time>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"05:18:52\00"
define i8* @build_time() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"05:18:52\00"
define i8* @build_time() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
int A(int x) { return (x << 4) + x; }


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

x86 assembly (clang, -O2):
<A>:
mov    %edi,%eax
shl    $0x4,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @A(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 4
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @A(i32 %0) {
%2 = mul i32 %0, 17
ret i32 %2
}
__attribute__((always_, unused)) void
ips___change_bit(int nr, volatile unsigned long *addr) {
  asm volatile("btcl %1,%0" : "=m"(*addr) : "dIr"(nr));
}


x86 assembly (clang, -O0):
<ips___change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
btc    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ips___change_bit>:
btc    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @ips___change_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "btcl $1,$0", "=*m,{dx}Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret void
}
__attribute__((always_)) int align_up(int offset, int alignment) {
  return (offset + alignment - 1) & ~(alignment - 1);
}


x86 assembly (clang, -O0):
<align_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_up>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
neg    %esi
and    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @align_up(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sub i32 0, %1
%6 = and i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int sin(float);
float circleCoordsY(int b, int radius, float t) { return b + radius * sin(t); }


x86 assembly (clang, -O0):
<circleCoordsY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x14(%rbp),%ecx
mov    %eax,%edx
mov    -0x10(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
cvtsi2ss %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circleCoordsY>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <sin@plt>
imul   %ebx,%eax
add    %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float @circleCoordsY(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load float, float* %6
%10 = call i32 @sin(float %9)
%11 = mul nsw i32 %8, %10
%12 = add nsw i32 %7, %11
%13 = sitofp i32 %12 to float
ret float %13
}

LLVM IR (-O2):
define float @circleCoordsY(i32 %0, i32 %1, float %2) {
%4 = tail call i32 @sin(float %2)
%5 = mul nsw i32 %4, %1
%6 = add nsw i32 %5, %0
%7 = sitofp i32 %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ _exit(unsigned int);
void _terminate(unsigned int status) { _exit(status); }


x86 assembly (clang, -O0):
<_terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_terminate>:
push   %rax
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @_terminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @_terminate(i32 %0) {
%2 = tail call i32 @_exit(i32 %0)
unreachable
}
/* Variables and functions */
int checksum(int *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ init(int *, int);
int *malloc(int);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int size = 4096 * 4;
  int *a = malloc(sizeof(int) * size);
  init(a, size);
  int check = checksum(a, size);
  fprintf(stderr, "Checksum : %d\n", check);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4000,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <init@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <checksum@plt>
mov    %eax,-0x24(%rbp)
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%edx
lea    0xe62(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x10000,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x4000,%esi
call   1050 <init@plt>
mov    %rbx,%rdi
mov    $0x4000,%esi
call   1030 <checksum@plt>
mov    0x2e71(%rip),%rcx
mov    (%rcx),%edi
lea    0xe88(%rip),%rsi
mov    %eax,%edx
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Checksum : %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 16384, i32* %6
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 4, %10
%12 = trunc i64 %11 to i32
%13 = call i32* @malloc(i32 %12)
store i32* %13, i32** %7
%14 = load i32*, i32** %7
%15 = load i32, i32* %6
%16 = call i32 @init(i32* %14, i32 %15)
%17 = load i32*, i32** %7
%18 = load i32, i32* %6
%19 = call i32 @checksum(i32* %17, i32 %18)
store i32 %19, i32* %8
%20 = load i32, i32* @stderr
%21 = load i32, i32* %8
%22 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %21)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Checksum : %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 65536)
%4 = tail call i32 @init(i32* %3, i32 16384)
%5 = tail call i32 @checksum(i32* %3, i32 16384)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_ctime;
};

/* Variables and functions */
time_t get_file_creation_time(struct stat *st) { return (time_t)st->st_ctime; }


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_file_creation_time(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_file_creation_time(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int check_arg(str_list, arg)
char const *const *str_list, *arg;
{
  while (*str_list)
    if (!strcmp(arg, *str_list++))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<check_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1163 <check_arg+0x53>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    115e <check_arg+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    116a <check_arg+0x5a>
jmp    1120 <check_arg+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_arg>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%rsi
test   %rsi,%rsi
je     113f <check_arg+0x2f>
add    $0x8,%rbx
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
jne    1120 <check_arg+0x10>
mov    $0x1,%eax
jmp    1141 <check_arg+0x31>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @check_arg(i8** %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %18, %2
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i32 1
store i8** %13, i8*** %4
%14 = load i8*, i8** %12
%15 = call i32 @strcmp(i8* %11, i8* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %10
store i32 1, i32* %3
br label %20
18: ; preds = %10
br label %6
19: ; preds = %6
store i32 0, i32* %3
br label %20
20: ; preds = %19, %17
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @check_arg(i8** nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8** [ %0, %2 ], [ %8, %7 ]
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8*, i8** %4, i64 1
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* %5)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *d2i_X509_bio(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
X509 *ReadX509AsDerFromBio(BIO *bio) { return d2i_X509_bio(bio, NULL); }


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

x86 assembly (clang, -O2):
<ReadX509AsDerFromBio>:
xor    %esi,%esi
jmp    1030 <d2i_X509_bio@plt>

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

LLVM IR (-O2):
define i32* @ReadX509AsDerFromBio(i32* %0) {
%2 = tail call i32* @d2i_X509_bio(i32* %0, i32* null)
ret i32* %2
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vmaccess(struct __test_metadata *);
void wrapper_vmaccess(struct __test_metadata *_metadata,
                      struct __fixture_variant_metadata *variant) {
  vmaccess(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_vmaccess>:
jmp    1030 <vmaccess@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_vmaccess(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @vmaccess(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_vmaccess(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @vmaccess(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x96() {
  Assert_real((isspace(150) == 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_isspace.c",
              755, ("isspace should be 0 for 0x96"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x96>:
push   %rax
mov    $0x96,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2f3,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x96\00"
define void @t_isspace_0x96() {
%1 = call i64 @isspace(i32 150)
%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 755, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x96\00"
define void @t_isspace_0x96() {
%1 = tail call i64 @isspace(i32 150)
%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 755, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
OP(dd, d9) {
  illegal_1();
  op_d9();
}


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

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_d9@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_d9()
ret i32 undef
}
/* Variables and functions */
char *strcat(char *, char *);
char *concat(char *buf, char *str) { return strcat(buf, str); }


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

x86 assembly (clang, -O2):
<concat>:
jmp    1030 <strcat@plt>

LLVM IR (-O0):
define i8* @concat(i8* %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
%7 = call i8* @strcat(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @concat(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcat(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
/* Type definitions */
struct flashrom_board_info {
  int dummy;
};

/* Variables and functions */
struct flashrom_board_info *flashrom_supported_boards(void) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.flashrom_board_info = type { i32 }
define %struct.flashrom_board_info* @flashrom_supported_boards() {
ret %struct.flashrom_board_info* null
}

LLVM IR (-O2):
%struct.flashrom_board_info = type { i32 }
define noalias %struct.flashrom_board_info* @flashrom_supported_boards() {
ret %struct.flashrom_board_info* null
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ button;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
unsigned get_XButtonPressedEvent_button(void *_p) {
  return (unsigned)((XButtonPressedEvent *)_p)->button;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @get_XButtonPressedEvent_button(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_XButtonPressedEvent_button(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void FreeMemory(void **pMemBlock) {
  if (*pMemBlock == NULL) {
    return;
  }
  free(*pMemBlock);
  *pMemBlock = NULL;
}


x86 assembly (clang, -O0):
<FreeMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    112f <FreeMemory+0x1f>
jmp    1146 <FreeMemory+0x36>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeMemory>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <FreeMemory+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @FreeMemory(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %1, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int __int32_t_decode_array(void const *, int, int, int /*<<< orphan*/ *, int);
int __float_decode_array(const void *_buf, int offset, int maxlen, float *p,
                         int elements) {
  return __int32_t_decode_array(_buf, offset, maxlen, (int32_t *)p, elements);
}


x86 assembly (clang, -O0):
<__float_decode_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <__int32_t_decode_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__float_decode_array>:
jmp    1030 <__int32_t_decode_array@plt>

LLVM IR (-O0):
define i32 @__float_decode_array(i8* %0, i32 %1, i32 %2, float* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca float*
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store float* %3, float** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load float*, float** %9
%15 = bitcast float* %14 to i32*
%16 = load i32, i32* %10
%17 = call i32 @__int32_t_decode_array(i8* %11, i32 %12, i32 %13, i32* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @__float_decode_array(i8* %0, i32 %1, i32 %2, float* %3, i32 %4) {
%6 = bitcast float* %3 to i32*
%7 = tail call i32 @__int32_t_decode_array(i8* %0, i32 %1, i32 %2, i32* %6, i32 %4)
ret i32 %7
}
/* Variables and functions */
int strlen(const char *str) {
  int l = 0;
  while (*str) {
    l++;
    str++;
  }
  return l;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <strlen+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
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 = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
}

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ list_atoms(int /*<<< orphan*/ *, char const *, int, long,
                              long);
int parse_range(char *, long *, long *);
void do_range(xcb_connection_t *c, const char *format, char *range) {
  int mask;
  long low, high;
  mask = parse_range(range, &low, &high);
  list_atoms(c, format, mask, low, high);
}


x86 assembly (clang, -O0):
<do_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1030 <parse_range@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1040 <list_atoms@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_range>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
call   1030 <parse_range@plt>
mov    0x10(%rsp),%rcx
mov    0x8(%rsp),%r8
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <list_atoms@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @do_range(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @parse_range(i8* %10, i64* %8, i64* %9)
store i32 %11, i32* %7
%12 = load i32*, i32** %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %7
%15 = load i64, i64* %8
%16 = load i64, i64* %9
%17 = call i32 @list_atoms(i32* %12, i8* %13, i32 %14, i64 %15, i64 %16)
ret void
}

LLVM IR (-O2):
define void @do_range(i32* %0, i8* %1, i8* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = bitcast i64* %4 to i8*
%7 = bitcast i64* %5 to i8*
%8 = call i32 @parse_range(i8* %2, i64* %4, i64* %5)
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = call i32 @list_atoms(i32* %0, i8* %1, i32 %8, i64 %9, i64 %10)
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_hv24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_hv24_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isspace(int);
void t_isspace_0x0b() {
  Assert_real((isspace(11)),
              "/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_isspace.c",
              60, ("isspace should be 1 for 0x0b"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x0b>:
push   %rax
mov    $0xb,%edi
call   1030 <isspace@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x3c,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 1 for 0x0b\00"
define void @t_isspace_0x0b() {
%1 = call i32 @isspace(i32 11)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 60, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 1 for 0x0b\00"
define void @t_isspace_0x0b() {
%1 = tail call i32 @isspace(i32 11)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void print_error_3(char *message) {
  printf("%s\n", message);
  exit(103);
}


x86 assembly (clang, -O0):
<print_error_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x67,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_error_3>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x67,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_error_3(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 103)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
pid_t wait(int *stat_loc) {
  fputs("wait\n", stderr);
  return 0;
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"wait\0A\00"
@stderr = global i32 0
define i32 @wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"wait\0A\00"
@stderr = global i32 0
define i32 @wait(i32* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *xmalloc(int);
char *xstralloc(int max) {
  assert(max > -1);
  char *str = xmalloc(max + 1);
  return str;
}


x86 assembly (clang, -O0):
<xstralloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstralloc>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
add    $0x1,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <xmalloc@plt>

LLVM IR (-O0):
define i8* @xstralloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, -1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
%10 = call i8* @xmalloc(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @xstralloc(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = add nsw i32 %0, 1
%6 = tail call i8* @xmalloc(i32 %5)
ret i8* %6
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
float ldexp(int, int);
float av_int2flt(int32_t v) {
  if (v + v > 0xFF000000U)
    return 0.0 / 0.0;
  return ldexp(((v & 0x7FFFFF) + (1 << 23)) * (v >> 31 | 1),
               (v >> 23 & 0xFF) - 150);
}


x86 assembly (clang, -O0):
<av_int2flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0xff000000,%eax
jbe    113e <av_int2flt+0x2e>
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1175 <av_int2flt+0x65>
mov    -0x8(%rbp),%edi
and    $0x7fffff,%edi
add    $0x800000,%edi
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
or     $0x1,%eax
imul   %eax,%edi
mov    -0x8(%rbp),%esi
sar    $0x17,%esi
and    $0xff,%esi
sub    $0x96,%esi
call   1030 <ldexp@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_int2flt>:
lea    (%rdi,%rdi,1),%eax
cmp    $0xff000000,%eax
jbe    1123 <av_int2flt+0x13>
movss  0xede(%rip),%xmm0
ret
mov    %edi,%ecx
and    $0x7fffff,%ecx
or     $0x800000,%ecx
mov    %edi,%eax
sar    $0x1f,%eax
or     $0x1,%eax
imul   %ecx,%eax
shr    $0x17,%edi
movzbl %dil,%esi
add    $0xffffff6a,%esi
mov    %eax,%edi
jmp    1030 <ldexp@plt>

LLVM IR (-O0):
define float @av_int2flt(i32 %0) {
%2 = alloca float
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = icmp ugt i32 %6, -16777216
br i1 %7, label %8, label %9
8: ; preds = %1
store float 0x7FF8000000000000, float* %2
br label %22
9: ; preds = %1
%10 = load i32, i32* %3
%11 = and i32 %10, 8388607
%12 = add nsw i32 %11, 8388608
%13 = load i32, i32* %3
%14 = ashr i32 %13, 31
%15 = or i32 %14, 1
%16 = mul nsw i32 %12, %15
%17 = load i32, i32* %3
%18 = ashr i32 %17, 23
%19 = and i32 %18, 255
%20 = sub nsw i32 %19, 150
%21 = call float @ldexp(i32 %16, i32 %20)
store float %21, float* %2
br label %22
22: ; preds = %9, %8
%23 = load float, float* %2
ret float %23
}

LLVM IR (-O2):
define float @av_int2flt(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = icmp ugt i32 %2, -16777216
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = and i32 %0, 8388607
%6 = or i32 %5, 8388608
%7 = ashr i32 %0, 31
%8 = or i32 %7, 1
%9 = mul nsw i32 %6, %8
%10 = lshr i32 %0, 23
%11 = and i32 %10, 255
%12 = add nsw i32 %11, -150
%13 = tail call float @ldexp(i32 %9, i32 %12)
br label %14
14: ; preds = %1, %4
%15 = phi float [ %13, %4 ], [ 0x7FF8000000000000, %1 ]
ret float %15
}
int ceil_log2(int a) {
  int result = 0;
  if ((a & (a - 1)) == 0) {
    result = -1;
  }
  while (a > 0) {
    result = result + 1;
    a = a >> 1;
  }
  return (result >> 1);
}


x86 assembly (clang, -O0):
<ceil_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1129 <ceil_log2+0x29>
movl   $0xffffffff,-0x8(%rbp)
jmp    112e <ceil_log2+0x2e>
cmpl   $0x0,-0x4(%rbp)
jle    114f <ceil_log2+0x4f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112e <ceil_log2+0x2e>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_log2>:
lea    -0x1(%rdi),%eax
and    %edi,%eax
cmp    $0x1,%eax
sbb    %eax,%eax
test   %edi,%edi
jle    111c <ceil_log2+0x1c>
mov    %edi,%ecx
add    $0x1,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <ceil_log2+0x10>
sar    %eax
ret

LLVM IR (-O0):
define i32 @ceil_log2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 1
%7 = and i32 %4, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %3
br label %10
10: ; preds = %9, %1
br label %11
11: ; preds = %14, %10
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
%17 = load i32, i32* %2
%18 = ashr i32 %17, 1
store i32 %18, i32* %2
br label %11
19: ; preds = %11
%20 = load i32, i32* %3
%21 = ashr i32 %20, 1
ret i32 %21
}

LLVM IR (-O2):
define i32 @ceil_log2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = sext i1 %3 to i32
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %12
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ %4, %1 ]
%8 = phi i32 [ %10, %6 ], [ %0, %1 ]
%9 = add nsw i32 %7, 1
%10 = lshr i32 %8, 1
%11 = icmp ult i32 %8, 2
br i1 %11, label %12, label %6
12: ; preds = %6, %1
%13 = phi i32 [ %4, %1 ], [ %9, %6 ]
%14 = ashr i32 %13, 1
ret i32 %14
}