xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ perror(char *);
void close_file(int *fd) {
  ssize_t close_return_value = close(*fd);
  if (close_return_value < 0) {
    perror("Error while closing");
  }
}


x86 assembly (clang, -O0):
<close_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1152 <close_file+0x32>
lea    0xeb3(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_file>:
push   %rax
mov    (%rdi),%edi
call   1030 <close@plt>
test   %rax,%rax
js     112f <close_file+0xf>
pop    %rax
ret
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Error while closing\00"
define void @close_file(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = call i64 @close(i32 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Error while closing\00"
define void @close_file(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i64 @close(i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
int busca(int *v, int ult, int novo) {
  int i;
  for (i = 0; i <= ult && v[i] < novo; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<busca>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x15(%rbp)
jg     113a <busca+0x3a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114a <busca+0x4a>
jmp    115d <busca+0x5d>
jmp    114f <busca+0x4f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <busca+0x15>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<busca>:
test   %esi,%esi
js     111f <busca+0x1f>
mov    %esi,%eax
add    $0x1,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rcx,4)
jge    1122 <busca+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <busca+0x10>
ret
xor    %eax,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @busca(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, 0
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = add nuw i32 %1, 1
%7 = zext i32 %6 to i64
br label %8
8: ; preds = %5, %13
%9 = phi i64 [ 0, %5 ], [ %14, %13 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp slt i32 %11, %2
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %18, label %8
16: ; preds = %8
%17 = trunc i64 %9 to i32
br label %18
18: ; preds = %13, %16, %3
%19 = phi i32 [ 0, %3 ], [ %17, %16 ], [ %6, %13 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void test_assert_pass(void) { assert(1); }


x86 assembly (clang, -O0):
<test_assert_pass>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert_pass>:
mov    $0x1,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test_assert_pass() {
%1 = call i32 @assert(i32 1)
ret void
}

LLVM IR (-O2):
define void @test_assert_pass() {
%1 = tail call i32 @assert(i32 1)
ret void
}
int ucpp_space_char(int c) {
  if (c == ' ' || c == '\t' || c == '\v' || c == '\f')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ucpp_space_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     112f <ucpp_space_char+0x2f>
cmpl   $0x9,-0x8(%rbp)
je     112f <ucpp_space_char+0x2f>
cmpl   $0xb,-0x8(%rbp)
je     112f <ucpp_space_char+0x2f>
cmpl   $0xc,-0x8(%rbp)
jne    113b <ucpp_space_char+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <ucpp_space_char+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucpp_space_char>:
cmp    $0x20,%edi
ja     111d <ucpp_space_char+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100001a00,%rdx
bt     %rcx,%rdx
jae    111d <ucpp_space_char+0x1d>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ucpp_space_char(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 12, label %3
i32 11, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xc0() {
  Assert_real((isdigit(192) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              965, ("isdigit should be 0 for 0xc0"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xc0\00"
define void @t_isdigit_0xc0() {
%1 = call i64 @isdigit(i32 192)
%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 965, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xc0\00"
define void @t_isdigit_0xc0() {
%1 = tail call i64 @isdigit(i32 192)
%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 965, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int foo(char a) {
  _Static_assert(sizeof(a) == 1, "Hello");
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i8 signext %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x6f() {
  Assert_real((isprint(111)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              560, ("isprint should be 1 for o"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x6f>:
push   %rax
mov    $0x6f,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x230,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for o\00"
define void @t_isprint_0x6f() {
%1 = call i32 @isprint(i32 111)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 560, 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for o\00"
define void @t_isprint_0x6f() {
%1 = tail call i32 @isprint(i32 111)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 560, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t calc_new_num(uint32_t num, uint32_t opcode) {
  switch (opcode) {
  case 1:
    return num + 1;
  case 2:
    return num - 1;
  case 4:
    return num * 2;
  case 8:
    return num / 2;
  default:
    return num;
  }
}


x86 assembly (clang, -O0):
<calc_new_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x7,%eax
ja     1170 <calc_new_num+0x70>
mov    -0x18(%rbp),%rax
lea    0xed6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <calc_new_num+0x76>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <calc_new_num+0x76>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <calc_new_num+0x76>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1176 <calc_new_num+0x76>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_new_num>:
mov    %edi,%eax
add    $0xffffffff,%esi
cmp    $0x7,%esi
ja     1130 <calc_new_num+0x30>
lea    0xeef(%rip),%rcx
movslq (%rcx,%rsi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
add    $0x1,%eax
ret
add    $0xffffffff,%eax
ret
add    %eax,%eax
ret
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @calc_new_num(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %19 [
i32 1, label %7
i32 2, label %10
i32 4, label %13
i32 8, label %16
]
7: ; preds = %2
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
br label %21
10: ; preds = %2
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %3
br label %21
13: ; preds = %2
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 2
store i32 %15, i32* %3
br label %21
16: ; preds = %2
%17 = load i32, i32* %4
%18 = sdiv i32 %17, 2
store i32 %18, i32* %3
br label %21
19: ; preds = %2
%20 = load i32, i32* %4
store i32 %20, i32* %3
br label %21
21: ; preds = %19, %16, %13, %10, %7
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @calc_new_num(i32 %0, i32 %1) {
switch i32 %1, label %11 [
i32 1, label %3
i32 2, label %5
i32 4, label %7
i32 8, label %9
]
3: ; preds = %2
%4 = add nsw i32 %0, 1
br label %11
5: ; preds = %2
%6 = add nsw i32 %0, -1
br label %11
7: ; preds = %2
%8 = shl nsw i32 %0, 1
br label %11
9: ; preds = %2
%10 = sdiv i32 %0, 2
br label %11
11: ; preds = %2, %9, %7, %5, %3
%12 = phi i32 [ %10, %9 ], [ %8, %7 ], [ %6, %5 ], [ %4, %3 ], [ %0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_multiply_by_two(void) { output_line("add r1 r1"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"add r1 r1\00"
define void @gen_multiply_by_two() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"add r1 r1\00"
define void @gen_multiply_by_two() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_matrix(int);
int main(int argc, char **argv) {
  test_matrix(100);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_matrix(i32 100)
ret i32 0
}
/* Variables and functions */
int EMaxInt(int, int);
int EMinInt(int, int);
int EIntersectRangeLength(int a1, int a2, int b1, int b2) {
  a1 = EMaxInt(a1, b1);
  a2 = EMinInt(a2, b2);
  if (a1 > a2)
    return 0;
  return (a2 - a1) + 1;
}


x86 assembly (clang, -O0):
<EIntersectRangeLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <EMaxInt@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <EMinInt@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1168 <EIntersectRangeLength+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1174 <EIntersectRangeLength+0x54>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EIntersectRangeLength>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %esi,%ebp
mov    %edx,%esi
call   1040 <EMaxInt@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <EMinInt@plt>
mov    %eax,%edx
sub    %ebx,%edx
add    $0x1,%edx
xor    %ecx,%ecx
cmp    %ebx,%eax
cmovge %edx,%ecx
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @EIntersectRangeLength(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @EMaxInt(i32 %0, i32 %2)
%6 = tail call i32 @EMinInt(i32 %1, i32 %3)
%7 = icmp slt i32 %6, %5
%8 = sub i32 1, %5
%9 = add i32 %8, %6
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int, int, int, int, int, int, int, int);
main() { f(1, 2, 3, 4, 5, 6, 7, 8, 9); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
movl   $0x8,0x8(%rsp)
movl   $0x9,0x10(%rsp)
call   1030 <f@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0x9
push   $0x8
push   $0x7
call   1030 <f@plt>
add    $0x20,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9)
ret i32 0
}
/* Type definitions */
struct State_q {
  int dummy;
};

/* Variables and functions */
bool state_q_is_empty(struct State_q const *head) { return (head == NULL); }


x86 assembly (clang, -O0):
<state_q_is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<state_q_is_empty>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.State_q = type { i32 }
define i32 @state_q_is_empty(%struct.State_q* %0) {
%2 = alloca %struct.State_q*
store %struct.State_q* %0, %struct.State_q** %2
%3 = load %struct.State_q*, %struct.State_q** %2
%4 = icmp eq %struct.State_q* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
%struct.State_q = type { i32 }
define i32 @state_q_is_empty(%struct.State_q* readnone %0) {
%2 = icmp eq %struct.State_q* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
int eval_to_tt(const int eval, const int ply) {
  if (eval > 1000000 - 128) {
    return eval + ply;
  }
  if (eval < -1000000 + 128) {
    return eval - ply;
  }
  return eval;
}


x86 assembly (clang, -O0):
<eval_to_tt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xf41c0,-0x8(%rbp)
jle    1125 <eval_to_tt+0x25>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <eval_to_tt+0x46>
cmpl   $0xfff0be40,-0x8(%rbp)
jge    1140 <eval_to_tt+0x40>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <eval_to_tt+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_to_tt>:
xor    %eax,%eax
cmp    $0xfff0be40,%edi
cmovl  %esi,%eax
neg    %eax
cmp    $0xf41c1,%edi
cmovge %esi,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @eval_to_tt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 999872
%4 = icmp slt i32 %0, -999872
%5 = select i1 %4, i32 %1, i32 0
%6 = sub i32 0, %5
%7 = select i1 %3, i32 %1, i32 %6
%8 = add i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int chdir(char *);
int changedir(char *path) { return chdir(path); }


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

x86 assembly (clang, -O2):
<changedir>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define i32 @changedir(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
void XRemoveHosts() {}


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

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

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

LLVM IR (-O2):
define void @XRemoveHosts() {
ret void
}
int test_imm_9Duint32_mem(unsigned int *val) {
  return ((*val) & (0x9D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Duint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x9d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Duint32_mem>:
testb  $0x9d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Duint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 157
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ doupdate();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_doupdate(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(doupdate());
}


x86 assembly (clang, -O0):
<cmd_doupdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_doupdate+0x27>
jmp    117f <cmd_doupdate+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1060 <doupdate@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_doupdate>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_doupdate+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1060 <doupdate@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

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

LLVM IR (-O2):
define void @cmd_doupdate(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @doupdate()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
int fib(int x) {
  if (x > 2)
    return fib(x - 1) + fib(x - 2);
  else
    return 1;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    114d <fib+0x3d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <fib+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x4,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ugt i32 %4, 4
br i1 %10, label %3, label %11
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int getGCD(int, int);
int getLCM(int a, int b) { return (a * b) / getGCD(a, b); }


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

x86 assembly (clang, -O2):
<getLCM>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <getGCD@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getLCM(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 = mul nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @getGCD(i32 %8, i32 %9)
%11 = sdiv i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @getLCM(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @getGCD(i32 %0, i32 %1)
%5 = sdiv i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
void execvp_test() {
  char *cmd[] = {
      "ls",
      "-l",
      "/",
      NULL,
  };
  execvp("ls", cmd);
}


x86 assembly (clang, -O0):
<execvp_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ce1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cde(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cdb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cd8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <execvp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execvp_test>:
sub    $0x28,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
call   1030 <execvp@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [2 x i8] c"/\00"
@__const.execvp_test.cmd = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* null]
define void @execvp_test() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [2 x i8] c"/\00"
@__const.execvp_test.cmd = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* null]
define void @execvp_test() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
ret void
}
int fun546() { return 546; }


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

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

LLVM IR (-O0):
define i32 @fun546() {
ret i32 546
}

LLVM IR (-O2):
define i32 @fun546() {
ret i32 546
}
/* Variables and functions */
int _open(char const *, int, int);
int open(const char *filename, int oflag, int pmode) {
  return _open(filename, oflag, pmode);
}


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

x86 assembly (clang, -O2):
<open>:
jmp    1030 <_open@plt>

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

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @_open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
double sqrt(double x) {
  __asm__("fsqrt" : "+t"(x));
  return x;
}


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
fldl   -0x10(%rbp)
fsqrt
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fsqrt
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @sqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double asm "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %3)
store double %4, double* %2
%5 = load double, double* %2
ret double %5
}

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = tail call double asm "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %0)
ret double %2
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int sparse_popcount(uint64_t x) {
  int count;
  for (count = 0; x; count++) {
    x &= x - 1;
  }
  return (count);
}


x86 assembly (clang, -O0):
<sparse_popcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <sparse_popcount+0x38>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <sparse_popcount+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sparse_popcount>:
xor    %eax,%eax
test   %rdi,%rdi
je     111c <sparse_popcount+0x1c>
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rdi),%rcx
add    $0x1,%eax
and    %rcx,%rdi
jne    1110 <sparse_popcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @sparse_popcount(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i64 %5, -1
%7 = and i64 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i64 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double now() {
  struct timeval tp;
  int i;
  i = gettimeofday(&tp, NULL);
  return ((double)tp.tv_sec + (double)tp.tv_usec * 1.e-6);
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0x14(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @now() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
store i32 %3, i32* %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @now() {
%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 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x3EB0C6F7A0B5ED8D, double %6)
ret double %10
}
int ft_isupper(int c) {
  if (c >= 65 && c <= 90)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <ft_isupper+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <ft_isupper+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isupper+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *myname) {
  printf("usage: %s [-f] PATH1 PATH2\n"
         "	       -f use ressource fork, default is data fork\n"
         "	       -v verbose, print error information\n"
         "	       -vv extra verbose, print all open calls\n"
         "	       -(s|l|c)(s|l|c)\n"
         "		  Use sharemode (lock on open), flock, or fcntl,\n"
         "		  for lock on first and second open respectively,\n"
         "		  defaulting to sharemode.\n",
         myname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [328 x i8] c"usage: %s [-f] PATH1 PATH2\0A\09 -f use ressource fork, default is data fork\0A\09 -v verbose, print error information\0A\09 -vv extra verbose, print all open calls\0A\09 -(s|l|c)(s|l|c)\0A\09\09 Use sharemode (lock on open), flock, or fcntl,\0A\09\09 for lock on first and second open respectively,\0A\09\09 defaulting to sharemode.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([328 x i8], [328 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [328 x i8] c"usage: %s [-f] PATH1 PATH2\0A\09 -f use ressource fork, default is data fork\0A\09 -v verbose, print error information\0A\09 -vv extra verbose, print all open calls\0A\09 -(s|l|c)(s|l|c)\0A\09\09 Use sharemode (lock on open), flock, or fcntl,\0A\09\09 for lock on first and second open respectively,\0A\09\09 defaulting to sharemode.\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([328 x i8], [328 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct extent_status {
  int dummy;
};

/* Variables and functions */
scalar_t__ ext4_es_is_delayed(struct extent_status *);
int /*<<< orphan*/ ext4_es_is_unwritten(struct extent_status *);
int ext4_es_is_delonly(struct extent_status *es) {
  return (ext4_es_is_delayed(es) && !ext4_es_is_unwritten(es));
}


x86 assembly (clang, -O0):
<ext4_es_is_delonly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ext4_es_is_delayed@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115b <ext4_es_is_delonly+0x3b>
mov    -0x8(%rbp),%rdi
call   1040 <ext4_es_is_unwritten@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext4_es_is_delonly>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ext4_es_is_delayed@plt>
test   %rax,%rax
je     1141 <ext4_es_is_delonly+0x21>
mov    %rbx,%rdi
call   1040 <ext4_es_is_unwritten@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.extent_status = type { i32 }
define i32 @ext4_es_is_delonly(%struct.extent_status* %0) {
%2 = alloca %struct.extent_status*
store %struct.extent_status* %0, %struct.extent_status** %2
%3 = load %struct.extent_status*, %struct.extent_status** %2
%4 = call i64 @ext4_es_is_delayed(%struct.extent_status* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load %struct.extent_status*, %struct.extent_status** %2
%8 = call i32 @ext4_es_is_unwritten(%struct.extent_status* %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct.extent_status = type { i32 }
define i32 @ext4_es_is_delonly(%struct.extent_status* %0) {
%2 = tail call i64 @ext4_es_is_delayed(%struct.extent_status* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @ext4_es_is_unwritten(%struct.extent_status* %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ err(int /*<<< orphan*/, char *, size_t);
void *realloc(void *, size_t);
void *srealloc(void *ptr, size_t size) {
  void *result = realloc(ptr, size);
  if (result == NULL && size > 0)
    err(EXIT_FAILURE, "realloc(%zd)", size);
  return result;
}


x86 assembly (clang, -O0):
<srealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1170 <srealloc+0x50>
cmpq   $0x0,-0x10(%rbp)
jbe    1170 <srealloc+0x50>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe95(%rip),%rsi
call   1030 <err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1151 <srealloc+0x31>
test   %r14,%r14
jne    1151 <srealloc+0x31>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdx
call   1030 <err@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [13 x i8] c"realloc(%zd)\00"
define i8* @srealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i64, i64* %4
%13 = icmp ugt i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* @EXIT_FAILURE
%16 = load i64, i64* %4
%17 = call i32 @err(i32 %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %16)
br label %18
18: ; preds = %14, %11, %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [13 x i8] c"realloc(%zd)\00"
define noalias i8* @srealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @err(i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %10
10: ; preds = %7, %2
ret i8* %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XCreateWindowEvent;

/* Variables and functions */
int get_XCreateWindowEvent_send_event(void *_p) {
  return (int)((XCreateWindowEvent *)_p)->send_event;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XCreateWindowEvent_send_event(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
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XCreateWindowEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void av_get_colorspace_name() {}


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

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

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

LLVM IR (-O2):
define void @av_get_colorspace_name() {
ret void
}
void minmax_div_const_Bad(int n) {
  int a[7];
  if (0 < n && n < 65) {
    int x = a[n / 8];
  }
}


x86 assembly (clang, -O0):
<minmax_div_const_Bad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jge    1130 <minmax_div_const_Bad+0x30>
cmpl   $0x41,-0x4(%rbp)
jge    1130 <minmax_div_const_Bad+0x30>
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cltq
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x24(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @minmax_div_const_Bad(i32 %0) {
%2 = alloca i32
%3 = alloca [7 x i32]
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 0, %5
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 65
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 8
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %13
%15 = load i32, i32* %14
store i32 %15, i32* %4
br label %16
16: ; preds = %10, %7, %1
ret void
}

LLVM IR (-O2):
define void @minmax_div_const_Bad(i32 %0) {
ret void
}
void cellgen_report(void) {}


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

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

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

LLVM IR (-O2):
define void @cellgen_report() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vpicx_set_intravlc(uint8_t *p_mp2vpicx) { p_mp2vpicx[7] |= 0x8; }


x86 assembly (clang, -O0):
<mp2vpicx_set_intravlc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
or     $0x8,%ecx
mov    %ecx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_set_intravlc>:
orb    $0x8,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @mp2vpicx_set_intravlc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = or i32 %5, 8
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @mp2vpicx_set_intravlc(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = or i32 %3, 8
store i32 %4, i32* %2
ret void
}
void gtk_toggle_button_new() {}


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

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

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

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