xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ daemonize(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  daemonize("daemon");
  sleep(100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <daemonize@plt>
mov    $0x64,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <daemonize@plt>
mov    $0x64,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"daemon\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @daemonize(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sleep(i32 100)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"daemon\00"
define i32 @main() {
%1 = tail call i32 @daemonize(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 100)
ret i32 0
}
void batadv_dat_status_update(struct net_device *net_dev) {}


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
define void @batadv_dat_status_update(%struct.net_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit_with(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void version() {
  exit_with(
      "waitmax version 1.1\n"
      "Copyright Mathias Kettner 2008\n"
      "This is free software; see the source for copying conditions.  "
      "There is NO\n"
      "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
      "PURPOSE.",
      0, 0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <exit_with@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <exit_with@plt>

LLVM IR (-O0):
@.str = [202 x i8] c"waitmax version 1.1\0ACopyright Mathias Kettner 2008\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\00"
define void @version() {
%1 = call i32 @exit_with(i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [202 x i8] c"waitmax version 1.1\0ACopyright Mathias Kettner 2008\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\00"
define void @version() {
%1 = tail call i32 @exit_with(i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret void
}
/* Variables and functions */
char *menu_sel_mbr_data(long);
char *menu_sel_pet_data(long sel_pet_n) {
  return menu_sel_mbr_data(sel_pet_n + 6);
}


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

x86 assembly (clang, -O2):
<menu_sel_pet_data>:
add    $0x6,%rdi
jmp    1030 <menu_sel_mbr_data@plt>

LLVM IR (-O0):
define i8* @menu_sel_pet_data(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 6
%5 = call i8* @menu_sel_mbr_data(i64 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @menu_sel_pet_data(i64 %0) {
%2 = add nsw i64 %0, 6
%3 = tail call i8* @menu_sel_mbr_data(i64 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ clear_buffer();
int /*<<< orphan*/ printf(char *);
void display_error_scanf() {
  printf("\a\n\n Erreur: Votre choix est incorrect.\n\n\n\n\a");
  clear_buffer();
}


x86 assembly (clang, -O0):
<display_error_scanf>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <clear_buffer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_error_scanf>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <clear_buffer@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"\07\0A\0A Erreur: Votre choix est incorrect.\0A\0A\0A\0A\07\00"
define void @display_error_scanf() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @clear_buffer()
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"\07\0A\0A Erreur: Votre choix est incorrect.\0A\0A\0A\0A\07\00"
define void @display_error_scanf() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @clear_buffer()
ret void
}
void fun1(void) {
  char *a = 0;
#pragma acc data deviceptr(a)
  ++a;
#pragma acc data deviceptr(a)
#pragma acc parallel
  ++a;
#pragma acc data deviceptr(a)
#pragma acc parallel deviceptr(a)
  ++a;
#pragma acc data
#pragma acc parallel deviceptr(a)
  ++a;
#pragma acc parallel deviceptr(a)
  ++a;
}


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

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

LLVM IR (-O0):
define void @fun1() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
%3 = getelementptr inbounds i8, i8* %2, i32 1
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %1
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %1
%10 = load i8*, i8** %1
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %1
ret void
}

LLVM IR (-O2):
define void @fun1() {
ret void
}
/* Variables and functions */
int PAPI_num_cmp_hwctrs(int);
void PAPIF_num_cmp_hwctrs(int *cidx, int *num) {
  *num = PAPI_num_cmp_hwctrs(*cidx);
}


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

x86 assembly (clang, -O2):
<PAPIF_num_cmp_hwctrs>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_num_cmp_hwctrs@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @PAPIF_num_cmp_hwctrs(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* %5
%7 = call i32 @PAPI_num_cmp_hwctrs(i32 %6)
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @PAPIF_num_cmp_hwctrs(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_num_cmp_hwctrs(i32 %3)
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun1();
int main(void) {
  fun1();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fun1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ keyAnim(unsigned char, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void menuAnim(int item) { keyAnim((unsigned char)item, 0, 0); }


x86 assembly (clang, -O0):
<menuAnim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
movzbl %al,%edi
mov    %edx,%esi
call   1030 <keyAnim@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menuAnim>:
movzbl %dil,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <keyAnim@plt>

LLVM IR (-O0):
define void @menuAnim(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = call i32 @keyAnim(i8 zeroext %4, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @menuAnim(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @keyAnim(i8 zeroext %2, i32 0, i32 0)
ret void
}
void foo535(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo535(i32 %0) {
ret void
}
int test3(int (*arrayptr)[10], int i) { return (*arrayptr)[i]; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @test3([10 x i32]* %0, i32 %1) {
%3 = alloca [10 x i32]*
%4 = alloca i32
store [10 x i32]* %0, [10 x i32]** %3
store i32 %1, i32* %4
%5 = load [10 x i32]*, [10 x i32]** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test3([10 x i32]* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char k[2];
  k[0] = 'A';
  k[1] = 'P';
  printf("The elements in the vector k are %c %c", k[0], k[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x6(%rbp)
movb   $0x50,-0x5(%rbp)
mov    -0x6(%rbp),%al
lea    0xecf(%rip),%rdi
movsbl %al,%esi
movsbl -0x5(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x41,%esi
mov    $0x50,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"The elements in the vector k are %c %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 65, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 80, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%6 = load i8, i8* %5
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%8 = load i8, i8* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8 signext %6, i8 signext %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"The elements in the vector k are %c %c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8 signext 65, i8 signext 80)
ret i32 0
}
float test25() {
  float x;
  return x;
}


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

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

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

LLVM IR (-O2):
define float @test25() {
ret float undef
}
/* Variables and functions */
int /*<<< orphan*/ bitmap_is_bit_set(unsigned long *, unsigned long);
int bitmap_is_bit_clear(unsigned long *bitmap, unsigned long bit) {
  return !(bitmap_is_bit_set(bitmap, bit));
}


x86 assembly (clang, -O0):
<bitmap_is_bit_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <bitmap_is_bit_set@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_is_bit_clear>:
push   %rax
call   1030 <bitmap_is_bit_set@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bitmap_is_bit_clear(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 = call i32 @bitmap_is_bit_set(i64* %5, i64 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @bitmap_is_bit_clear(i64* %0, i64 %1) {
%3 = tail call i32 @bitmap_is_bit_set(i64* %0, i64 %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ shell_main();
void main(void) { shell_main(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @shell_main()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int main() {
  unsigned char *validate_array;
  validate_array = (unsigned char *)malloc(64);
  if (validate_array == 0) {
    printf("FAILURE!\n");
    exit(1);
  }
  printf("SUCCESS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x40,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <main+0x3e>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x40,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1150 <main+0x20>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"FAILURE!\0A\00"
@.str.1 = [9 x i8] c"SUCCESS\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 64)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"SUCCESS\00"
@str.2 = [9 x i8] c"FAILURE!\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 64)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void copy(int from, int to) {
  char current_char;
  while ((read(from, &current_char, 1)) == 1) {
    write(to, &current_char, 1);
  }
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
jne    115e <copy+0x3e>
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    112e <copy+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
jne    1174 <copy+0x54>
lea    0xf(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
je     1150 <copy+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @copy(i32 %0, i32 %1) {
%3 = alloca i8
%4 = call i32 @read(i32 %0, i8* %3, i32 1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %2, %6
%7 = call i32 @write(i32 %1, i8* %3, i32 1)
%8 = call i32 @read(i32 %0, i8* %3, i32 1)
%9 = icmp eq i32 %8, 1
br i1 %9, label %6, label %10
10: ; preds = %6, %2
ret void
}
int xmlUCSIsCypriotSyllabary(int code) {
  return (((code >= 0x10800) && (code <= 0x1083F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsCypriotSyllabary>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x10800,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsCypriotSyllabary+0x26>
cmpl   $0x1083f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsCypriotSyllabary>:
and    $0xffffffc0,%edi
xor    %eax,%eax
cmp    $0x10800,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsCypriotSyllabary(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 67584
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 67647
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsCypriotSyllabary(i32 %0) {
%2 = and i32 %0, -64
%3 = icmp eq i32 %2, 67584
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char const *dirname(char *);
int /*<<< orphan*/ free(char *);
char *tu_strdup(char const *);
char *tu__dirname(const char *name) {
  char *tmp = tu_strdup(name);
  char *dir = tu_strdup(dirname(tmp));
  free(tmp);
  return dir;
}


x86 assembly (clang, -O0):
<tu__dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <tu_strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <dirname@plt>
mov    %rax,%rdi
call   1050 <tu_strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tu__dirname>:
push   %r14
push   %rbx
push   %rax
call   1050 <tu_strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <dirname@plt>
mov    %rax,%rdi
call   1050 <tu_strdup@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @tu__dirname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @tu_strdup(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @dirname(i8* %7)
%9 = call i8* @tu_strdup(i8* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
define i8* @tu__dirname(i8* %0) {
%2 = tail call i8* @tu_strdup(i8* %0)
%3 = tail call i8* @dirname(i8* %2)
%4 = tail call i8* @tu_strdup(i8* %3)
%5 = tail call i32 @free(i8* %2)
ret i8* %4
}
void local(void) {}


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

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

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

LLVM IR (-O2):
define void @local() {
ret void
}
void hcentertext_(i) int *i;
{ hcentertext(*i); }


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

x86 assembly (clang, -O2):
<hcentertext_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <hcentertext@plt>

LLVM IR (-O0):
define void @hcentertext_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @hcentertext to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @hcentertext_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @hcentertext to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OAL_OBTAIN_SEMAPHORE();
int /*<<< orphan*/ OAL_RELEASE_SEMAPHORE();
int spi_bulkwrite(void *, unsigned short, unsigned char, unsigned char *,
                  unsigned short);
int fc8150_spib_bulkwrite(void *hDevice, unsigned short addr,
                          unsigned char *data, unsigned short length) {
  int res;
  unsigned char command = 0x00 | 0x80;
  OAL_OBTAIN_SEMAPHORE();
  res = spi_bulkwrite(hDevice, addr, command, data, length);
  OAL_RELEASE_SEMAPHORE();
  return res;
}


x86 assembly (clang, -O0):
<fc8150_spib_bulkwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %cx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
movb   $0x80,-0x21(%rbp)
mov    $0x0,%al
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%dx
mov    -0x21(%rbp),%al
mov    -0x18(%rbp),%rcx
movzwl %dx,%esi
movzbl %al,%edx
movzwl -0x1a(%rbp),%r8d
call   1040 <spi_bulkwrite@plt>
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <OAL_RELEASE_SEMAPHORE@plt>
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8150_spib_bulkwrite>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x80,%edx
mov    %r15,%rcx
mov    %r14d,%r8d
call   1040 <spi_bulkwrite@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <OAL_RELEASE_SEMAPHORE@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fc8150_spib_bulkwrite(i8* %0, i16 zeroext %1, i8* %2, i16 zeroext %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i8*
%8 = alloca i16
%9 = alloca i32
%10 = alloca i8
store i8* %0, i8** %5
store i16 %1, i16* %6
store i8* %2, i8** %7
store i16 %3, i16* %8
store i8 -128, i8* %10
%11 = call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%12 = load i8*, i8** %5
%13 = load i16, i16* %6
%14 = load i8, i8* %10
%15 = load i8*, i8** %7
%16 = load i16, i16* %8
%17 = call i32 @spi_bulkwrite(i8* %12, i16 zeroext %13, i8 zeroext %14, i8* %15, i16 zeroext %16)
store i32 %17, i32* %9
%18 = call i32 (...) @OAL_RELEASE_SEMAPHORE()
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
define i32 @fc8150_spib_bulkwrite(i8* %0, i16 zeroext %1, i8* %2, i16 zeroext %3) {
%5 = tail call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%6 = tail call i32 @spi_bulkwrite(i8* %0, i16 zeroext %1, i8 zeroext -128, i8* %2, i16 zeroext %3)
%7 = tail call i32 (...) @OAL_RELEASE_SEMAPHORE()
ret i32 %6
}
int test_bit(unsigned long nr, unsigned long *bitmap) {
  unsigned long offset = nr / ((int)sizeof(long) * 8);
  unsigned long bit = nr & (((int)sizeof(long) * 8) - 1);
  return (bitmap[offset] >> bit) & 1;
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x6,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3f,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %rdi,%rcx
mov    %rdi,%rax
shr    $0x6,%rax
mov    (%rsi,%rax,8),%rax
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64* %1, i64** %4
%7 = load i64, i64* %3
%8 = udiv i64 %7, 64
store i64 %8, i64* %5
%9 = load i64, i64* %3
%10 = and i64 %9, 63
store i64 %10, i64* %6
%11 = load i64*, i64** %4
%12 = load i64, i64* %5
%13 = getelementptr inbounds i64, i64* %11, i64 %12
%14 = load i64, i64* %13
%15 = load i64, i64* %6
%16 = lshr i64 %14, %15
%17 = and i64 %16, 1
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @test_bit(i64 %0, i64* nocapture %1) {
%3 = lshr i64 %0, 6
%4 = and i64 %0, 63
%5 = getelementptr inbounds i64, i64* %1, i64 %3
%6 = load i64, i64* %5
%7 = lshr i64 %6, %4
%8 = trunc i64 %7 to i32
%9 = and i32 %8, 1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int printf(char *, char const *, char const *);
int puts(char const *);
int /*<<< orphan*/ stdout;
int sputsp(const char *s, const char *p) {
  int Res;
  if (p == NULL)
    Res = puts(s);
  else
    Res = printf("%s%s\n", s, p);
  fflush(stdout);
  return (Res);
}


x86 assembly (clang, -O0):
<sputsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <sputsp+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    %eax,-0x14(%rbp)
jmp    1173 <sputsp+0x43>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sputsp>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rsi
test   %rdx,%rdx
je     114a <sputsp+0x1a>
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
jmp    1152 <sputsp+0x22>
mov    %rsi,%rdi
call   1030 <puts@plt>
mov    %eax,%ebx
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s%s\0A\00"
@stdout = global i32 0
define i32 @sputsp(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
%10 = load i32, i32* @stdout
%11 = tail call i32 @fflush(i32 %10)
ret i32 %9
}
/* Variables and functions */
char *strrchr(char *, char);
char *pbasename(char *path) {
  char *basename;
  ;
  ;
  basename = strrchr(path, '/');
  ;
  return (basename) ? ++basename : path;
}


x86 assembly (clang, -O0):
<pbasename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114e <pbasename+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
jmp    1156 <pbasename+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbasename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @pbasename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @pbasename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f2(void) { printf("the 22222 exit handler\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"the 22222 exit handler\0A\00"
define void @f2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"the 22222 exit handler\00"
define void @f2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *trace_malloc(size_t, char *);
void *trace_calloc(size_t size, size_t elemsize, char *where) {
  void *ptr = trace_malloc(size * elemsize, where);
  memset(ptr, 0, size * elemsize);
  return ptr;
}


x86 assembly (clang, -O0):
<trace_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <trace_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
mov    %rdx,%rsi
call   1040 <trace_malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @trace_calloc(i64 %0, i64 %1, i8* %2) {
%4 = mul i64 %1, %0
%5 = tail call i8* @trace_malloc(i64 %4, i8* %2)
%6 = tail call i32 @memset(i8* %5, i32 0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ init_interrupt();
int main(int, char **);
int /*<<< orphan*/ rx_run_fini_array();
int /*<<< orphan*/ rx_run_init_array();
int /*<<< orphan*/ rx_run_preinit_array();
void init(void) {
  init_interrupt();
  rx_run_preinit_array();
  rx_run_init_array();
  rx_run_fini_array();
  static int argc = 0;
  static char **argv = 0;
  int ret = main(argc, argv);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <init_interrupt@plt>
mov    $0x0,%al
call   1060 <rx_run_preinit_array@plt>
mov    $0x0,%al
call   1070 <rx_run_init_array@plt>
mov    $0x0,%al
call   1030 <rx_run_fini_array@plt>
mov    0x2ed6(%rip),%edi
mov    0x2ed7(%rip),%rsi
call   1040 <main@plt>
mov    %eax,-0x4(%rbp)
jmp    1189 <init+0x39>

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1050 <init_interrupt@plt>
xor    %eax,%eax
call   1060 <rx_run_preinit_array@plt>
xor    %eax,%eax
call   1070 <rx_run_init_array@plt>
xor    %eax,%eax
call   1030 <rx_run_fini_array@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <main@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1180 <init+0x30>

LLVM IR (-O0):
@init.argc = internal global i32 0
@init.argv = internal global i8** null
define void @init() {
%1 = alloca i32
%2 = call i32 (...) @init_interrupt()
%3 = call i32 (...) @rx_run_preinit_array()
%4 = call i32 (...) @rx_run_init_array()
%5 = call i32 (...) @rx_run_fini_array()
%6 = load i32, i32* @init.argc
%7 = load i8**, i8*** @init.argv
%8 = call i32 @main(i32 %6, i8** %7)
store i32 %8, i32* %1
br label %9
9: ; preds = %0, %9
br label %9
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @init_interrupt()
%2 = tail call i32 (...) @rx_run_preinit_array()
%3 = tail call i32 (...) @rx_run_init_array()
%4 = tail call i32 (...) @rx_run_fini_array()
%5 = tail call i32 @main(i32 0, i8** null)
br label %6
6: ; preds = %6, %0
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ recurse(int);
main() { recurse(10); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @recurse(i32 10)
ret i32 0
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int);
char to_lower(char ch) {
  int ret = (int)ch;
  if (isupper(ret))
    ret = tolower(ret);
  if (ret > 223)
    ret = ret - 32;
  if (ret == 179)
    ret = 163;
  return (char)ret;
}


x86 assembly (clang, -O0):
<to_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1152 <to_lower+0x32>
mov    -0x8(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xdf,-0x8(%rbp)
jle    1168 <to_lower+0x48>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xb3,-0x8(%rbp)
jne    117c <to_lower+0x5c>
movl   $0xa3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_lower>:
push   %rbx
mov    %edi,%ebx
call   1040 <isupper@plt>
test   %rax,%rax
je     1136 <to_lower+0x16>
mov    %ebx,%edi
call   1030 <tolower@plt>
mov    %eax,%ebx
lea    -0x20(%rbx),%ecx
cmp    $0xe0,%ebx
cmovl  %ebx,%ecx
cmp    $0xb3,%ecx
mov    $0xa3,%eax
cmovne %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @to_lower(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i64 @isupper(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @tolower(i32 %10)
store i32 %11, i32* %3
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 223
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, 32
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 179
br i1 %20, label %21, label %22
21: ; preds = %18
store i32 163, i32* %3
br label %22
22: ; preds = %21, %18
%23 = load i32, i32* %3
%24 = trunc i32 %23 to i8
ret i8 %24
}

LLVM IR (-O2):
define signext i8 @to_lower(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i64 @isupper(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @tolower(i32 %2)
br label %7
7: ; preds = %5, %1
%8 = phi i32 [ %6, %5 ], [ %2, %1 ]
%9 = icmp sgt i32 %8, 223
%10 = add nsw i32 %8, -32
%11 = select i1 %9, i32 %10, i32 %8
%12 = icmp eq i32 %11, 179
%13 = trunc i32 %11 to i8
%14 = select i1 %12, i8 -93, i8 %13
ret i8 %14
}
void f(const struct A *kp) {
  struct A *p = kp;
  (void)p;
}


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

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

LLVM IR (-O0):
%struct.A = type opaque
define void @f(%struct.A* %0) {
%2 = alloca %struct.A*
%3 = alloca %struct.A*
store %struct.A* %0, %struct.A** %2
%4 = load %struct.A*, %struct.A** %2
store %struct.A* %4, %struct.A** %3
%5 = load %struct.A*, %struct.A** %3
ret void
}

LLVM IR (-O2):
%struct.A = type opaque
define void @f(%struct.A* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void panic(const char *s) {
  fprintf(stderr, "%s\n", s);
  abort();
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ errAnnul(int *);
void err_annul_(int *const STATUS) {
  int status;
  status = *STATUS;
  errAnnul(&status);
  *STATUS = status;
}


x86 assembly (clang, -O0):
<err_annul_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <errAnnul@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_annul_>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <errAnnul@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @err_annul_(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* %0
store i32 %4, i32* %2
%5 = call i32 @errAnnul(i32* %2)
%6 = load i32, i32* %2
store i32 %6, i32* %0
ret void
}
void to_single_store(__float128 a, float *p) { *p = (float)a; }


x86 assembly (clang, -O0):
<to_single_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movaps -0x10(%rbp),%xmm0
call   1130 <__trunctfsf2>
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<to_single_store>:
push   %rbx
mov    %rdi,%rbx
call   1110 <__trunctfsf2>
movss  %xmm0,(%rbx)
pop    %rbx
ret
nop

LLVM IR (-O0):
define void @to_single_store(fp128 %0, float* %1) {
%3 = alloca fp128
%4 = alloca float*
store fp128 %0, fp128* %3
store float* %1, float** %4
%5 = load fp128, fp128* %3
%6 = fptrunc fp128 %5 to float
%7 = load float*, float** %4
store float %6, float* %7
ret void
}

LLVM IR (-O2):
define void @to_single_store(fp128 %0, float* nocapture writeonly %1) {
%3 = fptrunc fp128 %0 to float
store float %3, float* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
int object_attack(void *self, int damage) {
  assert(self);
  assert(damage >= 0);
  printf("You can't attack that.\n");
  return 0;
}


x86 assembly (clang, -O0):
<object_attack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <assert@plt>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<object_attack>:
push   %rbx
mov    %esi,%ebx
call   1040 <assert@plt>
not    %ebx
shr    $0x1f,%ebx
mov    %ebx,%edi
call   1040 <assert@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"You can't attack that.\0A\00"
define i32 @object_attack(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"You can't attack that.\00"
define i32 @object_attack(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = xor i32 %1, -1
%7 = lshr i32 %6, 31
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct packet {
  int dummy;
};

/* Variables and functions */
int pdu_eth(struct packet *, int /*<<< orphan*/ const *,
            int /*<<< orphan*/ const *, int);
int pdu_eth_ipv4(struct packet *p, const uint8_t *dst_addr,
                 const uint8_t *src_addr) {
  return pdu_eth(p, dst_addr, src_addr, 0x0800);
}


x86 assembly (clang, -O0):
<pdu_eth_ipv4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x800,%ecx
call   1030 <pdu_eth@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_eth_ipv4>:
mov    $0x800,%ecx
jmp    1030 <pdu_eth@plt>

LLVM IR (-O0):
%struct.packet = type { i32 }
define i32 @pdu_eth_ipv4(%struct.packet* %0, i32* %1, i32* %2) {
%4 = alloca %struct.packet*
%5 = alloca i32*
%6 = alloca i32*
store %struct.packet* %0, %struct.packet** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load %struct.packet*, %struct.packet** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @pdu_eth(%struct.packet* %7, i32* %8, i32* %9, i32 2048)
ret i32 %10
}

LLVM IR (-O2):
%struct.packet = type { i32 }
define i32 @pdu_eth_ipv4(%struct.packet* %0, i32* %1, i32* %2) {
%4 = tail call i32 @pdu_eth(%struct.packet* %0, i32* %1, i32* %2, i32 2048)
ret i32 %4
}
void RTTestValue(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ stdin;
int vfscanf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vscanf(const char *format, va_list parameters) {
  return vfscanf(stdin, format, parameters);
}


x86 assembly (clang, -O0):
<vscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfscanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscanf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfscanf@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @vscanf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdin
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @vfscanf(i32 %5, i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @vscanf(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @vfscanf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ byte_array_to_bit_array(int /*<<< orphan*/ *, int,
                                           int /*<<< orphan*/ *);
void double_to_bit_array_native(double f, uint8_t *bit_array) {
  uint8_t a[8];
  *((double *)a) = f;
  byte_array_to_bit_array(a, 8, bit_array);
}


x86 assembly (clang, -O0):
<double_to_bit_array_native>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x8,%esi
call   1030 <byte_array_to_bit_array@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_bit_array_native>:
sub    $0x28,%rsp
mov    %rdi,%rdx
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <byte_array_to_bit_array@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @double_to_bit_array_native(double %0, i32* %1) {
%3 = alloca double
%4 = alloca i32*
%5 = alloca [8 x i32]
store double %0, double* %3
store i32* %1, i32** %4
%6 = load double, double* %3
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%8 = bitcast i32* %7 to double*
store double %6, double* %8
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%10 = load i32*, i32** %4
%11 = call i32 @byte_array_to_bit_array(i32* %9, i32 8, i32* %10)
ret void
}

LLVM IR (-O2):
define void @double_to_bit_array_native(double %0, i32* %1) {
%3 = alloca [8 x i32]
%4 = bitcast [8 x i32]* %3 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = bitcast [8 x i32]* %3 to double*
store double %0, double* %6
%7 = call i32 @byte_array_to_bit_array(i32* %5, i32 8, i32* %1)
ret void
}