xunge/DecIR huggingface dataset:
int mdcIterativo(int a, int b) {
  while (a != 0) {
    int temp = a;
    a = b % a;
    b = temp;
  }
  return b;
}


x86 assembly (clang, -O0):
<mdcIterativo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <mdcIterativo+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <mdcIterativo+0xa>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdcIterativo>:
mov    %esi,%eax
test   %edi,%edi
je     111d <mdcIterativo+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <mdcIterativo+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mdcIterativo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %5, %4 ], [ %1, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %5, %4 ]
ret i32 %10
}
void test1() {
  int a1 = 0;
  int a = 100;
}


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

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

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

LLVM IR (-O2):
define void @test1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ext_device_manager_set_sudirribe_cb() {
  printf("NOT IMPLEMENTED:"
         "pa_ext_device_manager_set_sudirribe_cb"
         "\n");
}


x86 assembly (clang, -O0):
<pa_ext_device_manager_set_sudirribe_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [56 x i8] c"NOT IMPLEMENTED:pa_ext_device_manager_set_sudirribe_cb\0A\00"
define i32 @pa_ext_device_manager_set_sudirribe_cb() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [55 x i8] c"NOT IMPLEMENTED:pa_ext_device_manager_set_sudirribe_cb\00"
define i32 @pa_ext_device_manager_set_sudirribe_cb() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void opc_init() {
  system("omxplayer --version"
         " > /dev/null");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"omxplayer --version > /dev/null\00"
define void @opc_init() {
%1 = call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"omxplayer --version > /dev/null\00"
define void @opc_init() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void picsou(void) {
  printf("PICSOU !\n");
  getchar();
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"PICSOU !\0A\00"
define void @picsou() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"PICSOU !\00"
define void @picsou() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
unsigned long long addu64(unsigned long long x, unsigned long long y) {
  return x + y;
}


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

x86 assembly (clang, -O2):
<addu64>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @addu64(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 = add i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @addu64(i64 %0, i64 %1) {
%3 = add i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ e(int);
int /*<<< orphan*/ printf(char *, int);
void k(int param1) {
  printf("k(%d)\n", param1);
  if (param1 > 1) {
    e(param1 - 1);
  }
  return;
}


x86 assembly (clang, -O0):
<k>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x4(%rbp)
jle    114f <k+0x2f>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <e@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x2,%ebx
jl     1141 <k+0x21>
add    $0xffffffff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <e@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"k(%d)\0A\00"
define void @k(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = add nsw i32 %0, -1
%6 = tail call i32 @e(i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int multiply_convert_str_to_int(int *, char const *, size_t const);
int multiply_convert_str_to_uint(unsigned int *value_out, const char *str,
                                 const size_t len) {
  int ret = 0;
  int value;
  ret = multiply_convert_str_to_int(&value, str, len);
  *value_out = (unsigned int)value;
  return ret;
}


x86 assembly (clang, -O0):
<multiply_convert_str_to_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rdi
call   1030 <multiply_convert_str_to_int@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @multiply_convert_str_to_uint(i32* nocapture writeonly %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @multiply_convert_str_to_int(i32* %4, i8* %1, i64 %2)
%7 = load i32, i32* %4
store i32 %7, i32* %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ f();
void main() {
#pragma hlt outline
  {
    int ba = 0;
    int bc = 2;
    int bb = 10;
  }
  f();
}


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @f()
ret void
}
unsigned long EEPROMBlockLock(unsigned long ulBlock) {
  ;
  (*((volatile unsigned long *)(0x400AF004))) = ulBlock;
  (*((volatile unsigned long *)(0x400AF020))) = 0xFFFFFFFF;
  return ((*((volatile unsigned long *)(0x400AF020))));
}


x86 assembly (clang, -O0):
<EEPROMBlockLock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400af004,%eax
mov    %rcx,(%rax)
mov    $0x400af020,%eax
mov    $0xffffffff,%ecx
mov    %rcx,(%rax)
mov    $0x400af020,%eax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMBlockLock>:
mov    %rdi,0x400af004
40
mov    $0xffffffff,%eax
mov    %rax,0x400af020
40
mov    0x400af020,%rax
40
ret

LLVM IR (-O0):
define i64 @EEPROMBlockLock(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074458628 to i64*)
store volatile i64 4294967295, i64* inttoptr (i64 1074458656 to i64*)
%4 = load volatile i64, i64* inttoptr (i64 1074458656 to i64*)
ret i64 %4
}

LLVM IR (-O2):
define i64 @EEPROMBlockLock(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074458628 to i64*)
store volatile i64 4294967295, i64* inttoptr (i64 1074458656 to i64*)
%2 = load volatile i64, i64* inttoptr (i64 1074458656 to i64*)
ret i64 %2
}
int func(char *dst, unsigned int dstLen) { return 0; }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
void board_endcmdwrite(void) {}


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

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

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

LLVM IR (-O2):
define void @board_endcmdwrite() {
ret void
}
void touch_ulong(unsigned long *x) {}


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

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

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

LLVM IR (-O2):
define void @touch_ulong(i64* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ command_error();
char skip_space_peek();
void command_end() {
  if (skip_space_peek() != '\n')
    command_error();
}


x86 assembly (clang, -O0):
<command_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <skip_space_peek@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     113e <command_end+0x1e>
mov    $0x0,%al
call   1030 <command_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_end>:
push   %rax
xor    %eax,%eax
call   1040 <skip_space_peek@plt>
cmp    $0xa,%al
jne    112e <command_end+0xe>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <command_error@plt>

LLVM IR (-O0):
define void @command_end() {
%1 = call signext i8 (...) @skip_space_peek()
%2 = sext i8 %1 to i32
%3 = icmp ne i32 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @command_error()
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @command_end() {
%1 = tail call signext i8 (...) @skip_space_peek()
%2 = icmp eq i8 %1, 10
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @command_error()
br label %5
5: ; preds = %3, %0
ret void
}
void ff_vdpau_add_data_chunk() {}


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

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

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

LLVM IR (-O2):
define void @ff_vdpau_add_data_chunk() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_roundtrip(char *);
void test_fmt_ip() {
  test_roundtrip("fe80::");
  test_roundtrip("2001:db8::1");
  test_roundtrip("::ffff:192.168.2.1");
  test_roundtrip("::192.168.1.2");
  test_roundtrip("2001:7f8:30::2:1:0:8447");
}


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

x86 assembly (clang, -O2):
<test_fmt_ip>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <test_roundtrip@plt>
lea    0xee3(%rip),%rdi
call   1030 <test_roundtrip@plt>
lea    0xee3(%rip),%rdi
call   1030 <test_roundtrip@plt>
lea    0xeea(%rip),%rdi
call   1030 <test_roundtrip@plt>
lea    0xeec(%rip),%rdi
pop    %rax
jmp    1030 <test_roundtrip@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"fe80::\00"
@.str.1 = [12 x i8] c"2001:db8::1\00"
@.str.2 = [19 x i8] c"::ffff:192.168.2.1\00"
@.str.3 = [14 x i8] c"::192.168.1.2\00"
@.str.4 = [24 x i8] c"2001:7f8:30::2:1:0:8447\00"
define void @test_fmt_ip() {
%1 = call i32 @test_roundtrip(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @test_roundtrip(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @test_roundtrip(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @test_roundtrip(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @test_roundtrip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"fe80::\00"
@.str.1 = [12 x i8] c"2001:db8::1\00"
@.str.2 = [19 x i8] c"::ffff:192.168.2.1\00"
@.str.3 = [14 x i8] c"::192.168.1.2\00"
@.str.4 = [24 x i8] c"2001:7f8:30::2:1:0:8447\00"
define void @test_fmt_ip() {
%1 = tail call i32 @test_roundtrip(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test_roundtrip(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @test_roundtrip(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @test_roundtrip(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @test_roundtrip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_hello() { printf("I am the plugin A."); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"I am the plugin A.\00"
define void @say_hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"I am the plugin A.\00"
define void @say_hello() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void function_child(void) {
  static int number;
  printf("%d-", ++number);
}


x86 assembly (clang, -O0):
<function_child>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f09(%rip)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_child>:
mov    0x2f16(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f0d(%rip)
lea    0xeda(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@function_child.number = internal global i32 0
@.str = [4 x i8] c"%d-\00"
define void @function_child() {
%1 = load i32, i32* @function_child.number
%2 = add nsw i32 %1, 1
store i32 %2, i32* @function_child.number
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@function_child.number = internal unnamed_addr global i32 0
@.str = [4 x i8] c"%d-\00"
define void @function_child() {
%1 = load i32, i32* @function_child.number
%2 = add nsw i32 %1, 1
store i32 %2, i32* @function_child.number
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int setpgrp() {}


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

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

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

LLVM IR (-O2):
define i32 @setpgrp() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
void do_nothing(wchar_t *c) {}


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

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

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

LLVM IR (-O2):
define void @do_nothing(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *);
void mc_print_page(void) { do_csi("i"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"i\00"
define void @mc_print_page() {
%1 = call i32 @do_csi(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"i\00"
define void @mc_print_page() {
%1 = tail call i32 @do_csi(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int fibo1(int);
int main() {
  int x = 2;
  int result = fibo1(x);
  if (result != 1) {
    __VERIFIER_error();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fibo1@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1152 <main+0x32>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <fibo1@plt>
cmp    $0x1,%eax
je     1137 <main+0x17>
xor    %eax,%eax
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fibo1(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @__VERIFIER_error()
br label %10
10: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fibo1(i32 2)
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void test_fail_msg(int rc, const char *msg) { __coverity_panic__(); }


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

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

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

LLVM IR (-O2):
define void @test_fail_msg(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @__coverity_panic__()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void usage(const char *appname) {
  printf("\n** Warning **\n This test can hang your box with VM thrashing."
         " Use at your own risk.\n");
  printf("%s: shmem | tmpfs\n", appname);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [86 x i8] c"\0A** Warning **\0A This test can hang your box with VM thrashing. Use at your own risk.\0A\00"
@.str.1 = [19 x i8] c"%s: shmem | tmpfs\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"%s: shmem | tmpfs\0A\00"
@EXIT_FAILURE = global i32 0
@str = [85 x i8] c"\0A** Warning **\0A This test can hang your box with VM thrashing. Use at your own risk.\00"
define void @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _dtype_normalize(char *, char const *);
int atoi(char *);
int big_file_dtype_itemsize(const char *dtype) {
  char ndtype[8];
  _dtype_normalize(ndtype, dtype);
  return atoi(&ndtype[2]);
}


x86 assembly (clang, -O0):
<big_file_dtype_itemsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <_dtype_normalize@plt>
lea    -0x10(%rbp),%rdi
add    $0x2,%rdi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<big_file_dtype_itemsize>:
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <_dtype_normalize@plt>
lea    0x2(%rsp),%rdi
call   1040 <atoi@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @big_file_dtype_itemsize(i8* %0) {
%2 = alloca i8*
%3 = alloca [8 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @_dtype_normalize(i8* %4, i8* %5)
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 2
%8 = call i32 @atoi(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @big_file_dtype_itemsize(i8* %0) {
%2 = alloca [8 x i8]
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%4 = call i32 @_dtype_normalize(i8* %3, i8* %0)
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 2
%6 = call i32 @atoi(i8* %5)
ret i32 %6
}
/* Variables and functions */
int bob_test_forwarding_test();
int main() { return bob_test_forwarding_test(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bob_test_forwarding_test()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ print_hex_size(unsigned int, char, int);
void print_hex(unsigned int num, char attr) { print_hex_size(num, attr, 8); }


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%edx
movsbl -0x5(%rbp),%esi
call   1030 <print_hex_size@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
mov    $0x8,%edx
jmp    1030 <print_hex_size@plt>

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

LLVM IR (-O2):
define void @print_hex(i32 %0, i8 signext %1) {
%3 = tail call i32 @print_hex_size(i32 %0, i8 signext %1, i32 8)
ret void
}
int fun1376() { return 1376; }


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

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

LLVM IR (-O0):
define i32 @fun1376() {
ret i32 1376
}

LLVM IR (-O2):
define i32 @fun1376() {
ret i32 1376
}
/* Variables and functions */
int /*<<< orphan*/ callKaprekarFunction(int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int p, q;
  scanf("%d %d", &p, &q);
  callKaprekarFunction(p, q);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <callKaprekarFunction@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @callKaprekarFunction(i32 %6, i32 %7)
ret i32 0
}
void Convert8To16Row_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @Convert8To16Row_Any_SSE2() {
ret void
}
/* Type definitions */
struct wl_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int);
void wl_surface_commit(struct wl_surface *wl_surface) {
  wl_proxy_marshal((struct wl_proxy *)wl_surface, 6);
}


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

x86 assembly (clang, -O2):
<wl_surface_commit>:
mov    $0x6,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_surface_commit(%struct.wl_surface* %0) {
%2 = alloca %struct.wl_surface*
store %struct.wl_surface* %0, %struct.wl_surface** %2
%3 = load %struct.wl_surface*, %struct.wl_surface** %2
%4 = bitcast %struct.wl_surface* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 6)
ret void
}

LLVM IR (-O2):
%struct.wl_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_surface_commit(%struct.wl_surface* %0) {
%2 = bitcast %struct.wl_surface* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %2, i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getcwd(char *);
int /*<<< orphan*/ printf(char *, char *);
int pwd() {
  char cwd[64];
  getcwd(cwd);
  printf("%s\n", cwd);
}


x86 assembly (clang, -O0):
<pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
call   1040 <getcwd@plt>
lea    -0x50(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwd>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <getcwd@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @pwd() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ *find_section(char const *);
int config_has_section(const char *sectionname) {
  return (find_section(sectionname) != NULL) ? 1 : 0;
}


x86 assembly (clang, -O0):
<config_has_section>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <find_section@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @config_has_section(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @find_section(i8* %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @config_has_section(i8* %0) {
%2 = tail call i32* @find_section(i8* %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ large_block_deallocate(void *);
void large_free(void *ptr) { large_block_deallocate(ptr); }


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

x86 assembly (clang, -O2):
<large_free>:
jmp    1030 <large_block_deallocate@plt>

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

LLVM IR (-O2):
define void @large_free(i8* %0) {
%2 = tail call i32 @large_block_deallocate(i8* %0)
ret void
}
void backset() {
  asm volatile("movq (%%rsp), %%rax\n\t"
               "subq $0x10, %%rax\n\t"
               "movq (%%rax), %%rax\n\t"
               "movq $0x0123456789abcdef, %%rbx\n\t"
               "subq %%rbx, %%rax\n\t"
               "addq %%rax, (%%rsp)\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<backset>:
push   %rbp
mov    %rsp,%rbp
mov    (%rsp),%rax
sub    $0x10,%rax
mov    (%rax),%rax
movabs $0x123456789abcdef,%rbx
45 23 01
sub    %rbx,%rax
add    %rax,(%rsp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<backset>:
mov    (%rsp),%rax
sub    $0x10,%rax
mov    (%rax),%rax
movabs $0x123456789abcdef,%rbx
45 23 01
sub    %rbx,%rax
add    %rax,(%rsp)
ret

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

LLVM IR (-O2):
define void @backset() {
tail call void asm sideeffect "movq (%rsp), %rax\0A\09subq $$0x10, %rax\0A\09movq (%rax), %rax\0A\09movq $$0x0123456789abcdef, %rbx\0A\09subq %rbx, %rax\0A\09addq %rax, (%rsp)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qprintf(char *, int);
int q_is_taskid_valid(int hex) {
  qprintf("*** "
          "is_taskid_valid"
          "(%x)\n",
          hex);
  return 0;
}


x86 assembly (clang, -O0):
<q_is_taskid_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <qprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_is_taskid_valid>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <qprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"*** is_taskid_valid(%x)\0A\00"
define i32 @q_is_taskid_valid(i32 %0) {
%2 = tail call i32 @qprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
int /*<<< orphan*/ usleep(int);
void process(pthread_mutex_t *a, pthread_mutex_t *b) {
  pthread_mutex_lock(a);
  usleep(5000);
  int i = 0;
  i++;
  pthread_mutex_unlock(a);
  pthread_mutex_lock(b);
  usleep(5000);
  i++;
  pthread_mutex_unlock(b);
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_lock@plt>
mov    $0x1388,%edi
call   1050 <usleep@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pthread_mutex_lock@plt>
mov    $0x1388,%edi
call   1050 <usleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <pthread_mutex_lock@plt>
mov    $0x1388,%edi
call   1050 <usleep@plt>
mov    %rbx,%rdi
call   1030 <pthread_mutex_unlock@plt>
mov    %r14,%rdi
call   1040 <pthread_mutex_lock@plt>
mov    $0x1388,%edi
call   1050 <usleep@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <pthread_mutex_unlock@plt>

LLVM IR (-O0):
define void @process(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = call i32 @pthread_mutex_lock(i32* %6)
%8 = call i32 @usleep(i32 5000)
store i32 0, i32* %5
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = call i32 @pthread_mutex_unlock(i32* %11)
%13 = load i32*, i32** %4
%14 = call i32 @pthread_mutex_lock(i32* %13)
%15 = call i32 @usleep(i32 5000)
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
%18 = load i32*, i32** %4
%19 = call i32 @pthread_mutex_unlock(i32* %18)
ret void
}

LLVM IR (-O2):
define void @process(i32* %0, i32* %1) {
%3 = tail call i32 @pthread_mutex_lock(i32* %0)
%4 = tail call i32 @usleep(i32 5000)
%5 = tail call i32 @pthread_mutex_unlock(i32* %0)
%6 = tail call i32 @pthread_mutex_lock(i32* %1)
%7 = tail call i32 @usleep(i32 5000)
%8 = tail call i32 @pthread_mutex_unlock(i32* %1)
ret void
}
/* Variables and functions */
float abs(float);
float get(char *);
int /*<<< orphan*/ printf(char *, float);
void findAbsoluteValue() {
  float num = get("Enter your number");
  float result = abs(num);
  printf("Result: %f", result);
}


x86 assembly (clang, -O0):
<findAbsoluteValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <get@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <abs@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findAbsoluteValue>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <get@plt>
call   1030 <abs@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Enter your number\00"
@.str.1 = [11 x i8] c"Result: %f\00"
define void @findAbsoluteValue() {
%1 = alloca float
%2 = alloca float
%3 = call float @get(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store float %3, float* %1
%4 = load float, float* %1
%5 = call float @abs(float %4)
store float %5, float* %2
%6 = load float, float* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter your number\00"
@.str.1 = [11 x i8] c"Result: %f\00"
define void @findAbsoluteValue() {
%1 = tail call float @get(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call float @abs(float %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %2)
ret void
}
void foo322() {}


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

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

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

LLVM IR (-O2):
define void @foo322() {
ret void
}
int test_imm_ADuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xAD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ADuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 173
%6 = icmp ne i64 %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_ADuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 173
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef size_t uint8_t;
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
uint16_t GetPaletteBG(uint8_t entry) {
  return ((volatile uint16_t *)(0x5000000))[entry];
}


x86 assembly (clang, -O0):
<GetPaletteBG>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x5000000,%eax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPaletteBG>:
mov    0x5000000(,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @GetPaletteBG(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = getelementptr inbounds i32, i32* inttoptr (i64 83886080 to i32*), i64 %3
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @GetPaletteBG(i64 %0) {
%2 = getelementptr inbounds i32, i32* inttoptr (i64 83886080 to i32*), i64 %0
%3 = load volatile i32, i32* %2
ret i32 %3
}
void music_skip(int skips) {}


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

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

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

LLVM IR (-O2):
define void @music_skip(i32 %0) {
ret void
}
/* Variables and functions */
float cos(float);
float d2y2(float x) { return cos(x) + x * x - 2; }


x86 assembly (clang, -O0):
<d2y2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xebc(%rip),%xmm1
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2y2>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <cos@plt>
movss  0x4(%rsp),%xmm1
mulss  %xmm1,%xmm1
addss  %xmm1,%xmm0
addss  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @d2y2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @cos(float %3)
%5 = load float, float* %2
%6 = load float, float* %2
%7 = call float @llvm.fmuladd.f32(float %5, float %6, float %4)
%8 = fsub float %7, 2.000000e+00
ret float %8
}

LLVM IR (-O2):
define float @d2y2(float %0) {
%2 = tail call float @cos(float %0)
%3 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %2)
%4 = fadd float %3, -2.000000e+00
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int printrandomnumber() { printf("%d\n", rand()); }


x86 assembly (clang, -O0):
<printrandomnumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printrandomnumber>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @printrandomnumber() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  printf("%d\n", (int)13.45f);
  printf("%f\n", (float)13);
  printf("%f\n", (float)13.45);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
movss  0xed6(%rip),%xmm0
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
movss  0xec2(%rip),%xmm0
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
movss  0xeaa(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee0(%rip),%rbx
mov    %rbx,%rdi
movss  0xec9(%rip),%xmm0
call   1030 <printf@plt>
movss  0xec0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 1.300000e+01)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 1.300000e+01)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 0x402AE66660000000)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 1.300000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 1.300000e+01)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 0x402AE66660000000)
ret i32 0
}
zchdir(dirnam) char *dirnam;
{
  char *hd;
  if (*dirnam == '\0')
    hd = getenv("HOME");
  else
    hd = dirnam;
  return ((chdir(hd) == 0) ? 1 : 0);
}


x86 assembly (clang, -O0):
<zchdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1155 <zchdir+0x35>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <getenv@plt>
cltq
mov    %rax,-0x10(%rbp)
jmp    115d <zchdir+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <chdir@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zchdir>:
push   %rax
cmpb   $0x0,(%rdi)
jne    1137 <zchdir+0x17>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <getenv@plt>
movslq %eax,%rdi
xor    %eax,%eax
call   1040 <chdir@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
define i32 @zchdir(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @getenv to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
br label %14
12: ; preds = %1
%13 = load i8*, i8** %2
store i8* %13, i8** %3
br label %14
14: ; preds = %12, %8
%15 = load i8*, i8** %3
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @chdir to i32 (i8*, ...)*)(i8* %15)
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
ret i32 %19
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
define i32 @zchdir(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @getenv to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ %0, %1 ]
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @chdir to i32 (i8*, ...)*)(i8* %9)
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}