xunge/DecIR huggingface dataset:
int verificaData(int dia, int mes, int ano) {
  int maxDias[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  if (dia < 1 || ano < 1850 || dia > maxDias[mes - 1])
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verificaData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xed4(%rip),%rsi
mov    $0x30,%edx
call   1030 <memcpy@plt>
cmpl   $0x1,-0x8(%rbp)
jl     1163 <verificaData+0x53>
cmpl   $0x73a,-0x10(%rbp)
jl     1163 <verificaData+0x53>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    -0x40(%rbp,%rcx,4),%eax
jle    116f <verificaData+0x5f>
movl   $0x0,-0x4(%rbp)
jmp    1176 <verificaData+0x66>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verificaData>:
xor    %eax,%eax
test   %edi,%edi
jle    1121 <verificaData+0x21>
cmp    $0x73a,%edx
jl     1121 <verificaData+0x21>
movslq %esi,%rcx
lea    0xee8(%rip),%rdx
xor    %eax,%eax
cmp    %edi,-0x4(%rdx,%rcx,4)
setge  %al
ret

LLVM IR (-O0):
@__const.verificaData.maxDias = [12 x i32] [i32 31, i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
define i32 @verificaData(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [12 x i32]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = bitcast [12 x i32]* %8 to i8*
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 1
br i1 %11, label %23, label %12
12: ; preds = %3
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 1850
br i1 %14, label %23, label %15
15: ; preds = %12
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = sub nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [12 x i32], [12 x i32]* %8, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = icmp sgt i32 %16, %21
br i1 %22, label %23, label %24
23: ; preds = %15, %12, %3
store i32 0, i32* %4
br label %25
24: ; preds = %15
store i32 1, i32* %4
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
@__const.verificaData.maxDias = [12 x i32] [i32 31, i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
define i32 @verificaData(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, 1
%5 = icmp slt i32 %2, 1850
%6 = or i1 %4, %5
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = add nsw i32 %1, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [12 x i32], [12 x i32]* @__const.verificaData.maxDias, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = icmp sge i32 %11, %0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %7, %3
%15 = phi i32 [ 0, %3 ], [ %13, %7 ]
ret i32 %15
}
/* Variables and functions */
void *realloc(void *, size_t);
void sd_array_resize(void **mem, size_t item_size, int num_size) {
  *mem = realloc(*mem, item_size * num_size);
}


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

x86 assembly (clang, -O2):
<sd_array_resize>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
movslq %edx,%rax
imul   %rax,%rsi
call   1030 <realloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sd_array_resize(i8** %0, i64 %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i32
store i8** %0, i8*** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i64, i64* %5
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = mul i64 %9, %11
%13 = call i8* @realloc(i8* %8, i64 %12)
%14 = load i8**, i8*** %4
store i8* %13, i8** %14
ret void
}

LLVM IR (-O2):
define void @sd_array_resize(i8** nocapture %0, i64 %1, i32 %2) {
%4 = load i8*, i8** %0
%5 = sext i32 %2 to i64
%6 = mul i64 %5, %1
%7 = tail call i8* @realloc(i8* %4, i64 %6)
store i8* %7, i8** %0
ret void
}
/* Variables and functions */
int MAX(int, int);
unsigned int *dt_alloc_align(int, int);
int /*<<< orphan*/ memset(unsigned int *, int /*<<< orphan*/, int);
unsigned int *alloc_tea_states(int numthreads) {
  unsigned int *states =
      dt_alloc_align(64, numthreads * (MAX(64, 2 * sizeof(unsigned int))));
  if (states)
    memset(states, 0, numthreads * (MAX(64, 2 * sizeof(unsigned int))));
  return states;
}


x86 assembly (clang, -O0):
<alloc_tea_states>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x40,%edi
mov    $0x8,%esi
call   1030 <MAX@plt>
mov    -0x14(%rbp),%esi
imul   %eax,%esi
mov    $0x40,%edi
call   1050 <dt_alloc_align@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     119d <alloc_tea_states+0x6d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    $0x40,%edi
mov    $0x8,%esi
call   1030 <MAX@plt>
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rdi
imul   %eax,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_tea_states>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x40,%edi
mov    $0x8,%esi
call   1030 <MAX@plt>
imul   %ebp,%eax
mov    $0x40,%edi
mov    %eax,%esi
call   1050 <dt_alloc_align@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1179 <alloc_tea_states+0x49>
mov    $0x40,%edi
mov    $0x8,%esi
call   1030 <MAX@plt>
imul   %eax,%ebp
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @alloc_tea_states(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @MAX(i32 64, i32 8)
%6 = mul nsw i32 %4, %5
%7 = call i32* @dt_alloc_align(i32 64, i32 %6)
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %16
10: ; preds = %1
%11 = load i32*, i32** %3
%12 = load i32, i32* %2
%13 = call i32 @MAX(i32 64, i32 8)
%14 = mul nsw i32 %12, %13
%15 = call i32 @memset(i32* %11, i32 0, i32 %14)
br label %16
16: ; preds = %10, %1
%17 = load i32*, i32** %3
ret i32* %17
}

LLVM IR (-O2):
define i32* @alloc_tea_states(i32 %0) {
%2 = tail call i32 @MAX(i32 64, i32 8)
%3 = mul nsw i32 %2, %0
%4 = tail call i32* @dt_alloc_align(i32 64, i32 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i32 @MAX(i32 64, i32 8)
%8 = mul nsw i32 %7, %0
%9 = tail call i32 @memset(i32* %4, i32 0, i32 %8)
br label %10
10: ; preds = %6, %1
ret i32* %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool rtp_check_extension(const uint8_t *p_rtp) { return !!(p_rtp[0] & 0x10); }


x86 assembly (clang, -O0):
<rtp_check_extension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_check_extension>:
mov    (%rdi),%eax
shr    $0x4,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @rtp_check_extension(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 16
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @rtp_check_extension(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 4
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x31() {
  Assert_real((ispunct(49) == 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_ispunct.c",
              250, ("ispunct should be 0 for 1"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x31>:
push   %rax
mov    $0x31,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xfa,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for 1\00"
define void @t_ispunct_0x31() {
%1 = call i64 @ispunct(i32 49)
%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 250, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for 1\00"
define void @t_ispunct_0x31() {
%1 = tail call i64 @ispunct(i32 49)
%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 250, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t red_bit_LaceKVE_joint();
size_t get_red_bit_LaceKVE_joint(size_t x) {
  return x & red_bit_LaceKVE_joint();
}


x86 assembly (clang, -O0):
<get_red_bit_LaceKVE_joint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <red_bit_LaceKVE_joint@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
and    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_red_bit_LaceKVE_joint>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <red_bit_LaceKVE_joint@plt>
and    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @get_red_bit_LaceKVE_joint(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 (...) @red_bit_LaceKVE_joint()
%5 = and i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @get_red_bit_LaceKVE_joint(i64 %0) {
%2 = tail call i64 (...) @red_bit_LaceKVE_joint()
%3 = and i64 %2, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ close1(int);
closeall() {
  register int i;
  for (i = 0; i < 10; i++)
    close1(i);
}


x86 assembly (clang, -O0):
<closeall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    113f <closeall+0x2f>
mov    -0x8(%rbp),%edi
call   1030 <close1@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <closeall+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeall>:
push   %rax
xor    %edi,%edi
call   1030 <close1@plt>
mov    $0x1,%edi
call   1030 <close1@plt>
mov    $0x2,%edi
call   1030 <close1@plt>
mov    $0x3,%edi
call   1030 <close1@plt>
mov    $0x4,%edi
call   1030 <close1@plt>
mov    $0x5,%edi
call   1030 <close1@plt>
mov    $0x6,%edi
call   1030 <close1@plt>
mov    $0x7,%edi
call   1030 <close1@plt>
mov    $0x8,%edi
call   1030 <close1@plt>
mov    $0x9,%edi
pop    %rax
jmp    1030 <close1@plt>

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

LLVM IR (-O2):
define i32 @closeall() {
%1 = tail call i32 @close1(i32 0)
%2 = tail call i32 @close1(i32 1)
%3 = tail call i32 @close1(i32 2)
%4 = tail call i32 @close1(i32 3)
%5 = tail call i32 @close1(i32 4)
%6 = tail call i32 @close1(i32 5)
%7 = tail call i32 @close1(i32 6)
%8 = tail call i32 @close1(i32 7)
%9 = tail call i32 @close1(i32 8)
%10 = tail call i32 @close1(i32 9)
ret i32 undef
}
void RTUuidCompare(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUuidCompare() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gethostname(char *, int);
char *input_malloc();
int /*<<< orphan*/ strcpy(char *, char *);
char *get_maquina() {
  char *str = input_malloc();
  strcpy(str, "localhost");
  gethostname(str, 25);
  return str;
}


x86 assembly (clang, -O0):
<get_maquina>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <input_malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    $0x19,%esi
call   1050 <gethostname@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_maquina>:
push   %rbx
xor    %eax,%eax
call   1040 <input_malloc@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x19,%esi
call   1050 <gethostname@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"localhost\00"
define i8* @get_maquina() {
%1 = alloca i8*
%2 = call i8* (...) @input_malloc()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %1
%6 = call i32 @gethostname(i8* %5, i32 25)
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"localhost\00"
define i8* @get_maquina() {
%1 = tail call i8* (...) @input_malloc()
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @gethostname(i8* %1, i32 25)
ret i8* %1
}
long nell(long a, long b) { return -(a != b); }


x86 assembly (clang, -O0):
<nell>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<nell>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
neg    %rax
ret

LLVM IR (-O0):
define i64 @nell(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 = load i64, i64* %4
%7 = icmp ne i64 %5, %6
%8 = zext i1 %7 to i32
%9 = sub nsw i32 0, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @nell(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, %1
%4 = sext i1 %3 to i64
ret i64 %4
}
int console_screendrawrange(int mx, int x) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @console_screendrawrange(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int buf_append(struct buffer *, unsigned char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int buf_append_str(struct buffer *b, const unsigned char *p) {
  return buf_append(b, p, strlen((char *)p));
}


x86 assembly (clang, -O0):
<buf_append_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <buf_append@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_append_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <buf_append@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @buf_append_str(%struct.buffer* %0, i8* %1) {
%3 = alloca %struct.buffer*
%4 = alloca i8*
store %struct.buffer* %0, %struct.buffer** %3
store i8* %1, i8** %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @buf_append(%struct.buffer* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @buf_append_str(%struct.buffer* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @buf_append(%struct.buffer* %0, i8* %1, i32 %3)
ret i32 %4
}
int create_connect_s() {}


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

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

LLVM IR (-O0):
define i32 @create_connect_s() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @create_connect_s() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_more_integers();
int /*<<< orphan*/ test_some_integers();
int main() {
  test_some_integers();
  test_more_integers();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_some_integers()
%2 = tail call i32 (...) @test_more_integers()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, double *);
int main() {
  int x;
  double y;
  scanf("%d %lf", &x, &y);
  printf("%.3lf km/l\n", x / y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1040 <scanf@plt>
cvtsi2sdl 0xc(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %lf\00"
@.str.1 = [12 x i8] c"%.3lf km/l\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, double* %3)
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = load double, double* %3
%8 = fdiv double %6, %7
%9 = fptosi double %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %lf\00"
@.str.1 = [12 x i8] c"%.3lf km/l\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = bitcast i32* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, double* %2)
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to double
%8 = load double, double* %2
%9 = fdiv double %7, %8
%10 = fptosi double %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void back_up(int num) {
  for (; num > 0; num--)
    printf("\b");
}


x86 assembly (clang, -O0):
<back_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113f <back_up+0x2f>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <back_up+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<back_up>:
push   %rbx
test   %edi,%edi
jle    1132 <back_up+0x22>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x8,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <back_up+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\08\00"
define void @back_up(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @back_up(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @putchar(i32 8)
%6 = add nsw i32 %4, -1
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Type definitions */
struct abc_t {
  int dummy;
};

/* Variables and functions */
struct abc_t *g();
struct abc_t *f() {
  return g();
}


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

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

LLVM IR (-O0):
%struct.abc_t = type { i32 }
define %struct.abc_t* @f() {
%1 = call %struct.abc_t* (...) @g()
ret %struct.abc_t* %1
}

LLVM IR (-O2):
%struct.abc_t = type { i32 }
define %struct.abc_t* @f() {
%1 = tail call %struct.abc_t* (...) @g()
ret %struct.abc_t* %1
}
__attribute__((weak)) char *dlerror() {
  static char errmsg[] = "dynamic linker not available\0";
  return errmsg;
}


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

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

LLVM IR (-O0):
@dlerror.errmsg = internal global [30 x i8] c"dynamic linker not available\00\00"
define weak i8* @dlerror() {
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @dlerror.errmsg, i64 0, i64 0)
}

LLVM IR (-O2):
@dlerror.errmsg = internal global [30 x i8] c"dynamic linker not available\00\00"
define weak i8* @dlerror() {
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @dlerror.errmsg, i64 0, i64 0)
}
void mips_begarg(int i, unsigned tar, unsigned arg1, unsigned arg2) {}


x86 assembly (clang, -O0):
<mips_begarg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mips_begarg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @mips_begarg(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logMallocError();
unsigned char *malloc(size_t);
unsigned char *allocateCharacters(size_t count) {
  {
    unsigned char *characters = malloc(count * sizeof(*characters));
    if (characters)
      return characters;
  }
  logMallocError();
  return NULL;
}


x86 assembly (clang, -O0):
<allocateCharacters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
shl    $0x0,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1155 <allocateCharacters+0x35>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1164 <allocateCharacters+0x44>
mov    $0x0,%al
call   1040 <logMallocError@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocateCharacters>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <allocateCharacters+0x15>
xor    %eax,%eax
call   1040 <logMallocError@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @allocateCharacters(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = mul i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i8*, i8** %4
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = call i32 (...) @logMallocError()
store i8* null, i8** %2
br label %14
14: ; preds = %12, %10
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @allocateCharacters(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @logMallocError()
br label %6
6: ; preds = %1, %4
ret i8* %2
}
int toyota_ign_hook() { return -1; }


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

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

LLVM IR (-O0):
define i32 @toyota_ign_hook() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @toyota_ign_hook() {
ret i32 -1
}
void outbyte(char byte) {
  volatile int *const txadata = (int *)0x20001a1c;
  *txadata = byte;
}


x86 assembly (clang, -O0):
<outbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x20001a1c,%eax
mov    %rax,-0x10(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x20001a1c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outbyte>:
mov    %edi,0x20001a1c
ret

LLVM IR (-O0):
define void @outbyte(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32*
store i8 %0, i8* %2
store i32* inttoptr (i64 536877596 to i32*), i32** %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
store volatile i32 %5, i32* inttoptr (i64 536877596 to i32*)
ret void
}

LLVM IR (-O2):
define void @outbyte(i8 signext %0) {
%2 = sext i8 %0 to i32
store volatile i32 %2, i32* inttoptr (i64 536877596 to i32*)
ret void
}
void assert_2(unsigned int prep, unsigned char *synopsis) {}


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

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

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

LLVM IR (-O2):
define void @assert_2(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x5c() {
  Assert_real((isupper(92) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              465, ("isupper should be 0 for 0x5c"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x5c\00"
define void @t_isupper_0x5c() {
%1 = call i64 @isupper(i32 92)
%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 465, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x5c\00"
define void @t_isupper_0x5c() {
%1 = tail call i64 @isupper(i32 92)
%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 465, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void PWM_UP_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @PWM_UP_IRQHandler() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XFocusInEvent;

/* Variables and functions */
unsigned long get_XFocusInEvent_serial(void *_p) {
  return (unsigned long)((XFocusInEvent *)_p)->serial;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XFocusInEvent_serial(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 i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XFocusInEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x18() {
  Assert_real((isascii(24)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              125, ("isascii should be 1 for 0x18"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x18>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x7d,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x18\00"
define void @t_isascii_0x18() {
%1 = call i32 @isascii(i32 24)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 125, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x18\00"
define void @t_isascii_0x18() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ycf_free(void *data, void *context) {
  (void)context;
  free(data);
}


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

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

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

LLVM IR (-O2):
define void @ycf_free(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double pow(int, int);
double shutter(int exposure, double aperture) {
  return pow(aperture, 2) / pow(2, exposure);
}


x86 assembly (clang, -O0):
<shutter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shutter>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
cvttsd2si %xmm0,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @shutter(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = call double @pow(i32 %6, i32 2)
%8 = load i32, i32* %3
%9 = call double @pow(i32 2, i32 %8)
%10 = fdiv double %7, %9
ret double %10
}

LLVM IR (-O2):
define double @shutter(i32 %0, double %1) {
%3 = fptosi double %1 to i32
%4 = tail call double @pow(i32 %3, i32 2)
%5 = tail call double @pow(i32 2, i32 %0)
%6 = fdiv double %4, %5
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uintmax_t;

/* Variables and functions */
unsigned int abs(unsigned int);
int /*<<< orphan*/ imaxabs(int /*<<< orphan*/);
unsigned long labs(unsigned long);
unsigned long long llabs(unsigned long long);
void tst_unsigned(unsigned *pu, unsigned long *pl, unsigned long long *pll,
                  uintmax_t *pm) {
  *pu = abs(*pu);
  *pl = labs(*pl);
  *pll = llabs(*pll);
  *pm = imaxabs(*pm);
}


x86 assembly (clang, -O0):
<tst_unsigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <labs@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1050 <llabs@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1060 <imaxabs@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_unsigned>:
push   %rbx
mov    (%rdi),%ebx
mov    %ebx,%eax
neg    %eax
cmovs  %ebx,%eax
mov    %eax,(%rdi)
mov    (%rsi),%rax
mov    %rax,%rdi
neg    %rdi
cmovs  %rax,%rdi
mov    %rcx,%rbx
mov    %rdi,(%rsi)
mov    (%rdx),%rax
mov    %rax,%rcx
neg    %rcx
cmovs  %rax,%rcx
mov    %rcx,(%rdx)
mov    (%rbx),%edi
call   1030 <imaxabs@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @tst_unsigned(i32* %0, i64* %1, i64* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i32*
store i32* %0, i32** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = call i32 @abs(i32 %10)
%12 = load i32*, i32** %5
store i32 %11, i32* %12
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = call i64 @labs(i64 %14)
%16 = load i64*, i64** %6
store i64 %15, i64* %16
%17 = load i64*, i64** %7
%18 = load i64, i64* %17
%19 = call i64 @llabs(i64 %18)
%20 = load i64*, i64** %7
store i64 %19, i64* %20
%21 = load i32*, i32** %8
%22 = load i32, i32* %21
%23 = call i32 @imaxabs(i32 %22)
%24 = load i32*, i32** %8
store i32 %23, i32* %24
ret void
}

LLVM IR (-O2):
define void @tst_unsigned(i32* nocapture %0, i64* nocapture %1, i64* nocapture %2, i32* nocapture %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @llvm.abs.i32(i32 %5, i1 true)
store i32 %6, i32* %0
%7 = load i64, i64* %1
%8 = tail call i64 @llvm.abs.i64(i64 %7, i1 true)
store i64 %8, i64* %1
%9 = load i64, i64* %2
%10 = tail call i64 @llvm.abs.i64(i64 %9, i1 true)
store i64 %10, i64* %2
%11 = load i32, i32* %3
%12 = tail call i32 @imaxabs(i32 %11)
store i32 %12, i32* %3
ret void
}
/* Variables and functions */
unsigned char inportb(int);
int /*<<< orphan*/ mouse_wait(int /*<<< orphan*/);
unsigned char mouse_read() {
  mouse_wait(0);
  return inportb(0x60);
}


x86 assembly (clang, -O0):
<mouse_read>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <mouse_wait@plt>
mov    $0x60,%edi
call   1040 <inportb@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mouse_read>:
push   %rax
xor    %edi,%edi
call   1030 <mouse_wait@plt>
mov    $0x60,%edi
pop    %rax
jmp    1040 <inportb@plt>

LLVM IR (-O0):
define zeroext i8 @mouse_read() {
%1 = call i32 @mouse_wait(i32 0)
%2 = call zeroext i8 @inportb(i32 96)
ret i8 %2
}

LLVM IR (-O2):
define zeroext i8 @mouse_read() {
%1 = tail call i32 @mouse_wait(i32 0)
%2 = tail call zeroext i8 @inportb(i32 96)
ret i8 %2
}
void mem_reverse(char *ptr, char *ptr_end) {
  char tmp_char;
  while (ptr < ptr_end) {
    tmp_char = *ptr_end;
    *ptr_end-- = *ptr;
    *ptr++ = tmp_char;
  }
}


x86 assembly (clang, -O0):
<mem_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1153 <mem_reverse+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <mem_reverse+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_reverse>:
cmp    %rsi,%rdi
jae    112c <mem_reverse+0x2c>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax)
movzbl 0x1(%rsi),%eax
movzbl (%rdi),%ecx
mov    %cl,0x1(%rsi)
mov    %al,(%rdi)
add    $0x1,%rdi
lea    -0x1(%rsi),%rax
cmp    %rsi,%rdi
mov    %rax,%rsi
jb     1110 <mem_reverse+0x10>
ret

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

LLVM IR (-O2):
define void @mem_reverse(i8* %0, i8* %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i8* [ %9, %4 ], [ %1, %2 ]
%7 = load i8, i8* %6
%8 = load i8, i8* %5
%9 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 %8, i8* %6
%10 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%11 = icmp ult i8* %10, %9
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int cfg_processor_get_addr(char *, char *);
int cfg_basic_timer_get_ifg_mask(void) {
  return cfg_processor_get_addr("basictimer", "ifgmask");
}


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

x86 assembly (clang, -O2):
<cfg_basic_timer_get_ifg_mask>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <cfg_processor_get_addr@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"basictimer\00"
@.str.1 = [8 x i8] c"ifgmask\00"
define i32 @cfg_basic_timer_get_ifg_mask() {
%1 = tail call i32 @cfg_processor_get_addr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
double umrechnung_us_dollar_in_euro(double betrag_in_us_dollar,
                                    double umrechnungsfaktor) {
  double betrag_in_euro = umrechnungsfaktor * betrag_in_us_dollar;
  return betrag_in_euro;
}


x86 assembly (clang, -O0):
<umrechnung_us_dollar_in_euro>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<umrechnung_us_dollar_in_euro>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @umrechnung_us_dollar_in_euro(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fmul double %6, %7
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @umrechnung_us_dollar_in_euro(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int factorf(int);
int findnext(int M) {
  int N;
  N = M;
  while (factorf(N) != 1) {
    ++N;
  }
  return N;
}


x86 assembly (clang, -O0):
<findnext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorf@plt>
cmp    $0x1,%eax
je     1140 <findnext+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <findnext+0x11>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findnext>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <factorf@plt>
add    $0x1,%ebx
cmp    $0x1,%eax
jne    1120 <findnext+0x10>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @findnext(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 @factorf(i32 %3)
%5 = icmp eq i32 %4, 1
%6 = add nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ arch_ftrace_nmi_exit();
void ftrace_nmi_exit(void) { arch_ftrace_nmi_exit(); }


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

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

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

LLVM IR (-O2):
define void @ftrace_nmi_exit() {
%1 = tail call i32 (...) @arch_ftrace_nmi_exit()
ret void
}
/* Variables and functions */
int comparef2(long const, long const);
int __eqsf2(float a, float b) {
  return comparef2((*(const long *)&a), (*(const long *)&b));
}


x86 assembly (clang, -O0):
<__eqsf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    -0x4(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <comparef2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__eqsf2>:
movss  %xmm0,-0x8(%rsp)
movss  %xmm1,-0x10(%rsp)
mov    -0x8(%rsp),%rdi
mov    -0x10(%rsp),%rsi
jmp    1030 <comparef2@plt>

LLVM IR (-O0):
define i32 @__eqsf2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = bitcast float* %3 to i64*
%6 = load i64, i64* %5
%7 = bitcast float* %4 to i64*
%8 = load i64, i64* %7
%9 = call i32 @comparef2(i64 %6, i64 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @__eqsf2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = bitcast float* %3 to i64*
%6 = load i64, i64* %5
%7 = bitcast float* %4 to i64*
%8 = load i64, i64* %7
%9 = tail call i32 @comparef2(i64 %6, i64 %8)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ be16toh(int /*<<< orphan*/);
uint16_t unaligned_read_be16(const void *_u) {
  const struct __attribute__((__packed__, __may_alias__)) {
    uint16_t x;
  } *u = _u;
  return be16toh(u->x);
}


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

x86 assembly (clang, -O2):
<unaligned_read_be16>:
mov    (%rdi),%edi
jmp    1030 <be16toh@plt>

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @unaligned_read_be16(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.anon*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.anon*
store %struct.anon* %5, %struct.anon** %3
%6 = load %struct.anon*, %struct.anon** %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @be16toh(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @unaligned_read_be16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @be16toh(i32 %3)
ret i32 %4
}