xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, unsigned long long);
int main() {
  int i;
  unsigned long long int a, b, c;
  a = 2;
  b = 1;
  c = 1;
  for (i = 1; i <= 100; i++) {
    printf("№%d - %llu \n", i, c);
    c = a + b;
    a = b;
    b = c;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x2,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1185 <main+0x75>
mov    -0x8(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <main+0x2e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebp
mov    $0x2,%ebx
mov    $0x1,%eax
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %rax,%r15
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
add    %r15,%rbx
add    $0x1,%ebp
mov    %rbx,%rax
mov    %r15,%rbx
cmp    $0x65,%ebp
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\E2\84\96%d - %llu \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i64 2, i64* %3
store i64 1, i64* %4
store i64 1, i64* %5
store i32 1, i32* %2
br label %6
6: ; preds = %18, %0
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 100
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i64, i64* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i64 %11)
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = add i64 %13, %14
store i64 %15, i64* %5
%16 = load i64, i64* %4
store i64 %16, i64* %3
%17 = load i64, i64* %5
store i64 %17, i64* %4
br label %18
18: ; preds = %9
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %6
21: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"\E2\84\96%d - %llu \0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 1, %0 ], [ %6, %1 ]
%3 = phi i64 [ 2, %0 ], [ %2, %1 ]
%4 = phi i32 [ 1, %0 ], [ %7, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4, i64 %2)
%6 = add i64 %2, %3
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, 101
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}
/* Variables and functions */
void ui_rect(int x, int y, int cx, int cy, int colour) {}


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

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

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

LLVM IR (-O2):
define void @ui_rect(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
int naturalNumber() {
  static int b = -1;
  return b++;
}


x86 assembly (clang, -O0):
<naturalNumber>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0b(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<naturalNumber>:
mov    0x2f1a(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
ret

LLVM IR (-O0):
@naturalNumber.b = internal global i32 -1
define i32 @naturalNumber() {
%1 = load i32, i32* @naturalNumber.b
%2 = add nsw i32 %1, 1
store i32 %2, i32* @naturalNumber.b
ret i32 %1
}

LLVM IR (-O2):
@naturalNumber.b = internal unnamed_addr global i32 -1
define i32 @naturalNumber() {
%1 = load i32, i32* @naturalNumber.b
%2 = add nsw i32 %1, 1
store i32 %2, i32* @naturalNumber.b
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun(void) { printf("Hello from fun!"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello from fun!\00"
define void @fun() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello from fun!\00"
define void @fun() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
int foo(int a) {
  static int b = 1;
  return b + a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2f13(%rip),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
@foo.b = internal global i32 1
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @foo.b
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ crt_exception(int, char *);
int write(int, void *, int);
int swrite(int fd, void *ptr, int numbytes) {
  static int w;
  w = write(fd, ptr, numbytes);
  if (w <= 0) {
    crt_exception(2, "Writing .class file data");
  }
  return w;
}


x86 assembly (clang, -O0):
<swrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,0x2eed(%rip)
cmpl   $0x0,0x2ee6(%rip)
jg     1165 <swrite+0x45>
mov    $0x2,%edi
lea    0xea0(%rip),%rsi
call   1040 <crt_exception@plt>
mov    0x2ec9(%rip),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swrite>:
push   %rax
call   1030 <write@plt>
mov    %eax,0x2f08(%rip)
test   %eax,%eax
jle    1132 <swrite+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rsi
mov    $0x2,%edi
call   1040 <crt_exception@plt>
mov    0x2eeb(%rip),%eax
pop    %rcx
ret

LLVM IR (-O0):
@swrite.w = internal global i32 0
@.str = [25 x i8] c"Writing .class file data\00"
define i32 @swrite(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @write(i32 %7, i8* %8, i32 %9)
store i32 %10, i32* @swrite.w
%11 = load i32, i32* @swrite.w
%12 = icmp sle i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @crt_exception(i32 2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i32, i32* @swrite.w
ret i32 %16
}

LLVM IR (-O2):
@swrite.w = internal unnamed_addr global i32 0
@.str = [25 x i8] c"Writing .class file data\00"
define i32 @swrite(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
store i32 %4, i32* @swrite.w
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @crt_exception(i32 2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @swrite.w
br label %9
9: ; preds = %6, %3
%10 = phi i32 [ %8, %6 ], [ %4, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ accept_logical_AND_expression();
int /*<<< orphan*/ parse_logical_OR_expression();
void accept_logical_OR_expression() {
  accept_logical_AND_expression();
  parse_logical_OR_expression();
}


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

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

LLVM IR (-O0):
define void @accept_logical_OR_expression() {
%1 = call i32 (...) @accept_logical_AND_expression()
%2 = call i32 (...) @parse_logical_OR_expression()
ret void
}

LLVM IR (-O2):
define void @accept_logical_OR_expression() {
%1 = tail call i32 (...) @accept_logical_AND_expression()
%2 = tail call i32 (...) @parse_logical_OR_expression()
ret void
}
/* Type definitions */
struct clone_args {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ syscall(int, struct clone_args *, size_t);
pid_t sys_clone3(struct clone_args *args, size_t size) {
  fflush(stdout);
  fflush(stderr);
  return syscall(-1, args, size);
}


x86 assembly (clang, -O0):
<sys_clone3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_clone3>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0xffffffff,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.clone_args = type { i32 }
@stdout = global i32 0
@stderr = global i32 0
define i32 @sys_clone3(%struct.clone_args* %0, i64 %1) {
%3 = alloca %struct.clone_args*
%4 = alloca i64
store %struct.clone_args* %0, %struct.clone_args** %3
store i64 %1, i64* %4
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fflush(i32 %7)
%9 = load %struct.clone_args*, %struct.clone_args** %3
%10 = load i64, i64* %4
%11 = call i32 @syscall(i32 -1, %struct.clone_args* %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.clone_args = type { i32 }
@stdout = global i32 0
@stderr = global i32 0
define i32 @sys_clone3(%struct.clone_args* %0, i64 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 @syscall(i32 -1, %struct.clone_args* %0, i64 %1)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
void view_char_by_char(char str[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("[%.2d] %c\n", i, str[i]);
}


x86 assembly (clang, -O0):
<view_char_by_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <view_char_by_char+0x4b>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebc(%rip),%rdi
movsbl (%rax,%rcx,1),%edx
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <view_char_by_char+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<view_char_by_char>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1148 <view_char_by_char+0x38>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <view_char_by_char+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"[%.2d] %c\0A\00"
define void @view_char_by_char(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %11, i8 signext %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"[%.2d] %c\0A\00"
define void @view_char_by_char(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10, i8 signext %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Type definitions */
struct cpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cpu_set_r8(struct cpu *, int, unsigned char);
void cpu_set_d(struct cpu *cpu, unsigned char d) { cpu_set_r8(cpu, (5), d); }


x86 assembly (clang, -O0):
<cpu_set_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
movzbl -0x9(%rbp),%edx
call   1030 <cpu_set_r8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_set_d>:
mov    %esi,%edx
mov    $0x5,%esi
jmp    1030 <cpu_set_r8@plt>

LLVM IR (-O0):
%struct.cpu = type { i32 }
define void @cpu_set_d(%struct.cpu* %0, i8 zeroext %1) {
%3 = alloca %struct.cpu*
%4 = alloca i8
store %struct.cpu* %0, %struct.cpu** %3
store i8 %1, i8* %4
%5 = load %struct.cpu*, %struct.cpu** %3
%6 = load i8, i8* %4
%7 = call i32 @cpu_set_r8(%struct.cpu* %5, i32 5, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
%struct.cpu = type { i32 }
define void @cpu_set_d(%struct.cpu* %0, i8 zeroext %1) {
%3 = tail call i32 @cpu_set_r8(%struct.cpu* %0, i32 5, i8 zeroext %1)
ret void
}
void INT_Excep_SCI9_TXI9(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI9_TXI9() {
ret void
}
float baby(float food) {
  float poop;
  poop = 1.217 * food;
  return (poop);
}


x86 assembly (clang, -O0):
<baby>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<baby>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @baby(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fmul double 1.217000e+00, %5
%7 = fptrunc double %6 to float
store float %7, float* %3
%8 = load float, float* %3
ret float %8
}

LLVM IR (-O2):
define float @baby(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 1.217000e+00
%4 = fptrunc double %3 to float
ret float %4
}
void rcu_preempt_note_context_switch(int cpu) {}


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

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

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

LLVM IR (-O2):
define void @rcu_preempt_note_context_switch(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void g_return_if_fail_warning(const char *log_domain,
                              const char *pretty_function,
                              const char *expression) {
  __coverity_panic__();
}


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

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

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

LLVM IR (-O2):
define void @g_return_if_fail_warning(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @__coverity_panic__()
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRC5_get(void) { return U_WMRCORENONE_get("U_WMRC5"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRC5\00"
define i32 @U_WMRC5_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int kvsnprintf(char *, int, char const *, int /*<<< orphan*/);
int kvsprintf(char *str, const char *format, va_list ap) {
  return kvsnprintf(str, -1, format, ap);
}


x86 assembly (clang, -O0):
<kvsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0xffffffff,%esi
call   1030 <kvsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0xffffffff,%esi
jmp    1030 <kvsnprintf@plt>

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

LLVM IR (-O2):
define i32 @kvsprintf(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @kvsnprintf(i8* %0, i32 -1, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mcal_cpu_nop();
void __nmi_handler() {
  for (;;) {
    mcal_cpu_nop();
  }
}


x86 assembly (clang, -O0):
<__nmi_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <__nmi_handler+0x9>
mov    $0x0,%al
call   1030 <mcal_cpu_nop@plt>
jmp    1119 <__nmi_handler+0x9>

x86 assembly (clang, -O2):
<__nmi_handler>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <mcal_cpu_nop@plt>
jmp    1120 <__nmi_handler+0x10>

LLVM IR (-O0):
define void @__nmi_handler() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @mcal_cpu_nop()
br label %1
}

LLVM IR (-O2):
define void @__nmi_handler() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @mcal_cpu_nop()
br label %1
}
void *memset3(void *s, int c) { return __builtin_memset(s, c, 0); }


x86 assembly (clang, -O0):
<memset3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    %ecx,%ecx
mov    %ecx,%edx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @memset3(i8* readnone returned %0, i32 %1) {
ret i8* %0
}
void func_c() { *((volatile int *)0x0) = 0x9999; }


x86 assembly (clang, -O0):
<func_c>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movl   $0x9999,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_c>:
movl   $0x9999,0x0
ret

LLVM IR (-O0):
define void @func_c() {
store volatile i32 39321, i32* null
ret void
}

LLVM IR (-O2):
define void @func_c() {
store volatile i32 39321, i32* null
ret void
}
/* Variables and functions */
unsigned int getbits(unsigned int, unsigned int, unsigned int);
unsigned setbits(unsigned x, unsigned p, unsigned n, unsigned y) {
  return y & (~0 << n) | getbits(x, p, n);
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <getbits@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
push   %rbx
mov    %ecx,%ebx
mov    %edx,%ecx
shr    %cl,%ebx
shl    %cl,%ebx
call   1030 <getbits@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32, i32* %7
%11 = shl i32 -1, %10
%12 = and i32 %9, %11
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = call i32 @getbits(i32 %13, i32 %14, i32 %15)
%17 = or i32 %12, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = and i32 %5, %3
%7 = tail call i32 @getbits(i32 %0, i32 %1, i32 %2)
%8 = or i32 %7, %6
ret i32 %8
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *notdir(const char *file) {
  const char *slash = strrchr(file, '/');
  if (slash)
    file = slash + 1;
  return file;
}


x86 assembly (clang, -O0):
<notdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <notdir+0x35>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @notdir(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int skytraq_millis(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


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

x86 assembly (clang, -O2):
<skytraq_millis>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @skytraq_millis() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @skytraq_millis() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
copy(s, t) char *s, *t;
{
  if (t == 0)
    return (*s = 0);
  while (*s++ = *t++)
    ;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    112a <copy+0x2a>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    115e <copy+0x5e>
jmp    112f <copy+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     115e <copy+0x5e>
jmp    112f <copy+0x2f>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
test   %rsi,%rsi
je     1122 <copy+0x22>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy+0x10>
xor    %eax,%eax
ret
movb   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @copy(i8* nocapture writeonly %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %5
4: ; preds = %2
store i8 0, i8* %0
br label %12
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %0, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %7
%10 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %9, i8* %6
%11 = icmp eq i8 %9, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gridgen_generategrid(char *);
int /*<<< orphan*/ parse_commandline(int, char **, char **);
int main(int argc, char *argv[]) {
  char *prmfname = NULL;
  parse_commandline(argc, argv, &prmfname);
  gridgen_generategrid(prmfname);
  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)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <parse_commandline@plt>
mov    -0x18(%rbp),%rdi
call   1030 <gridgen_generategrid@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdx
call   1040 <parse_commandline@plt>
mov    (%rsp),%rdi
call   1030 <gridgen_generategrid@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 i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @parse_commandline(i32 %7, i8** %8, i8** %6)
%10 = load i8*, i8** %6
%11 = call i32 @gridgen_generategrid(i8* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @parse_commandline(i32 %0, i8** %1, i8** %3)
%6 = load i8*, i8** %3
%7 = call i32 @gridgen_generategrid(i8* %6)
ret i32 0
}
void delay() {
  int i;
  for (i = 0; i < 50000; i++)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xc350,-0x4(%rbp)
jge    112b <delay+0x2b>
jmp    111d <delay+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <delay+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 50000
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @delay() {
ret void
}
int is_branch(int opcode) { return (opcode & 0xFC) == 0x04; }


x86 assembly (clang, -O0):
<is_branch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfc,%eax
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_branch>:
and    $0xfc,%edi
xor    %eax,%eax
cmp    $0x4,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_branch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 252
%5 = icmp eq i32 %4, 4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_branch(i32 %0) {
%2 = and i32 %0, 252
%3 = icmp eq i32 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, short);
char *strcpy(char *, char *);
char *INTASCII(char *Result, short Num) {
  char St[256];
  sprintf(St, "%d", Num);
  return strcpy(Result, St);
}


x86 assembly (clang, -O0):
<INTASCII>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
lea    -0x110(%rbp),%rdi
lea    0xebc(%rip),%rsi
movswl -0xa(%rbp),%edx
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INTASCII>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xeca(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @INTASCII(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca [256 x i8]
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i16, i16* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16 signext %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i8* @strcpy(i8* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @INTASCII(i8* returned %0, i16 signext %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16 signext %1)
%6 = call i8* @strcpy(i8* dereferenceable(1) %0, i8* %4)
ret i8* %0
}
int min3(int x, int y, int z) {
  return x < y ? (x < z ? x : z) : (z < y) ? z : y;
}


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1141 <min3+0x41>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1130 <min3+0x30>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <min3+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <min3+0x64>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <min3+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115e <min3+0x5e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min3>:
mov    %edx,%eax
cmp    %edx,%edi
cmovl  %edi,%eax
cmp    %esi,%eax
cmovge %esi,%eax
ret

LLVM IR (-O0):
define i32 @min3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32, i32* %4
br label %18
16: ; preds = %10
%17 = load i32, i32* %6
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
br label %30
20: ; preds = %3
%21 = load i32, i32* %6
%22 = load i32, i32* %5
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i32, i32* %6
br label %28
26: ; preds = %20
%27 = load i32, i32* %5
br label %28
28: ; preds = %26, %24
%29 = phi i32 [ %25, %24 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %18
%31 = phi i32 [ %19, %18 ], [ %29, %28 ]
ret i32 %31
}

LLVM IR (-O2):
define i32 @min3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %2
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp slt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR9A_set(void) { return U_WMRCORENONE_set("U_WMR9A"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR9A\00"
define i8* @U_WMR9A_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR9A\00"
define i8* @U_WMR9A_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void ADC0_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC0_RestoreConfig() {
ret void
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  {
    state[0UL] = input[0UL] + (unsigned short)2885;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      if (state[0UL] > local1) {
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + 371143069UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0xb45,%eax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzwl 0x2(%rcx),%ecx
cmp    %ecx,%eax
jge    115c <RandomFunc+0x5c>
movzwl -0x12(%rbp),%eax
movzwl -0x14(%rbp),%ecx
cmp    %ecx,%eax
jle    114b <RandomFunc+0x4b>
jmp    114b <RandomFunc+0x4b>
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1122 <RandomFunc+0x22>
movzwl -0x12(%rbp),%eax
add    $0x161f319d,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0x3ce2,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i64 0
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
%11 = add nsw i32 %10, 2885
%12 = trunc i32 %11 to i16
%13 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %12, i16* %13
store i16 0, i16* %6
br label %14
14: ; preds = %30, %2
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = load i16*, i16** %3
%18 = getelementptr inbounds i16, i16* %17, i64 1
%19 = load i16, i16* %18
%20 = zext i16 %19 to i32
%21 = icmp slt i32 %16, %20
br i1 %21, label %22, label %35
22: ; preds = %14
%23 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%24 = load i16, i16* %23
%25 = zext i16 %24 to i32
%26 = load i16, i16* %6
%27 = zext i16 %26 to i32
%28 = icmp sgt i32 %25, %27
br i1 %28, label %29, label %30
29: ; preds = %22
br label %30
30: ; preds = %29, %22
%31 = load i16, i16* %6
%32 = zext i16 %31 to i64
%33 = add i64 %32, 2
%34 = trunc i64 %33 to i16
store i16 %34, i16* %6
br label %14
35: ; preds = %14
%36 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%37 = load i16, i16* %36
%38 = zext i16 %37 to i64
%39 = add i64 %38, 371143069
%40 = trunc i64 %39 to i16
%41 = load i16*, i16** %4
%42 = getelementptr inbounds i16, i16* %41, i64 0
store i16 %40, i16* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, 15586
store i16 %4, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(size_t);
int /*<<< orphan*/ fc_fatal(char *);
void *malloc(size_t);
void *fc_malloc(size_t size) {
  assert(size);
  void *mem = malloc(size);
  if (!mem)
    fc_fatal("out of memory");
  return mem;
}


x86 assembly (clang, -O0):
<fc_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1169 <fc_malloc+0x39>
lea    0xe9c(%rip),%rdi
call   1040 <fc_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc_malloc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1155 <fc_malloc+0x25>
lea    0xeb0(%rip),%rdi
call   1040 <fc_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @fc_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @assert(i64 %4)
%6 = load i64, i64* %2
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = call i32 @fc_fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @fc_malloc(i64 %0) {
%2 = tail call i32 @assert(i64 %0)
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @fc_fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ mp_msg_set_level(int);
void mp_msg_init() { mp_msg_set_level(5); }


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

x86 assembly (clang, -O2):
<mp_msg_init>:
mov    $0x5,%edi
jmp    1030 <mp_msg_set_level@plt>

LLVM IR (-O0):
define void @mp_msg_init() {
%1 = call i32 @mp_msg_set_level(i32 5)
ret void
}

LLVM IR (-O2):
define void @mp_msg_init() {
%1 = tail call i32 @mp_msg_set_level(i32 5)
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ assert(int);
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t get_miliseconds() {
  struct timespec tp;
  assert(clock_gettime(CLOCK_MONOTONIC, &tp) == 0);
  return ((uint64_t)tp.tv_sec) * 1000 + tp.tv_nsec / 1000000;
}


x86 assembly (clang, -O0):
<get_miliseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_miliseconds>:
sub    $0x18,%rsp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
imul   $0x3e8,0x10(%rsp),%ecx
movslq 0x8(%rsp),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @get_miliseconds() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i64 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %9, 1000
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%12 = load i32, i32* %11
%13 = sdiv i32 %12, 1000000
%14 = add nsw i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i32 @get_miliseconds() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = mul nsw i32 %10, 1000
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%13 = load i32, i32* %12
%14 = sdiv i32 %13, 1000000
%15 = add nsw i32 %11, %14
ret i32 %15
}
void multiboot_main(void) {}


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

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

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

LLVM IR (-O2):
define void @multiboot_main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void(__attribute__((trapa_handler)) isr)(void) { foo(); }


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

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

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

LLVM IR (-O2):
define void @isr() {
%1 = tail call i32 (...) @foo()
ret void
}
int imin3(int a, int b, int c) {
  int ret = a;
  if (b < a)
    ret = b;
  if (c < a)
    ret = c;
  return ret;
}


x86 assembly (clang, -O0):
<imin3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1125 <imin3+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1137 <imin3+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imin3>:
mov    %esi,%eax
cmp    %edi,%esi
cmovge %edi,%eax
cmp    %edi,%edx
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @imin3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %2, %0
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
scalar_t__ getpid();
int /*<<< orphan*/ stderr;
void *thread_function(void *args) {
  fprintf(stderr, "child thread pid is: %d.\n", (int)getpid());
  while (1)
    ;
  return NULL;
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%edx
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1150 <thread_function+0x30>

x86 assembly (clang, -O2):
<thread_function>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec8(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1040 <fprintf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
jmp    1150 <thread_function+0x30>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"child thread pid is: %d.\0A\00"
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i64 (...) @getpid()
%5 = trunc i64 %4 to i32
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %1, %7
br label %7
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"child thread pid is: %d.\0A\00"
define noalias i8* @thread_function(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i64 (...) @getpid()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %1, %6
br label %6
}