xunge/DecIR huggingface dataset:
void uart_init(void) {
  int divisor;
  *((volatile unsigned char *)(0x90000000 + 2)) = 0x01 | 0x02 | 0x04 | 0xC0;
  *((volatile unsigned char *)(0x90000000 + 1)) = 0x00;
  *((volatile unsigned char *)(0x90000000 + 3)) = 0x03 & ~(0x04 | 0x08);
  divisor = 5000000 / (16 * 9600);
  *((volatile unsigned char *)(0x90000000 + 3)) |= 0x80;
  *((volatile unsigned char *)(0x90000000 + 0)) = divisor & 0x000000ff;
  *((volatile unsigned char *)(0x90000000 + 1)) = (divisor >> 8) & 0x000000ff;
  *((volatile unsigned char *)(0x90000000 + 3)) &= ~(0x80);
}


x86 assembly (clang, -O0):
<uart_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x90000002,%eax
movb   $0xc7,(%rax)
mov    $0x90000001,%eax
movb   $0x0,(%rax)
mov    $0x90000003,%eax
movb   $0x3,(%rax)
movl   $0x20,-0x4(%rbp)
mov    $0x90000003,%eax
mov    (%rax),%al
movzbl %al,%eax
or     $0x80,%eax
mov    %al,%cl
mov    $0x90000003,%eax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    $0x90000000,%eax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    $0x90000001,%eax
mov    %cl,(%rax)
mov    $0x90000003,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0xffffff7f,%eax
mov    %al,%cl
mov    $0x90000003,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_init>:
mov    $0x90000003,%eax
movb   $0xc7,-0x1(%rax)
movb   $0x0,-0x2(%rax)
movb   $0x3,(%rax)
orb    $0x80,(%rax)
movb   $0x20,-0x3(%rax)
movb   $0x0,-0x2(%rax)
andb   $0x7f,(%rax)
ret

LLVM IR (-O0):
define void @uart_init() {
%1 = alloca i32
store volatile i8 -57, i8* inttoptr (i64 2415919106 to i8*)
store volatile i8 0, i8* inttoptr (i64 2415919105 to i8*)
store volatile i8 3, i8* inttoptr (i64 2415919107 to i8*)
store i32 32, i32* %1
%2 = load volatile i8, i8* inttoptr (i64 2415919107 to i8*)
%3 = zext i8 %2 to i32
%4 = or i32 %3, 128
%5 = trunc i32 %4 to i8
store volatile i8 %5, i8* inttoptr (i64 2415919107 to i8*)
%6 = load i32, i32* %1
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
store volatile i8 %8, i8* inttoptr (i64 2415919104 to i8*)
%9 = load i32, i32* %1
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = trunc i32 %11 to i8
store volatile i8 %12, i8* inttoptr (i64 2415919105 to i8*)
%13 = load volatile i8, i8* inttoptr (i64 2415919107 to i8*)
%14 = zext i8 %13 to i32
%15 = and i32 %14, -129
%16 = trunc i32 %15 to i8
store volatile i8 %16, i8* inttoptr (i64 2415919107 to i8*)
ret void
}

LLVM IR (-O2):
define void @uart_init() {
store volatile i8 -57, i8* inttoptr (i64 2415919106 to i8*)
store volatile i8 0, i8* inttoptr (i64 2415919105 to i8*)
store volatile i8 3, i8* inttoptr (i64 2415919107 to i8*)
%1 = load volatile i8, i8* inttoptr (i64 2415919107 to i8*)
%2 = or i8 %1, -128
store volatile i8 %2, i8* inttoptr (i64 2415919107 to i8*)
store volatile i8 32, i8* inttoptr (i64 2415919104 to i8*)
store volatile i8 0, i8* inttoptr (i64 2415919105 to i8*)
%3 = load volatile i8, i8* inttoptr (i64 2415919107 to i8*)
%4 = and i8 %3, 127
store volatile i8 %4, i8* inttoptr (i64 2415919107 to i8*)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *display;
};
struct TYPE_4__ {
  TYPE_1__ xvisibility;
};
typedef TYPE_2__ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XEvent_xvisibility_display(void *_p, void *_v) {
  ((XEvent *)_p)->xvisibility.display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xvisibility_display>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32* }
define void @set_XEvent_xvisibility_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_4__*
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
store i32* %6, i32** %10
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xvisibility_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initLinuxIO();
int /*<<< orphan*/ mainLoop();
void main(void) {
  initLinuxIO();
  mainLoop();
}


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @initLinuxIO()
%2 = tail call i32 (...) @mainLoop()
ret void
}
/* Variables and functions */
int snprintf(char *, int, char *);
int f4(char *s) { return snprintf(s, 8, "foo"); }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
lea    0xed4(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
lea    0xee9(%rip),%rdx
mov    $0x8,%esi
jmp    1030 <snprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i32 @f4(i8* %0) {
%2 = tail call i32 @snprintf(i8* %0, i32 8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_copy_target_standard_solution_to_container(int k, int i) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(104, &k, &i, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_copy_target_standard_solution_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x68,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_copy_target_standard_solution_to_container>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x68,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @celcon_copy_target_standard_solution_to_container(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 104, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
char *userpw_shortdesc(void) {
  return "compute a secret key based on an user password";
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"compute a secret key based on an user password\00"
define i8* @userpw_shortdesc() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [47 x i8] c"compute a secret key based on an user password\00"
define i8* @userpw_shortdesc() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ start_server(int);
int main(int argc, char **argv) {
  int port = 8888;
  start_server(port);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @start_server(i32 8888)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sysClear();
int /*<<< orphan*/ sysPrintString(char *, int /*<<< orphan*/, int, int);
int clear(int words) {
  if (words != 1) {
    sysPrintString("No extra parameters for clear\n", 0, 255, 255);
    return 2;
  }
  sysClear();
  return 0;
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1156 <clear+0x36>
lea    0xec4(%rip),%rdi
xor    %esi,%esi
mov    $0xff,%ecx
mov    %ecx,%edx
call   1030 <sysPrintString@plt>
movl   $0x2,-0x4(%rbp)
jmp    1164 <clear+0x44>
mov    $0x0,%al
call   1040 <sysClear@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
push   %rbx
cmp    $0x1,%edi
jne    1131 <clear+0x11>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <sysClear@plt>
jmp    114e <clear+0x2e>
lea    0xec8(%rip),%rdi
xor    %esi,%esi
mov    $0xff,%edx
mov    $0xff,%ecx
call   1030 <sysPrintString@plt>
mov    $0x2,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"No extra parameters for clear\0A\00"
define i32 @clear(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @sysPrintString(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 0, i32 255, i32 255)
store i32 2, i32* %2
br label %10
8: ; preds = %1
%9 = call i32 (...) @sysClear()
store i32 0, i32* %2
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [31 x i8] c"No extra parameters for clear\0A\00"
define i32 @clear(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sysPrintString(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 0, i32 255, i32 255)
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @sysClear()
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ 2, %3 ], [ 0, %5 ]
ret i32 %8
}
int test_imm_08uint16_mem(unsigned short *val) {
  return ((*val) & (-0x08 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_08uint16_mem>:
cmpw   $0x8,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_08uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp ult i16 %2, 8
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int f(int n) { return n < 10; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0xa,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned str_format_size(const char *str, unsigned f_char, unsigned l_char) {
  unsigned i, size = 0;
  for (i = f_char + 1; i < l_char; i++) {
    if (str[i] == '\\')
      i++;
    size++;
  }
  return size;
}


x86 assembly (clang, -O0):
<str_format_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    115e <str_format_size+0x5e>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    1147 <str_format_size+0x47>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111e <str_format_size+0x1e>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_format_size>:
lea    0x1(%rsi),%r8d
xor    %eax,%eax
cmp    %edx,%r8d
jae    1130 <str_format_size+0x30>
xor    %eax,%eax
jmp    111f <str_format_size+0x1f>
nop
mov    %r8d,%esi
add    $0x1,%eax
lea    0x1(%rsi),%r8d
cmp    %edx,%r8d
jae    1130 <str_format_size+0x30>
mov    %r8d,%ecx
cmpb   $0x5c,(%rdi,%rcx,1)
jne    1110 <str_format_size+0x10>
add    $0x2,%esi
mov    %esi,%r8d
jmp    1110 <str_format_size+0x10>
ret

LLVM IR (-O0):
define i32 @str_format_size(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %8
%9 = load i32, i32* %5
%10 = add i32 %9, 1
store i32 %10, i32* %7
br label %11
11: ; preds = %29, %3
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = icmp ult i32 %12, %13
br i1 %14, label %15, label %32
15: ; preds = %11
%16 = load i8*, i8** %4
%17 = load i32, i32* %7
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 92
br i1 %22, label %23, label %26
23: ; preds = %15
%24 = load i32, i32* %7
%25 = add i32 %24, 1
store i32 %25, i32* %7
br label %26
26: ; preds = %23, %15
%27 = load i32, i32* %8
%28 = add i32 %27, 1
store i32 %28, i32* %8
br label %29
29: ; preds = %26
%30 = load i32, i32* %7
%31 = add i32 %30, 1
store i32 %31, i32* %7
br label %11
32: ; preds = %11
%33 = load i32, i32* %8
ret i32 %33
}

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


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

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

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

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 (...) @led_enable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void error(char *msg) {
  perror(msg);
  return;
}


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

x86 assembly (clang, -O2):
<error>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
void ldv_kref_sub(struct ldv_kref *kref, unsigned int count,
                  void (*release)(struct ldv_kref *kref)) {
  release(kref);
}


x86 assembly (clang, -O0):
<ldv_kref_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldv_kref_sub>:
jmp    *%rdx

LLVM IR (-O0):
%struct.ldv_kref = type opaque
define void @ldv_kref_sub(%struct.ldv_kref* %0, i32 %1, void (%struct.ldv_kref*)* %2) {
%4 = alloca %struct.ldv_kref*
%5 = alloca i32
%6 = alloca void (%struct.ldv_kref*)*
store %struct.ldv_kref* %0, %struct.ldv_kref** %4
store i32 %1, i32* %5
store void (%struct.ldv_kref*)* %2, void (%struct.ldv_kref*)** %6
%7 = load void (%struct.ldv_kref*)*, void (%struct.ldv_kref*)** %6
%8 = load %struct.ldv_kref*, %struct.ldv_kref** %4
ret void
}

LLVM IR (-O2):
%struct.ldv_kref = type opaque
define void @ldv_kref_sub(%struct.ldv_kref* %0, i32 %1, void (%struct.ldv_kref*)* nocapture %2) {
tail call void %2(%struct.ldv_kref* %0)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int compara(char *s1, char *s2) { return strcmp(s1, s2); }


x86 assembly (clang, -O0):
<compara>:
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 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compara>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compara(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
char *lskip(const char *s) {
  while (*s && isspace((unsigned char)(*s))) {
    s++;
  }
  return (char *)s;
}


x86 assembly (clang, -O0):
<lskip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <lskip+0x37>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <lskip+0x47>
jmp    1168 <lskip+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lskip+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lskip>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <lskip+0x29>
nopw   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <lskip+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lskip+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @lskip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @isspace(i8 zeroext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @lskip(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 zeroext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
struct param_d *dev_add_param_enum(struct device_d *dev, const char *name,
                                   int (*set)(struct param_d *p, void *priv),
                                   int (*get)(struct param_d *p, void *priv),
                                   int *value, const char **names, int max,
                                   void *priv) {
  return ((void *)0);
}


x86 assembly (clang, -O0):
<dev_add_param_enum>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.param_d = type opaque
%struct.device_d = type opaque
define %struct.param_d* @dev_add_param_enum(%struct.device_d* %0, i8* %1, i32 (%struct.param_d*, i8*)* %2, i32 (%struct.param_d*, i8*)* %3, i32* %4, i8** %5, i32 %6, i8* %7) {
%9 = alloca %struct.device_d*
%10 = alloca i8*
%11 = alloca i32 (%struct.param_d*, i8*)*
%12 = alloca i32 (%struct.param_d*, i8*)*
%13 = alloca i32*
%14 = alloca i8**
%15 = alloca i32
%16 = alloca i8*
store %struct.device_d* %0, %struct.device_d** %9
store i8* %1, i8** %10
store i32 (%struct.param_d*, i8*)* %2, i32 (%struct.param_d*, i8*)** %11
store i32 (%struct.param_d*, i8*)* %3, i32 (%struct.param_d*, i8*)** %12
store i32* %4, i32** %13
store i8** %5, i8*** %14
store i32 %6, i32* %15
store i8* %7, i8** %16
ret %struct.param_d* null
}

LLVM IR (-O2):
%struct.param_d = type opaque
%struct.device_d = type opaque
define noalias %struct.param_d* @dev_add_param_enum(%struct.device_d* nocapture readnone %0, i8* nocapture readnone %1, i32 (%struct.param_d*, i8*)* nocapture readnone %2, i32 (%struct.param_d*, i8*)* nocapture readnone %3, i32* nocapture readnone %4, i8** nocapture readnone %5, i32 %6, i8* nocapture readnone %7) {
ret %struct.param_d* null
}
/* Variables and functions */
char *strchr(char *, char);
int indexOf(char *term, char searchChar) {
  char *pos = strchr(term, searchChar);
  if (pos == NULL)
    return -1;
  else
    return (int)(pos - term);
}


x86 assembly (clang, -O0):
<indexOf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114a <indexOf+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <indexOf+0x48>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexOf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @indexOf(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
%7 = load i8*, i8** %4
%8 = load i8, i8* %5
%9 = call i8* @strchr(i8* %7, i8 signext %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %20
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %4
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @indexOf(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
char *jsonTopoAddDevice(char *, char *, char *, int /*<<< orphan*/ *,
                        int /*<<< orphan*/);
char *jsonTopoAddUI(char *mac, char *name) {
  return (jsonTopoAddDevice("ui", mac, name, NULL, 0));
}


x86 assembly (clang, -O0):
<jsonTopoAddUI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <jsonTopoAddDevice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonTopoAddUI>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <jsonTopoAddDevice@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"ui\00"
define i8* @jsonTopoAddUI(i8* %0, i8* %1) {
%3 = tail call i8* @jsonTopoAddDevice(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32* null, i32 0)
ret i8* %3
}
_Complex double test_catan(_Complex double x) { return __builtin_catan(x); }


x86 assembly (clang, -O0):
<test_catan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <catan@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_catan>:
jmp    1030 <catan@plt>

LLVM IR (-O0):
define { double, double } @test_catan(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %6
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%9 = load double, double* %8
%10 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%13 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %9, double* %12
store double %11, double* %13
%14 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%15 = load double, double* %14
%16 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%17 = load double, double* %16
%18 = call { double, double } @catan(double %15, double %17)
%19 = extractvalue { double, double } %18, 0
%20 = extractvalue { double, double } %18, 1
%21 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%22 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %19, double* %21
store double %20, double* %22
%23 = load { double, double }, { double, double }* %3
ret { double, double } %23
}

LLVM IR (-O2):
define { double, double } @test_catan(double %0, double %1) {
%3 = tail call { double, double } @catan(double %0, double %1)
ret { double, double } %3
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char **argv) {
  int x = 10;
  int y = 20;
  printf("%d + %d = %d\n", x, y, add(x, y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0x14,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <add@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x14,%esi
call   1030 <add@plt>
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
store i32 20, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 @add(i32 %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 10, i32 20)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ get_lexval();
int /*<<< orphan*/ parameter_list();
int yyselect();
parameter_type_list() {
  switch (yyselect()) {
  case 30: {
    parameter_list();
    switch (yyselect()) {
    case 126: {
      get_lexval();
      get_lexval();
    } break;
    default:;
    }
  } break;
  }
}


x86 assembly (clang, -O0):
<parameter_type_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <yyselect@plt>
sub    $0x1e,%eax
jne    118a <parameter_type_list+0x5a>
jmp    114d <parameter_type_list+0x1d>
xor    %eax,%eax
mov    %al,-0x5(%rbp)
call   1030 <parameter_list@plt>
mov    -0x5(%rbp),%al
call   1040 <yyselect@plt>
sub    $0x7e,%eax
jne    1180 <parameter_type_list+0x50>
jmp    116d <parameter_type_list+0x3d>
mov    $0x0,%al
call   1050 <get_lexval@plt>
mov    $0x0,%al
call   1050 <get_lexval@plt>
jmp    1185 <parameter_type_list+0x55>
jmp    1185 <parameter_type_list+0x55>
jmp    118a <parameter_type_list+0x5a>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parameter_type_list>:
push   %rax
xor    %eax,%eax
call   1040 <yyselect@plt>
cmp    $0x1e,%eax
jne    115e <parameter_type_list+0x2e>
xor    %eax,%eax
call   1030 <parameter_list@plt>
xor    %eax,%eax
call   1040 <yyselect@plt>
cmp    $0x7e,%eax
jne    115e <parameter_type_list+0x2e>
xor    %eax,%eax
call   1050 <get_lexval@plt>
xor    %eax,%eax
call   1050 <get_lexval@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @parameter_type_list() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %11 [
i32 30, label %3
]
3: ; preds = %0
%4 = call i32 (...) @parameter_list()
%5 = call i32 (...) @yyselect()
switch i32 %5, label %9 [
i32 126, label %6
]
6: ; preds = %3
%7 = call i32 (...) @get_lexval()
%8 = call i32 (...) @get_lexval()
br label %10
9: ; preds = %3
br label %10
10: ; preds = %9, %6
br label %11
11: ; preds = %0, %10
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @parameter_type_list() {
%1 = tail call i32 (...) @yyselect()
%2 = icmp eq i32 %1, 30
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i32 (...) @parameter_list()
%5 = tail call i32 (...) @yyselect()
%6 = icmp eq i32 %5, 126
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i32 (...) @get_lexval()
%9 = tail call i32 (...) @get_lexval()
br label %10
10: ; preds = %7, %3, %0
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sendcmd(int, int);
int /*<<< orphan*/ sgetc(int);
int /*<<< orphan*/ sputc(unsigned char, int);
int seektrack(unsigned char track, int s) {
  sendcmd(3, s);
  sputc(track, s);
  sgetc(s);
  return 1;
}


x86 assembly (clang, -O0):
<seektrack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x3,%edi
call   1050 <sendcmd@plt>
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
movzbl %al,%edi
call   1030 <sputc@plt>
mov    -0x8(%rbp),%edi
call   1040 <sgetc@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seektrack>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x3,%edi
call   1050 <sendcmd@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <sputc@plt>
mov    %ebx,%edi
call   1040 <sgetc@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @seektrack(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @sendcmd(i32 3, i32 %5)
%7 = load i8, i8* %3
%8 = load i32, i32* %4
%9 = call i32 @sputc(i8 zeroext %7, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @sgetc(i32 %10)
ret i32 1
}

LLVM IR (-O2):
define i32 @seektrack(i8 zeroext %0, i32 %1) {
%3 = tail call i32 @sendcmd(i32 3, i32 %1)
%4 = tail call i32 @sputc(i8 zeroext %0, i32 %1)
%5 = tail call i32 @sgetc(i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(unsigned long);
void *realloc(void *, int);
void f1() {
  int i;
  unsigned long j;
  i = j = 10;
  void *ptr = malloc(j);
  ptr = realloc(ptr, i);
  free(ptr);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0xa,-0x10(%rbp)
movl   $0xa,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0xa,%esi
call   1050 <realloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8*
store i64 10, i64* %2
store i32 10, i32* %1
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %1
%8 = call i8* @realloc(i8* %6, i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i64 10)
%2 = tail call i8* @realloc(i8* %1, i32 10)
%3 = tail call i32 @free(i8* %2)
ret void
}
unsigned short int f86(unsigned short int x, unsigned long int y) {
  return (x << (8 * 2 - y)) + (x >> y);
}


x86 assembly (clang, -O0):
<f86>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x10,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f86>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f86(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = sub i64 16, %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %6, %9
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = ashr i32 %12, %14
%16 = add nsw i32 %10, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f86(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 16, %4
%6 = shl i32 %3, %5
%7 = lshr i32 %3, %4
%8 = add nsw i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}
/* Variables and functions */
int unlink(char const *);
int remove_file(const char *pathname) { return unlink(pathname); }


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

x86 assembly (clang, -O2):
<remove_file>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @remove_file(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
void tgl_check_release(void) {}


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

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

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

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


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

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

LLVM IR (-O0):
define i32 @test_imm_52uint64_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, 82
%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_52uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 82
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long parent;
};
struct TYPE_4__ {
  TYPE_1__ xreparent;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xreparent_parent(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xreparent.parent = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xreparent_parent>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xreparent_parent(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xreparent_parent(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void rotate60(double dx, double dy, double *rdx, double *rdy) {
  *rdx = 0.5 * dx - (0.86602540378443864676) * dy;
  *rdy = 0.5 * dy + (0.86602540378443864676) * dx;
}


x86 assembly (clang, -O0):
<rotate60>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xeb9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xe8f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate60>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm1,%xmm2
movsd  0xef4(%rip),%xmm3
movapd %xmm0,%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm2,%xmm4
mulsd  0xee8(%rip),%xmm0
movsd  %xmm4,(%rdi)
mulsd  %xmm3,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @rotate60(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fmul double 0x3FEBB67AE8584CAA, %10
%12 = fneg double %11
%13 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %9, double %12)
%14 = load double*, double** %7
store double %13, double* %14
%15 = load double, double* %6
%16 = load double, double* %5
%17 = fmul double 0x3FEBB67AE8584CAA, %16
%18 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %15, double %17)
%19 = load double*, double** %8
store double %18, double* %19
ret void
}

LLVM IR (-O2):
define void @rotate60(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = fmul double %1, 0xBFEBB67AE8584CAA
%6 = tail call double @llvm.fmuladd.f64(double %0, double 5.000000e-01, double %5)
store double %6, double* %2
%7 = fmul double %0, 0x3FEBB67AE8584CAA
%8 = tail call double @llvm.fmuladd.f64(double %1, double 5.000000e-01, double %7)
store double %8, double* %3
ret void
}
void ff_hevc_put_hevc_uni_epel_h32_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h32_10_avx2() {
ret void
}
int dcmpeq(double a, double b) { return a == b; }


x86 assembly (clang, -O0):
<dcmpeq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcmpeq>:
cmpeqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @dcmpeq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oeq double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @dcmpeq(double %0, double %1) {
%3 = fcmp oeq double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int cmp_mul_2(float x) { return x * -5 > 100; }


x86 assembly (clang, -O0):
<cmp_mul_2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_mul_2>:
mulss  0xef8(%rip),%xmm0
xor    %eax,%eax
ucomiss 0xef3(%rip),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @cmp_mul_2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, -5.000000e+00
%5 = fcmp ogt float %4, 1.000000e+02
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @cmp_mul_2(float %0) {
%2 = fmul float %0, -5.000000e+00
%3 = fcmp ogt float %2, 1.000000e+02
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char buf[5];
  strcpy(buf, argv[1]);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rsi
lea    0x3(%rsp),%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %4, i8* %6)
ret i32 0
}
void foo563() {}


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

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

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

LLVM IR (-O2):
define void @foo563() {
ret void
}
char *langRomTypeGoudaSCSI() { return "Gouda SCSI"; }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Gouda SCSI\00"
define i8* @langRomTypeGoudaSCSI() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
mode_t umask(mode_t mask) {
  errno = ENOSYS;
  return 0777;
}


x86 assembly (clang, -O0):
<umask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0x1ff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umask>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0x1ff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @umask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 511
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @umask(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 511
}
void gtk_spin_button_get_value() {}


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

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

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

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