xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ kputc(char const);
int knputs(void *dest, const char *str, int len) {
  int i;
  for (i = 0; i < len; ++i) {
    kputc(str[i]);
  }
  return len;
}


x86 assembly (clang, -O0):
<knputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1155 <knputs+0x45>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <kputc@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <knputs+0x1a>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<knputs>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
test   %edx,%edx
jle    1143 <knputs+0x33>
mov    %rsi,%r15
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <kputc@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <knputs+0x20>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @knputs(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %19, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @kputc(i8 signext %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
br label %8
22: ; preds = %8
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
define i32 @knputs(i8* nocapture readnone %0, i8* nocapture %1, i32 returned %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @kputc(i8 signext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
unsigned int pthread_get_thread_size() { return sizeof(pthread_t); }


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

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

LLVM IR (-O0):
define i32 @pthread_get_thread_size() {
ret i32 4
}

LLVM IR (-O2):
define i32 @pthread_get_thread_size() {
ret i32 4
}
/* Variables and functions */
size_t strcspn(char *, char *);
char *remove_newline(char *p) {
  p[strcspn(p, "\n")] = 0;
  return p;
}


x86 assembly (clang, -O0):
<remove_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strcspn@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_newline>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcspn@plt>
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i8* @remove_newline(i8* returned %0) {
%2 = tail call i64 @strcspn(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 %2
store i8 0, i8* %3
ret i8* %0
}
/* Variables and functions */
int pigpio_command(int, int, int, int /*<<< orphan*/, int);
int wave_get_high_micros(int pi) { return pigpio_command(pi, 34, 1, 0, 1); }


x86 assembly (clang, -O0):
<wave_get_high_micros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x22,%esi
mov    $0x1,%r8d
xor    %ecx,%ecx
mov    %r8d,%edx
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_get_high_micros>:
mov    $0x22,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @wave_get_high_micros(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @pigpio_command(i32 %3, i32 34, i32 1, i32 0, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @wave_get_high_micros(i32 %0) {
%2 = tail call i32 @pigpio_command(i32 %0, i32 34, i32 1, i32 0, i32 1)
ret i32 %2
}
int rl_create_signal(const char *signal_name) { return 7; }


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

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

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

LLVM IR (-O2):
define i32 @rl_create_signal(i8* nocapture readnone %0) {
ret i32 7
}
f_stdarg1(const char *s, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f_stdarg1(i8* nocapture readnone %0, ...) {
ret i32 0
}
int foo(int xxx) {
  int yyy = xxx + 3;
  int z = yyy + xxx;
  return z + xxx;
}


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

x86 assembly (clang, -O2):
<foo>:
lea    (%rdi,%rdi,2),%eax
add    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 3
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = load i32, i32* %2
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = shl i32 %0, 1
%3 = add i32 %0, 3
%4 = add i32 %3, %2
ret i32 %4
}
void XtIsVendorShell() {}


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

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

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

LLVM IR (-O2):
define void @XtIsVendorShell() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_empty();
int /*<<< orphan*/ test_exit();
int /*<<< orphan*/ test_local_continuation();
int /*<<< orphan*/ test_loop();
int /*<<< orphan*/ test_queues();
int /*<<< orphan*/ test_wait();
int /*<<< orphan*/ test_yield();
int main() {
  test_local_continuation();
  test_empty();
  test_wait();
  test_yield();
  test_exit();
  test_loop();
  test_queues();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_local_continuation@plt>
mov    $0x0,%al
call   1060 <test_empty@plt>
mov    $0x0,%al
call   1070 <test_wait@plt>
mov    $0x0,%al
call   1030 <test_yield@plt>
mov    $0x0,%al
call   1050 <test_exit@plt>
mov    $0x0,%al
call   1080 <test_loop@plt>
mov    $0x0,%al
call   1090 <test_queues@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_local_continuation@plt>
xor    %eax,%eax
call   1060 <test_empty@plt>
xor    %eax,%eax
call   1070 <test_wait@plt>
xor    %eax,%eax
call   1030 <test_yield@plt>
xor    %eax,%eax
call   1050 <test_exit@plt>
xor    %eax,%eax
call   1080 <test_loop@plt>
xor    %eax,%eax
call   1090 <test_queues@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_local_continuation()
%3 = call i32 (...) @test_empty()
%4 = call i32 (...) @test_wait()
%5 = call i32 (...) @test_yield()
%6 = call i32 (...) @test_exit()
%7 = call i32 (...) @test_loop()
%8 = call i32 (...) @test_queues()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_local_continuation()
%2 = tail call i32 (...) @test_empty()
%3 = tail call i32 (...) @test_wait()
%4 = tail call i32 (...) @test_yield()
%5 = tail call i32 (...) @test_exit()
%6 = tail call i32 (...) @test_loop()
%7 = tail call i32 (...) @test_queues()
ret i32 0
}
int main(void) {
  __asm__ __volatile__("finit");
  printf("fprem   %f\n", do_fprem());
  printf("fprem1  %f\n", do_fprem1());
  printf("fsincos %f\n", do_fsincos());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
finit
mov    $0x0,%al
call   1040 <do_fprem@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <do_fprem1@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <do_fsincos@plt>
mov    %eax,%esi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
finit
xor    %eax,%eax
call   1040 <do_fprem@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <do_fprem1@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1060 <do_fsincos@plt>
lea    0xe98(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"fprem %f\0A\00"
@.str.1 = [12 x i8] c"fprem1 %f\0A\00"
@.str.2 = [12 x i8] c"fsincos %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @do_fprem()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @do_fprem1()
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @do_fsincos()
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"fprem %f\0A\00"
@.str.1 = [12 x i8] c"fprem1 %f\0A\00"
@.str.2 = [12 x i8] c"fsincos %f\0A\00"
define i32 @main() {
tail call void asm sideeffect "finit", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @do_fprem()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @do_fprem1()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @do_fsincos()
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
unsigned xrop3_218_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S & D;
  stk3 = ~stk3;
  stk2 = T & stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_218_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_218_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %7
%29 = load i32, i32* %10
%30 = and i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %5
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %7
%39 = xor i32 %38, -1
%40 = and i32 %37, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %6
%43 = and i32 %41, %42
%44 = or i32 %40, %43
%45 = load i32, i32* %5
%46 = load i32, i32* %7
%47 = and i32 %45, %46
%48 = or i32 %44, %47
ret i32 %48
}

LLVM IR (-O2):
define i32 @xrop3_218_1_1(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
__attribute__((no_sanitize("undefined"))) unsigned char
blacklist_0(unsigned int src) {
  return src;
}


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

x86 assembly (clang, -O2):
<blacklist_0>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @blacklist_0(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
void UBCHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @UBCHandler() {
ret void
}
/* Variables and functions */
char *strip_whitesp(char *str) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @strip_whitesp(i8* nocapture readnone %0) {
ret i8* null
}
void convert_currency(double dollar, double *euro, double *rupees,
                      double *ruble, double *yen) {
  *euro = dollar * 0.731743012;
  ;
  *rupees = dollar * 61.5422488;
  ;
  *ruble = dollar * 31.9172704;
  ;
  *yen = dollar * 98.1739643;
  ;
}


x86 assembly (clang, -O0):
<convert_currency>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xeda(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xebd(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xea0(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_currency>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdi)
movsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
movsd  0xee8(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx)
mulsd  0xee0(%rip),%xmm0
movsd  %xmm0,(%rcx)
ret

LLVM IR (-O0):
define void @convert_currency(double %0, double* %1, double* %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store double %0, double* %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double, double* %6
%12 = fmul double %11, 0x3FE76A705233BAA9
%13 = load double*, double** %7
store double %12, double* %13
%14 = load double, double* %6
%15 = fmul double %14, 0x404EC568689F25CB
%16 = load double*, double** %8
store double %15, double* %16
%17 = load double, double* %6
%18 = fmul double %17, 0x403FEAD23BA196BE
%19 = load double*, double** %9
store double %18, double* %19
%20 = load double, double* %6
%21 = fmul double %20, 0x40588B223B28CAFA
%22 = load double*, double** %10
store double %21, double* %22
ret void
}

LLVM IR (-O2):
define void @convert_currency(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = fmul double %0, 0x3FE76A705233BAA9
store double %6, double* %1
%7 = fmul double %0, 0x404EC568689F25CB
store double %7, double* %2
%8 = fmul double %0, 0x403FEAD23BA196BE
store double %8, double* %3
%9 = fmul double %0, 0x40588B223B28CAFA
store double %9, double* %4
ret void
}
/* Variables and functions */
void *mem_alloc(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(void *, char const *);
int /*<<< orphan*/ strlen(char const *);
void *mem_alloc_str(const char *s) {
  void *p = mem_alloc(strlen(s));
  strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<mem_alloc_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
call   1050 <mem_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_alloc_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%edi
call   1050 <mem_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mem_alloc_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @mem_alloc(i32 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @mem_alloc_str(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @mem_alloc(i32 %2)
%4 = tail call i32 @strcpy(i8* %3, i8* %0)
ret i8* %3
}
unsigned bytes_for_bits(unsigned bits) {
  return ((bits & 1) + (bits >> 1) + 3) >> 2;
}


x86 assembly (clang, -O0):
<bytes_for_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
add    %ecx,%eax
add    $0x3,%eax
shr    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_for_bits>:
mov    %edi,%eax
and    $0x1,%eax
shr    %edi
add    %edi,%eax
add    $0x3,%eax
shr    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @bytes_for_bits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = add i32 %4, %6
%8 = add i32 %7, 3
%9 = lshr i32 %8, 2
ret i32 %9
}

LLVM IR (-O2):
define i32 @bytes_for_bits(i32 %0) {
%2 = and i32 %0, 1
%3 = lshr i32 %0, 1
%4 = add nuw i32 %3, 3
%5 = add nuw i32 %4, %2
%6 = lshr i32 %5, 2
ret i32 %6
}
void b_output(const char *str, unsigned long nbr) {
  asm volatile("call *0x00100018" : : "S"(str), "c"(nbr));
}


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

x86 assembly (clang, -O2):
<b_output>:
mov    %rsi,%rcx
mov    %rdi,%rsi
call   *0x100018
ret

LLVM IR (-O0):
define void @b_output(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @b_output(i8* %0, i64 %1) {
tail call void asm sideeffect "call *0x00100018", "{si},{cx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr, "Usage: 6rdcalc <v6 prefix>/<mask> <v4 address>/<mask>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"Usage: 6rdcalc <v6 prefix>/<mask> <v4 address>/<mask>\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"Usage: 6rdcalc <v6 prefix>/<mask> <v4 address>/<mask>\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
char *eol(char *p) {
  while (*p != '\n')
    p++;
  return (p);
}


x86 assembly (clang, -O0):
<eol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1129 <eol+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <eol+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eol>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0xa,0x1(%rax)
lea    0x1(%rax),%rax
jne    1110 <eol+0x10>
ret

LLVM IR (-O0):
define i8* @eol(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @eol(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 10
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i8* %3
}
int SNDWavReset(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @SNDWavReset() {
ret i32 0
}

LLVM IR (-O2):
define i32 @SNDWavReset() {
ret i32 0
}
void led_status_stopping(void) {}


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

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

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

LLVM IR (-O2):
define void @led_status_stopping() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void sig_wait(int signo) {
  wait(NULL);
  printf("catch %d\n", signo);
}


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

x86 assembly (clang, -O2):
<sig_wait>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <wait@plt>
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"catch %d\0A\00"
define void @sig_wait(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @wait(i32* null)
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"catch %d\0A\00"
define void @sig_wait(i32 %0) {
%2 = tail call i32 @wait(i32* null)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int pread(int, scalar_t__ *, int, int);
long long read_msr(int fd, int which) {
  uint64_t data;
  if (pread(fd, &data, sizeof data, which) != sizeof data) {
    perror("rdmsr:pread");
    exit(127);
  }
  return (long long)data;
}


x86 assembly (clang, -O0):
<read_msr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <pread@plt>
cltq
cmp    $0x8,%rax
je     1174 <read_msr+0x44>
lea    0xe9b(%rip),%rdi
call   1030 <perror@plt>
mov    $0x7f,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_msr>:
push   %rax
mov    %esi,%ecx
mov    %rsp,%rsi
mov    $0x8,%edx
call   1040 <pread@plt>
cmp    $0x8,%eax
jne    114b <read_msr+0x1b>
mov    (%rsp),%rax
pop    %rcx
ret
lea    0xeae(%rip),%rdi
call   1030 <perror@plt>
mov    $0x7f,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"rdmsr:pread\00"
define i64 @read_msr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @pread(i32 %6, i64* %5, i32 8, i32 %7)
%9 = sext i32 %8 to i64
%10 = icmp ne i64 %9, 8
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 127)
unreachable
14: ; preds = %2
%15 = load i64, i64* %5
ret i64 %15
}

LLVM IR (-O2):
@.str = [12 x i8] c"rdmsr:pread\00"
define i64 @read_msr(i32 %0, i32 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @pread(i32 %0, i64* %3, i32 8, i32 %1)
%6 = icmp eq i32 %5, 8
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 127)
unreachable
10: ; preds = %2
%11 = load i64, i64* %3
ret i64 %11
}
/* Variables and functions */
int mcb_resize(int, int);
int mem_resize_segment(int seg, int size) { return mcb_resize(seg - 1, size); }


x86 assembly (clang, -O0):
<mem_resize_segment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1030 <mcb_resize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_resize_segment>:
add    $0xffffffff,%edi
jmp    1030 <mcb_resize@plt>

LLVM IR (-O0):
define i32 @mem_resize_segment(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sub nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = call i32 @mcb_resize(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @mem_resize_segment(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = tail call i32 @mcb_resize(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int strcmp(char *, char *);
void strcmp_1() {
  char *x = "234";
  char *y = "123";
  if (strcmp(x, y) != 1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strcmp_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x1,%eax
je     1144 <strcmp_1+0x34>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"234\00"
@.str.1 = [4 x i8] c"123\00"
define void @strcmp_1() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strcmp(i8* %3, i8* %4)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @strcmp_1() {
ret void
}
/* Variables and functions */
double average(int, double, double, double, ...);
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("%f\n", average(3, 12.2, 22.3, 4.5));
  printf("%f\n", average(5, 3.3, 2.2, 1.1, 5.5, 3.3));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
movsd  0xeef(%rip),%xmm0
movsd  0xeef(%rip),%xmm1
movsd  0xeef(%rip),%xmm2
mov    $0x3,%al
call   1040 <average@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
movsd  0xe9f(%rip),%xmm4
movsd  0xe9f(%rip),%xmm1
movsd  0xe9f(%rip),%xmm2
movsd  0xe9f(%rip),%xmm3
movaps %xmm4,%xmm0
mov    $0x5,%al
call   1040 <average@plt>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
movsd  0xed7(%rip),%xmm2
mov    $0x3,%edi
mov    $0x3,%al
call   1040 <average@plt>
lea    0xeec(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xebc(%rip),%xmm1
movsd  0xebc(%rip),%xmm2
movsd  0xebc(%rip),%xmm3
movsd  0xebc(%rip),%xmm0
mov    $0x5,%edi
movaps %xmm0,%xmm4
mov    $0x5,%al
call   1040 <average@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = call double (i32, double, double, double, ...) @average(i32 3, double 1.220000e+01, double 2.230000e+01, double 4.500000e+00)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
%3 = call double (i32, double, double, double, ...) @average(i32 5, double 3.300000e+00, double 2.200000e+00, double 1.100000e+00, double 5.500000e+00, double 3.300000e+00)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call double (i32, double, double, double, ...) @average(i32 3, double 1.220000e+01, double 2.230000e+01, double 4.500000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double (i32, double, double, double, ...) @average(i32 5, double 3.300000e+00, double 2.200000e+00, double 1.100000e+00, double 5.500000e+00, double 3.300000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check_ptrs(void const *, void const *, char *);
void check_ptr(const void *actual, const void *expected) {
  check_ptrs(actual, expected, "");
}


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

x86 assembly (clang, -O2):
<check_ptr>:
lea    0xee9(%rip),%rdx
jmp    1030 <check_ptrs@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @check_ptr(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 @check_ptrs(i8* %5, i8* %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @check_ptr(i8* %0, i8* %1) {
%3 = tail call i32 @check_ptrs(i8* %0, i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void EPIIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  ;
  ;
  IntRegister(69, pfnHandler);
  IntEnable(69);
}


x86 assembly (clang, -O0):
<EPIIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x45,%edi
call   1040 <IntRegister@plt>
mov    $0x45,%edi
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIIntRegister>:
push   %rax
mov    $0x45,%edi
call   1040 <IntRegister@plt>
mov    $0x45,%edi
pop    %rax
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @EPIIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%5 = load void ()*, void ()** %4
%6 = bitcast void ()* %5 to void (...)*
%7 = call i32 @IntRegister(i32 69, void (...)* %6)
%8 = call i32 @IntEnable(i32 69)
ret void
}

LLVM IR (-O2):
define void @EPIIntRegister(i64 %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @IntRegister(i32 69, void (...)* %3)
%5 = tail call i32 @IntEnable(i32 69)
ret void
}
int coordinatesAreInsideBoard(int x, int y) {
  return x >= 0 && x < 26 && y >= 0 && y < 6;
}


x86 assembly (clang, -O0):
<coordinatesAreInsideBoard>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <coordinatesAreInsideBoard+0x41>
xor    %eax,%eax
cmpl   $0x1a,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jge    1141 <coordinatesAreInsideBoard+0x41>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <coordinatesAreInsideBoard+0x41>
cmpl   $0x6,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<coordinatesAreInsideBoard>:
cmp    $0x1a,%edi
setb   %al
cmp    $0x6,%esi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @coordinatesAreInsideBoard(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 26
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 6
br label %16
16: ; preds = %13, %10, %7, %2
%17 = phi i1 [ false, %10 ], [ false, %7 ], [ false, %2 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @coordinatesAreInsideBoard(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 26
%4 = icmp ult i32 %1, 6
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memcpy(char *, char const *, long);
char *safe_malloc(long);
char *_lexer_grab_text(const char *inSource, long inLength) {
  assert(inSource != NULL);
  assert(inLength >= 0);
  char *out_text;
  out_text = safe_malloc(inLength + 1);
  memcpy(out_text, inSource, inLength);
  out_text[inLength] = 0;
  return out_text;
}


x86 assembly (clang, -O0):
<_lexer_grab_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <safe_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lexer_grab_text>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
mov    %r15,%rdi
shr    $0x3f,%rdi
xor    $0x1,%edi
call   1040 <assert@plt>
lea    0x1(%r15),%rdi
call   1030 <safe_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @_lexer_grab_text(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i64, i64* %4
%11 = icmp sge i64 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i64, i64* %4
%15 = add nsw i64 %14, 1
%16 = call i8* @safe_malloc(i64 %15)
store i8* %16, i8** %5
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = load i64, i64* %4
%20 = call i32 @memcpy(i8* %17, i8* %18, i64 %19)
%21 = load i8*, i8** %5
%22 = load i64, i64* %4
%23 = getelementptr inbounds i8, i8* %21, i64 %22
store i8 0, i8* %23
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @_lexer_grab_text(i8* %0, i64 %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = lshr i64 %1, 63
%7 = trunc i64 %6 to i32
%8 = xor i32 %7, 1
%9 = tail call i32 @assert(i32 %8)
%10 = add nsw i64 %1, 1
%11 = tail call i8* @safe_malloc(i64 %10)
%12 = tail call i32 @memcpy(i8* %11, i8* %0, i64 %1)
%13 = getelementptr inbounds i8, i8* %11, i64 %1
store i8 0, i8* %13
ret i8* %11
}
/* Variables and functions */
void *_sbrk(int);
void *sbrk(int n) { return _sbrk(n); }


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

x86 assembly (clang, -O2):
<sbrk>:
jmp    1030 <_sbrk@plt>

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

LLVM IR (-O2):
define i8* @sbrk(i32 %0) {
%2 = tail call i8* @_sbrk(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  printf("\n Vavedi a:");
  scanf("%d", &a);
  printf("%d\n%d", a * a, a * a * a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"\0A Vavedi a:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"%d\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, %5
%7 = mul nsw i32 %6, %5
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ comportement_philosophe(int);
int /*<<< orphan*/ fin_tache();
void tache_philosophe2(void) {
  comportement_philosophe(2);
  fin_tache();
}


x86 assembly (clang, -O0):
<tache_philosophe2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <comportement_philosophe@plt>
mov    $0x0,%al
call   1030 <fin_tache@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tache_philosophe2>:
push   %rax
mov    $0x2,%edi
call   1040 <comportement_philosophe@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <fin_tache@plt>

LLVM IR (-O0):
define void @tache_philosophe2() {
%1 = call i32 @comportement_philosophe(i32 2)
%2 = call i32 (...) @fin_tache()
ret void
}

LLVM IR (-O2):
define void @tache_philosophe2() {
%1 = tail call i32 @comportement_philosophe(i32 2)
%2 = tail call i32 (...) @fin_tache()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, scalar_t__);
void concat_rpn(char *str, char *exp) {
  if (strlen(str) > 0)
    strcat(str, " ");
  strncat(str, exp, strlen(exp));
}


x86 assembly (clang, -O0):
<concat_rpn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    1163 <concat_rpn+0x33>
mov    -0x8(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
call   1040 <strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat_rpn>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
jle    1153 <concat_rpn+0x23>
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strncat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @concat_rpn(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 = call i64 @strlen(i8* %5)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %2
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = load i8*, i8** %4
%15 = call i64 @strlen(i8* %14)
%16 = call i32 @strncat(i8* %12, i8* %13, i64 %15)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @concat_rpn(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%9 = tail call i32 @strncat(i8* %0, i8* %1, i64 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ResizeTrans(int);
void InitTrans() { ResizeTrans(128); }


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

x86 assembly (clang, -O2):
<InitTrans>:
mov    $0x80,%edi
jmp    1030 <ResizeTrans@plt>

LLVM IR (-O0):
define void @InitTrans() {
%1 = call i32 @ResizeTrans(i32 128)
ret void
}

LLVM IR (-O2):
define void @InitTrans() {
%1 = tail call i32 @ResizeTrans(i32 128)
ret void
}
/* Variables and functions */
char getTexChar();
char getNonBlank(void) {
  char c;
  c = getTexChar();
  while (c == ' ' || c == '\n') {
    c = getTexChar();
  }
  return c;
}


x86 assembly (clang, -O0):
<getNonBlank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getTexChar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1141 <getNonBlank+0x31>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1151 <getNonBlank+0x41>
jmp    1160 <getNonBlank+0x50>
mov    $0x0,%al
call   1030 <getTexChar@plt>
mov    %al,-0x1(%rbp)
jmp    1122 <getNonBlank+0x12>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNonBlank>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getTexChar@plt>
cmp    $0xa,%al
je     1120 <getNonBlank+0x10>
cmp    $0x20,%al
je     1120 <getNonBlank+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @getNonBlank() {
%1 = alloca i8
%2 = call signext i8 (...) @getTexChar()
store i8 %2, i8* %1
br label %3
3: ; preds = %13, %0
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 10
br label %11
11: ; preds = %7, %3
%12 = phi i1 [ true, %3 ], [ %10, %7 ]
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = call signext i8 (...) @getTexChar()
store i8 %14, i8* %1
br label %3
15: ; preds = %11
%16 = load i8, i8* %1
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @getNonBlank() {
br label %1
1: ; preds = %3, %0
%2 = tail call signext i8 (...) @getTexChar()
switch i8 %2, label %4 [
i8 32, label %3
i8 10, label %3
]
3: ; preds = %1, %1
br label %1
4: ; preds = %1
ret i8 %2
}
unsigned int nth_position(unsigned int num, int position) {
  return ((num >> position) & 7);
}


x86 assembly (clang, -O0):
<nth_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_position>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @nth_position(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = lshr i32 %5, %6
%8 = and i32 %7, 7
ret i32 %8
}

LLVM IR (-O2):
define i32 @nth_position(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 7
ret i32 %4
}