xunge/DecIR huggingface dataset:
/* Variables and functions */
char *dynamicLibraryAFunction();
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *dynamicLibraryBFunction() {
  static char buffer[256];
  sprintf(buffer, "FromDynamicLibraryB, but also calling '%s'",
          dynamicLibraryAFunction());
  return buffer;
}


x86 assembly (clang, -O0):
<dynamicLibraryBFunction>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dynamicLibraryAFunction@plt>
mov    %rax,%rdx
lea    0x2f0b(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ef8(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynamicLibraryBFunction>:
push   %rbx
xor    %eax,%eax
call   1030 <dynamicLibraryAFunction@plt>
lea    0x2f11(%rip),%rbx
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@dynamicLibraryBFunction.buffer = internal global [256 x i8] zeroinitializer
@.str = [43 x i8] c"FromDynamicLibraryB, but also calling '%s'\00"
define i8* @dynamicLibraryBFunction() {
%1 = call i8* (...) @dynamicLibraryAFunction()
%2 = call i32 @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @dynamicLibraryBFunction.buffer, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @dynamicLibraryBFunction.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@dynamicLibraryBFunction.buffer = internal global [256 x i8] zeroinitializer
@.str = [43 x i8] c"FromDynamicLibraryB, but also calling '%s'\00"
define i8* @dynamicLibraryBFunction() {
%1 = tail call i8* (...) @dynamicLibraryAFunction()
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @dynamicLibraryBFunction.buffer, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @dynamicLibraryBFunction.buffer, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p521_add(uintptr_t, uintptr_t, uintptr_t);
void fiat_p521_add(uint64_t out1[9], const uint64_t arg1[9],
                   const uint64_t arg2[9]) {
  internal_fiat_p521_add((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_p521_add>:
jmp    1030 <internal_fiat_p521_add@plt>

LLVM IR (-O0):
define void @fiat_p521_add(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 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p521_add(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p521_add(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p521_add(i64 %4, i64 %5, i64 %6)
ret void
}
void csv_change_color(double perct) {}


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

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

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

LLVM IR (-O2):
define void @csv_change_color(double %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show(int);
void dont_look_at_this_either() {
  int c = 5;
  int v[c][2 * c];
  show(c);
  show(sizeof ++c);
  show(c);
  show(sizeof v[++c]);
  show(c);
}


x86 assembly (clang, -O0):
<dont_look_at_this_either>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %ecx,%eax
add    %eax,%eax
mov    %rax,-0x28(%rbp)
mov    %rsp,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,%rdx
imul   %rax,%rdx
lea    0xf(,%rdx,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,%rsp
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <show@plt>
mov    $0x4,%edi
call   1030 <show@plt>
mov    -0x4(%rbp),%edi
call   1030 <show@plt>
mov    -0x28(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <show@plt>
mov    -0x4(%rbp),%edi
call   1030 <show@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dont_look_at_this_either>:
push   %rax
mov    $0x5,%edi
call   1030 <show@plt>
mov    $0x4,%edi
call   1030 <show@plt>
mov    $0x5,%edi
call   1030 <show@plt>
mov    $0x28,%edi
call   1030 <show@plt>
mov    $0x6,%edi
pop    %rax
jmp    1030 <show@plt>

LLVM IR (-O0):
define void @dont_look_at_this_either() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i32 5, i32* %1
%5 = load i32, i32* %1
%6 = zext i32 %5 to i64
%7 = load i32, i32* %1
%8 = mul nsw i32 2, %7
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %2
%11 = mul nuw i64 %6, %9
%12 = alloca i32, i64 %11
store i64 %6, i64* %3
store i64 %9, i64* %4
%13 = load i32, i32* %1
%14 = call i32 @show(i32 %13)
%15 = call i32 @show(i32 4)
%16 = load i32, i32* %1
%17 = call i32 @show(i32 %16)
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
%20 = sext i32 %19 to i64
%21 = mul nsw i64 %20, %9
%22 = getelementptr inbounds i32, i32* %12, i64 %21
%23 = mul nuw i64 4, %9
%24 = trunc i64 %23 to i32
%25 = call i32 @show(i32 %24)
%26 = load i32, i32* %1
%27 = call i32 @show(i32 %26)
%28 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @dont_look_at_this_either() {
%1 = tail call i32 @show(i32 5)
%2 = tail call i32 @show(i32 4)
%3 = tail call i32 @show(i32 5)
%4 = tail call i32 @show(i32 40)
%5 = tail call i32 @show(i32 6)
ret void
}
/* Variables and functions */
int gfx_set_video_upscale(unsigned short, unsigned short, unsigned short,
                          unsigned short);
int gfx_set_video_scale(unsigned short srcw, unsigned short srch,
                        unsigned short dstw, unsigned short dsth) {
  return gfx_set_video_upscale(srcw, srch, dstw, dsth);
}


x86 assembly (clang, -O0):
<gfx_set_video_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x4(%rbp),%cx
mov    -0x6(%rbp),%ax
movzwl %dx,%edi
movzwl %cx,%esi
movzwl %ax,%edx
movzwl -0x8(%rbp),%ecx
call   1030 <gfx_set_video_upscale@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfx_set_video_scale>:
jmp    1030 <gfx_set_video_upscale@plt>

LLVM IR (-O0):
define i32 @gfx_set_video_scale(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = load i16, i16* %5
%10 = load i16, i16* %6
%11 = load i16, i16* %7
%12 = load i16, i16* %8
%13 = call i32 @gfx_set_video_upscale(i16 zeroext %9, i16 zeroext %10, i16 zeroext %11, i16 zeroext %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @gfx_set_video_scale(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = tail call i32 @gfx_set_video_upscale(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ aX_wait_event(int);
void aX_look_events(void) { aX_wait_event(-1); }


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

x86 assembly (clang, -O2):
<aX_look_events>:
mov    $0xffffffff,%edi
jmp    1030 <aX_wait_event@plt>

LLVM IR (-O0):
define void @aX_look_events() {
%1 = call i32 @aX_wait_event(i32 -1)
ret void
}

LLVM IR (-O2):
define void @aX_look_events() {
%1 = tail call i32 @aX_wait_event(i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int *permalloc(void) {
  int i;
  int *perm;
  perm = ((int *)malloc((256 + 1) * sizeof(int)));
  if (perm == 0) {
    printf("\nNo room to allocate permutation.\n");
    exit(0);
  }
  for (i = 0; i < 256; i++) {
    perm[i] = -1;
  }
  return (perm);
}


x86 assembly (clang, -O0):
<permalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x404,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <permalloc+0x34>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1195 <permalloc+0x65>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <permalloc+0x3b>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<permalloc>:
push   %rbx
mov    $0x404,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     116a <permalloc+0x2a>
mov    %rax,%rbx
mov    $0x400,%edx
mov    %rax,%rdi
mov    $0xff,%esi
call   1040 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"\0ANo room to allocate permutation.\0A\00"
define i32* @permalloc() {
%1 = alloca i32
%2 = alloca i32*
%3 = call i64 @malloc(i32 1028)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %19, %10
%12 = load i32, i32* %1
%13 = icmp slt i32 %12, 256
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i32*, i32** %2
%16 = load i32, i32* %1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
store i32 -1, i32* %18
br label %19
19: ; preds = %14
%20 = load i32, i32* %1
%21 = add nsw i32 %20, 1
store i32 %21, i32* %1
br label %11
22: ; preds = %11
%23 = load i32*, i32** %2
ret i32* %23
}

LLVM IR (-O2):
@str = [34 x i8] c"\0ANo room to allocate permutation.\00"
define i32* @permalloc() {
%1 = tail call i64 @malloc(i32 1028)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = inttoptr i64 %1 to i32*
%5 = inttoptr i64 %1 to i8*
ret i32* %4
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
fgt(x) long long int x;
{
  if (x > 0)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<fgt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    111f <fgt+0x1f>
movl   $0xd,-0x4(%rbp)
jmp    1126 <fgt+0x26>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgt>:
test   %rdi,%rdi
mov    $0xd,%ecx
mov    $0x8c,%eax
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fgt(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 13, i32* %2
br label %8
7: ; preds = %1
store i32 140, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @fgt(i64 %0) {
%2 = icmp sgt i64 %0, 0
%3 = select i1 %2, i32 13, i32 140
ret i32 %3
}
/* Type definitions */
struct _stor_fstat_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _stor_fstat_req *);
void stor_fstat_req_free(struct _stor_fstat_req *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<stor_fstat_req_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct._stor_fstat_req = type { i32 }
define void @stor_fstat_req_free(%struct._stor_fstat_req* %0) {
%2 = alloca %struct._stor_fstat_req*
store %struct._stor_fstat_req* %0, %struct._stor_fstat_req** %2
%3 = load %struct._stor_fstat_req*, %struct._stor_fstat_req** %2
%4 = call i32 @free(%struct._stor_fstat_req* %3)
ret void
}

LLVM IR (-O2):
%struct._stor_fstat_req = type { i32 }
define void @stor_fstat_req_free(%struct._stor_fstat_req* nocapture %0) {
%2 = tail call i32 @free(%struct._stor_fstat_req* %0)
ret void
}
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *, char const *);
void __func_add_sint(struct Var *avar, const char *areg, const char *lreg,
                     const char *rreg) {
  pA("%s = %s + %s;", areg, lreg, rreg);
}


x86 assembly (clang, -O0):
<__func_add_sint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xec5(%rip),%rdi
call   1030 <pA@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s + %s;\00"
define void @__func_add_sint(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s + %s;\00"
define void @__func_add_sint(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret void
}
int prevent_get() { return 1; }


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

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

LLVM IR (-O0):
define i32 @prevent_get() {
ret i32 1
}

LLVM IR (-O2):
define i32 @prevent_get() {
ret i32 1
}
/* Variables and functions */
scalar_t__ asin(float);
float n_asin(float x) {
  if (x > 1.0f)
    x = 1.0f;
  if (x < -1.0f)
    x = -1.0f;
  return (float)asin(x);
}


x86 assembly (clang, -O0):
<n_asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1140 <n_asin+0x30>
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xebc(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    115f <n_asin+0x4f>
movss  0xeaa(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <asin@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_asin>:
push   %rax
movss  0xee7(%rip),%xmm1
minss  %xmm0,%xmm1
movss  0xedf(%rip),%xmm0
maxss  %xmm1,%xmm0
call   1030 <asin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @n_asin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 1.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
store float 1.000000e+00, float* %2
br label %6
6: ; preds = %5, %1
%7 = load float, float* %2
%8 = fcmp olt float %7, -1.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
store float -1.000000e+00, float* %2
br label %10
10: ; preds = %9, %6
%11 = load float, float* %2
%12 = call i64 @asin(float %11)
%13 = sitofp i64 %12 to float
ret float %13
}

LLVM IR (-O2):
define float @n_asin(float %0) {
%2 = fcmp ogt float %0, 1.000000e+00
%3 = select i1 %2, float 1.000000e+00, float %0
%4 = fcmp olt float %3, -1.000000e+00
%5 = select i1 %4, float -1.000000e+00, float %3
%6 = tail call i64 @asin(float %5)
%7 = sitofp i64 %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ mouse_wait(int);
int /*<<< orphan*/ outb(int, unsigned char);
void mouse_write(unsigned char a_write) {
  mouse_wait(1);
  outb(0x64, 0xD4);
  mouse_wait(1);
  outb(0x60, a_write);
}


x86 assembly (clang, -O0):
<mouse_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
call   1030 <mouse_wait@plt>
mov    $0x64,%edi
mov    $0xd4,%esi
call   1040 <outb@plt>
mov    $0x1,%edi
call   1030 <mouse_wait@plt>
mov    $0x60,%edi
movzbl -0x1(%rbp),%esi
call   1040 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mouse_write>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <mouse_wait@plt>
mov    $0x64,%edi
mov    $0xd4,%esi
call   1040 <outb@plt>
mov    $0x1,%edi
call   1030 <mouse_wait@plt>
mov    $0x60,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <outb@plt>

LLVM IR (-O0):
define void @mouse_write(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @mouse_wait(i32 1)
%4 = call i32 @outb(i32 100, i8 zeroext -44)
%5 = call i32 @mouse_wait(i32 1)
%6 = load i8, i8* %2
%7 = call i32 @outb(i32 96, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @mouse_write(i8 zeroext %0) {
%2 = tail call i32 @mouse_wait(i32 1)
%3 = tail call i32 @outb(i32 100, i8 zeroext -44)
%4 = tail call i32 @mouse_wait(i32 1)
%5 = tail call i32 @outb(i32 96, i8 zeroext %0)
ret void
}
void HideCursor(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ buffer_splice(struct buffer *, struct buffer const *,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
void buffer_clone(struct buffer *dest, const struct buffer *src) {
  buffer_splice(dest, src, 0, 0);
}


x86 assembly (clang, -O0):
<buffer_clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <buffer_splice@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_clone>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <buffer_splice@plt>

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

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_clone(%struct.buffer* %0, %struct.buffer* %1) {
%3 = tail call i32 @buffer_splice(%struct.buffer* %0, %struct.buffer* %1, i32 0, i32 0)
ret void
}
__attribute__((always_)) void
native_flush_tlb_others(const struct cpumask *cpumask, struct mm_struct *mm,
                        unsigned long va) {}


x86 assembly (clang, -O0):
<native_flush_tlb_others>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cpumask = type opaque
%struct.mm_struct = type opaque
define void @native_flush_tlb_others(%struct.cpumask* %0, %struct.mm_struct* %1, i64 %2) {
%4 = alloca %struct.cpumask*
%5 = alloca %struct.mm_struct*
%6 = alloca i64
store %struct.cpumask* %0, %struct.cpumask** %4
store %struct.mm_struct* %1, %struct.mm_struct** %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
%struct.cpumask = type opaque
%struct.mm_struct = type opaque
define void @native_flush_tlb_others(%struct.cpumask* nocapture %0, %struct.mm_struct* nocapture %1, i64 %2) {
ret void
}
int isonum_731(unsigned char *p) {
  return ((p[0] & 0xff) | ((p[1] & 0xff) << 8) | ((p[2] & 0xff) << 16) |
          ((p[3] & 0xff) << 24));
}


x86 assembly (clang, -O0):
<isonum_731>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isonum_731>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @isonum_731(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 255
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, 255
%13 = shl i32 %12, 8
%14 = or i32 %7, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = and i32 %18, 255
%20 = shl i32 %19, 16
%21 = or i32 %14, %20
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 3
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = and i32 %25, 255
%27 = shl i32 %26, 24
%28 = or i32 %21, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @isonum_731(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ add(double *, double *, double *, int);
void matrix_add(double **Z, double **X, double **Y, int n, int m) {
  add(Z[0], X[0], Y[0], n * m);
}


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

x86 assembly (clang, -O2):
<matrix_add>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
mov    (%rdx),%rdx
imul   %r8d,%ecx
jmp    1030 <add@plt>

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

LLVM IR (-O2):
define void @matrix_add(double** nocapture %0, double** nocapture %1, double** nocapture %2, i32 %3, i32 %4) {
%6 = load double*, double** %0
%7 = load double*, double** %1
%8 = load double*, double** %2
%9 = mul nsw i32 %4, %3
%10 = tail call i32 @add(double* %6, double* %7, double* %8, i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
int pkey_custom_param_check(EVP_PKEY *pkey) { return 0xbeef; }


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

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

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

LLVM IR (-O2):
define i32 @pkey_custom_param_check(i32* nocapture readnone %0) {
ret i32 48879
}
/* Variables and functions */
float atanf(float);
float cbuiltin_arctanf(float x) { return atanf(x); }


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

x86 assembly (clang, -O2):
<cbuiltin_arctanf>:
jmp    1030 <atanf@plt>

LLVM IR (-O0):
define float @cbuiltin_arctanf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @atanf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @cbuiltin_arctanf(float %0) {
%2 = tail call float @atanf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ InlineWords(int, int, int);
void DoMinRot(void) { InlineWords(2, 19, 19); }


x86 assembly (clang, -O0):
<DoMinRot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x13,%edx
mov    %edx,%esi
call   1030 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoMinRot>:
mov    $0x2,%edi
mov    $0x13,%esi
mov    $0x13,%edx
jmp    1030 <InlineWords@plt>

LLVM IR (-O0):
define void @DoMinRot() {
%1 = call i32 @InlineWords(i32 2, i32 19, i32 19)
ret void
}

LLVM IR (-O2):
define void @DoMinRot() {
%1 = tail call i32 @InlineWords(i32 2, i32 19, i32 19)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_banner() {
  printf(
      "MiniUnz 0.15, demo of zLib + Unz package written by Gilles Vollant\n");
  printf("more info at http://wwww.winimage/zLibDll/unzip.htm\n\n");
}


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

x86 assembly (clang, -O2):
<do_banner>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"MiniUnz 0.15, demo of zLib + Unz package written by Gilles Vollant\0A\00"
@.str.1 = [54 x i8] c"more info at http://wwww.winimage/zLibDll/unzip.htm\0A\0A\00"
define void @do_banner() {
%1 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [67 x i8] c"MiniUnz 0.15, demo of zLib + Unz package written by Gilles Vollant\00"
@str.2 = [53 x i8] c"more info at http://wwww.winimage/zLibDll/unzip.htm\0A\00"
define void @do_banner() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, size_t);
char *alloc_string(size_t size) {
  char *ns = (char *)malloc(size * sizeof(char));
  if (ns != NULL) {
    memset(ns, 0, size);
  }
  return ns;
}


x86 assembly (clang, -O0):
<alloc_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0x0,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1157 <alloc_string+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <alloc_string+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @alloc_string(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 %4, 1
%6 = call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i64, i64* %2
%13 = call i32 @memset(i8* %11, i32 0, i64 %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @alloc_string(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @memset(i8* %3, i32 0, i64 %0)
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ shutdown(int, int /*<<< orphan*/);
void closeAndShutdownSocket(int socketFd) {
  if (socketFd != -1) {
    if (0)
      printf("socket_linux.c: call shutdown for %i!\n", socketFd);
    shutdown(socketFd, SHUT_RDWR);
    close(socketFd);
  }
}


x86 assembly (clang, -O0):
<closeAndShutdownSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     114e <closeAndShutdownSocket+0x2e>
mov    -0x4(%rbp),%edi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeAndShutdownSocket>:
cmp    $0xffffffff,%edi
je     113e <closeAndShutdownSocket+0x1e>
push   %rbx
mov    %edi,%ebx
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>
ret

LLVM IR (-O0):
@SHUT_RDWR = global i32 0
define void @closeAndShutdownSocket(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, -1
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* @SHUT_RDWR
%8 = call i32 @shutdown(i32 %6, i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @close(i32 %9)
br label %11
11: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@SHUT_RDWR = global i32 0
define void @closeAndShutdownSocket(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i32, i32* @SHUT_RDWR
%5 = tail call i32 @shutdown(i32 %0, i32 %4)
%6 = tail call i32 @close(i32 %0)
br label %7
7: ; preds = %3, %1
ret void
}
void nanos_red_0x2584520_380301290(int *const omp_out, int *const omp_in) {
  (*omp_out) += (*omp_in);
}


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

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

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

LLVM IR (-O2):
define void @nanos_red_0x2584520_380301290(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = add nsw i32 %4, %3
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void showusage(int argc, char **argv) {
  printf("Usage: %s <interface> <target1-ip> <target1-mac> <target2-ip> "
         "<target2-mac> [<replacement-file> [<log-file>]]\n\nExample:\n%s "
         "wlan0 192.168.1.1 12:23:34:45:56:67 192.168.1.42 11:22:33:44:55:66 "
         "replace.txt log.txt\n%s wlan0 192.168.1.1 12:23:34:45:56:67 "
         "192.168.1.42 11:22:33:44:55:66 - /dev/stdout\n",
         argv[0], argv[0], argv[0]);
  exit(1);
}


x86 assembly (clang, -O0):
<showusage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<showusage>:
push   %rax
mov    (%rsi),%rcx
lea    0xed5(%rip),%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [295 x i8] c"Usage: %s <interface> <target1-ip> <target1-mac> <target2-ip> <target2-mac> [<replacement-file> [<log-file>]]\0A\0AExample:\0A%s wlan0 192.168.1.1 12:23:34:45:56:67 192.168.1.42 11:22:33:44:55:66 replace.txt log.txt\0A%s wlan0 192.168.1.1 12:23:34:45:56:67 192.168.1.42 11:22:33:44:55:66 - /dev/stdout\0A\00"
define void @showusage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @printf(i8* getelementptr inbounds ([295 x i8], [295 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %10, i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [295 x i8] c"Usage: %s <interface> <target1-ip> <target1-mac> <target2-ip> <target2-mac> [<replacement-file> [<log-file>]]\0A\0AExample:\0A%s wlan0 192.168.1.1 12:23:34:45:56:67 192.168.1.42 11:22:33:44:55:66 replace.txt log.txt\0A%s wlan0 192.168.1.1 12:23:34:45:56:67 192.168.1.42 11:22:33:44:55:66 - /dev/stdout\0A\00"
define void @showusage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([295 x i8], [295 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %3, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void handle_signal(int no) { _exit(128 + no); }


x86 assembly (clang, -O0):
<handle_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x80,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<handle_signal>:
push   %rax
sub    $0xffffff80,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @handle_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 128, %3
%5 = call i32 @_exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @handle_signal(i32 %0) {
%2 = add nsw i32 %0, 128
%3 = tail call i32 @_exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("lets go");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [8 x i8] c"lets go\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"lets go\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void Blue() { printf(" Hello from Blue!\n"); }


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c" Hello from Blue!\00"
define void @Blue() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void CalibrateTouchPane(void) {
  SendChar((0XEE) & 0xFF);
  SendChar((0x72) & 0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<CalibrateTouchPane>:
push   %rbp
mov    %rsp,%rbp
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x72,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalibrateTouchPane>:
push   %rax
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x72,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
pop    %rax
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @CalibrateTouchPane() {
%1 = call i32 @SendChar(i32 238)
%2 = call i32 @SendChar(i32 114)
%3 = call i32 @SendChar(i32 255)
%4 = call i32 @SendChar(i32 252)
%5 = call i32 @SendChar(i32 255)
%6 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @CalibrateTouchPane() {
%1 = tail call i32 @SendChar(i32 238)
%2 = tail call i32 @SendChar(i32 114)
%3 = tail call i32 @SendChar(i32 255)
%4 = tail call i32 @SendChar(i32 252)
%5 = tail call i32 @SendChar(i32 255)
%6 = tail call i32 @SendChar(i32 255)
ret void
}
/* Variables and functions */
int rc_sourcefile(char *);
int cmd_source(int argc, char **argv) {
  if (argc < 2)
    return -1;
  return rc_sourcefile(argv[1]);
}


x86 assembly (clang, -O0):
<cmd_source>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1135 <cmd_source+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <cmd_source+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <rc_sourcefile@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_source>:
cmp    $0x2,%edi
jge    111b <cmd_source+0xb>
mov    $0xffffffff,%eax
ret
mov    0x8(%rsi),%rdi
jmp    1030 <rc_sourcefile@plt>

LLVM IR (-O0):
define i32 @cmd_source(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @rc_sourcefile(i8* %12)
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmd_source(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @rc_sourcefile(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ -1, %2 ]
ret i32 %9
}
int main() {
  int a, b, x, y, t, gcd, lcm;
  a = x;
  b = y << 2;
  while (b != 0) {
    t = b;
    b = a / b;
    a = t;
  }
  gcd = a;
  lcm = (x * y) / gcd;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113f <main+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    111a <main+0x1a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = load i32, i32* %4
store i32 %9, i32* %2
%10 = load i32, i32* %5
%11 = shl i32 %10, 2
store i32 %11, i32* %3
br label %12
12: ; preds = %15, %0
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %3
store i32 %16, i32* %6
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = sdiv i32 %17, %18
store i32 %19, i32* %3
%20 = load i32, i32* %6
store i32 %20, i32* %2
br label %12
21: ; preds = %12
%22 = load i32, i32* %2
store i32 %22, i32* %7
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = mul nsw i32 %23, %24
%26 = load i32, i32* %7
%27 = sdiv i32 %25, %26
store i32 %27, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int lerp13(int a, int b) { return ((2 * a + b) / 3); }


x86 assembly (clang, -O0):
<lerp13>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp13>:
lea    (%rsi,%rdi,2),%eax
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @lerp13(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 = mul nsw i32 2, %5
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %8, 3
ret i32 %9
}

LLVM IR (-O2):
define i32 @lerp13(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, %1
%5 = sdiv i32 %4, 3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void OutputDebugString(const char *msg) { fprintf(stderr, "%s\n", msg); }


x86 assembly (clang, -O0):
<OutputDebugString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OutputDebugString>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @OutputDebugString(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
unsigned int random();
unsigned int get_unix_timestamp() { return random(); }


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

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

LLVM IR (-O0):
define i32 @get_unix_timestamp() {
%1 = call i32 (...) @random()
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_unix_timestamp() {
%1 = tail call i32 (...) @random()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char, char, char, char, char,
                          char);
int main() {
  char c1 = 'H';
  char c2 = 'o';
  char c3 = 'm';
  char c4 = 'e';
  char c5 = 'W';
  char c6 = 'o';
  char c7 = 'r';
  char c8 = 'k';
  printf("%c%c%c%c %c%c%c%c\n", c1, c2, c3, c4, c5, c6, c7, c8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x48,-0x5(%rbp)
movb   $0x6f,-0x6(%rbp)
movb   $0x6d,-0x7(%rbp)
movb   $0x65,-0x8(%rbp)
movb   $0x57,-0x9(%rbp)
movb   $0x6f,-0xa(%rbp)
movb   $0x72,-0xb(%rbp)
movb   $0x6b,-0xc(%rbp)
mov    -0x5(%rbp),%sil
mov    -0x6(%rbp),%dl
mov    -0x7(%rbp),%cl
mov    -0x8(%rbp),%r8b
mov    -0x9(%rbp),%r9b
mov    -0xa(%rbp),%r10b
mov    -0xb(%rbp),%al
lea    0xea1(%rip),%rdi
movsbl %sil,%esi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %r10b,%r10d
mov    %r10d,(%rsp)
movsbl %al,%eax
mov    %eax,0x8(%rsp)
movsbl -0xc(%rbp),%eax
mov    %eax,0x10(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
lea    0xee4(%rip),%rdi
mov    $0x48,%esi
mov    $0x6f,%edx
mov    $0x6d,%ecx
mov    $0x65,%r8d
mov    $0x57,%r9d
push   $0x6b
push   $0x72
push   $0x6f
call   1030 <printf@plt>
add    $0x20,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%c%c%c%c %c%c%c%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i32 0, i32* %1
store i8 72, i8* %2
store i8 111, i8* %3
store i8 109, i8* %4
store i8 101, i8* %5
store i8 87, i8* %6
store i8 111, i8* %7
store i8 114, i8* %8
store i8 107, i8* %9
%10 = load i8, i8* %2
%11 = load i8, i8* %3
%12 = load i8, i8* %4
%13 = load i8, i8* %5
%14 = load i8, i8* %6
%15 = load i8, i8* %7
%16 = load i8, i8* %8
%17 = load i8, i8* %9
%18 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext %10, i8 signext %11, i8 signext %12, i8 signext %13, i8 signext %14, i8 signext %15, i8 signext %16, i8 signext %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"%c%c%c%c %c%c%c%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 signext 72, i8 signext 111, i8 signext 109, i8 signext 101, i8 signext 87, i8 signext 111, i8 signext 114, i8 signext 107)
ret i32 0
}