xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ sibling;
};
typedef TYPE_1__ XWindowChanges;

/* Variables and functions */
unsigned long get_XWindowChanges_sibling(void *_p) {
  return (unsigned long)((XWindowChanges *)_p)->sibling;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XWindowChanges_sibling(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XWindowChanges_sibling(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
scalar_t__ memory_free(void *, char *, int);
void adt_free(void *data) {
  ((void)memory_free((data),
                     "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/Jianlong-Peng/myADT/"
                     "refs/heads/master/src/mtools.c",
                     43),
   (data) = 0);
}


x86 assembly (clang, -O0):
<adt_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x2b,%edx
call   1030 <memory_free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adt_free>:
lea    0xee9(%rip),%rsi
mov    $0x2b,%edx
jmp    1030 <memory_free@plt>

LLVM IR (-O0):
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Jianlong-Peng/myADT/refs/heads/master/src/mtools.c\00"
define void @adt_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @memory_free(i8* %3, i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 43)
store i8* null, i8** %2
ret void
}

LLVM IR (-O2):
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Jianlong-Peng/myADT/refs/heads/master/src/mtools.c\00"
define void @adt_free(i8* %0) {
%2 = tail call i64 @memory_free(i8* %0, i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 43)
ret void
}
/* Type definitions */
struct ines_file {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ines_file *);
void unload_rom(struct ines_file *rom) { free(rom); }


x86 assembly (clang, -O0):
<unload_rom>:
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):
<unload_rom>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.ines_file = type { i32 }
define void @unload_rom(%struct.ines_file* nocapture %0) {
%2 = tail call i32 @free(%struct.ines_file* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int function_one(int a, int b) {
  printf("This is function one\n");
  return a * b;
}


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

x86 assembly (clang, -O2):
<function_one>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
imul   %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"This is function one\0A\00"
define i32 @function_one(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
@str = [21 x i8] c"This is function one\00"
define i32 @function_one(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = mul nsw i32 %1, %0
ret i32 %4
}
void scanline2x_generic_output(void *data, unsigned *out_width,
                               unsigned *out_height, unsigned width,
                               unsigned height) {
  *out_width = width << 1;
  *out_height = height << 1;
}


x86 assembly (clang, -O0):
<scanline2x_generic_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanline2x_generic_output>:
add    %ecx,%ecx
mov    %ecx,(%rsi)
add    %r8d,%r8d
mov    %r8d,(%rdx)
ret

LLVM IR (-O0):
define void @scanline2x_generic_output(i8* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = shl i32 %11, 1
%13 = load i32*, i32** %7
store i32 %12, i32* %13
%14 = load i32, i32* %10
%15 = shl i32 %14, 1
%16 = load i32*, i32** %8
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @scanline2x_generic_output(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = shl i32 %3, 1
store i32 %6, i32* %1
%7 = shl i32 %4, 1
store i32 %7, i32* %2
ret void
}
void free_2D(float **array_2D) {
  free(array_2D[0]);
  free(array_2D);
}


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

x86 assembly (clang, -O2):
<free_2D>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_2D(float** %0) {
%2 = alloca float**
store float** %0, float*** %2
%3 = load float**, float*** %2
%4 = getelementptr inbounds float*, float** %3, i64 0
%5 = load float*, float** %4
%6 = bitcast float* %5 to i8*
%7 = load float**, float*** %2
%8 = bitcast float** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @free_2D(float** nocapture %0) {
%2 = bitcast float** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast float** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t f2s16(float f) {
  int i;
  f *= 32768;
  i = (int)((f > 0) ? (f + 0.5f) : (f - 0.5f));
  if (i < -32768)
    i = -32768;
  else if (i > 32767)
    i = 32767;
  return (int16_t)i;
}


x86 assembly (clang, -O0):
<f2s16>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1143 <f2s16+0x43>
movss  0xed0(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1159 <f2s16+0x59>
movss  -0x4(%rbp),%xmm0
movss  0xeb4(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xffff8000,-0x8(%rbp)
jge    117e <f2s16+0x7e>
movl   $0xffff8000,-0x8(%rbp)
jmp    1197 <f2s16+0x97>
cmpl   $0x7fff,-0x8(%rbp)
jle    1192 <f2s16+0x92>
movl   $0x7fff,-0x8(%rbp)
jmp    1197 <f2s16+0x97>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2s16>:
mulss  0xef8(%rip),%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
lea    0xef2(%rip),%rcx
addss  (%rcx,%rax,4),%xmm0
movss  0xedd(%rip),%xmm1
maxss  %xmm0,%xmm1
movss  0xed5(%rip),%xmm0
minss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
cwtl
ret

LLVM IR (-O0):
define i32 @f2s16(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float %4, 3.276800e+04
store float %5, float* %2
%6 = load float, float* %2
%7 = fcmp ogt float %6, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load float, float* %2
%10 = fadd float %9, 5.000000e-01
br label %14
11: ; preds = %1
%12 = load float, float* %2
%13 = fsub float %12, 5.000000e-01
br label %14
14: ; preds = %11, %8
%15 = phi float [ %10, %8 ], [ %13, %11 ]
%16 = fptosi float %15 to i32
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = icmp slt i32 %17, -32768
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 -32768, i32* %3
br label %25
20: ; preds = %14
%21 = load i32, i32* %3
%22 = icmp sgt i32 %21, 32767
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 32767, i32* %3
br label %24
24: ; preds = %23, %20
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @f2s16(float %0) {
%2 = fmul float %0, 3.276800e+04
%3 = fcmp ogt float %2, 0.000000e+00
%4 = select i1 %3, float 5.000000e-01, float -5.000000e-01
%5 = fadd float %2, %4
%6 = fptosi float %5 to i32
%7 = icmp slt i32 %6, 32767
%8 = select i1 %7, i32 %6, i32 32767
%9 = icmp sgt i32 %8, -32768
%10 = select i1 %9, i32 %8, i32 -32768
ret i32 %10
}
float _Complex conjf(float _Complex z) { abort(); }


x86 assembly (clang, -O0):
<conjf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movlpd %xmm0,-0x8(%rbp)
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<conjf>:
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define <2 x float> @conjf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %3
unreachable
}

LLVM IR (-O2):
define <2 x float> @conjf(<2 x float> %0) {
tail call void @abort()
unreachable
}
int Max(int i, int j) {
  if (i < j)
    return j;
  return i;
}


x86 assembly (clang, -O0):
<Max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <Max+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <Max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mrf24j40_write_short_ctrl_reg(int, int);
void mrf24j40_ie(void) {
  mrf24j40_write_short_ctrl_reg(0x32, ~((1) | (1 << 3) | (1 << 4)));
}


x86 assembly (clang, -O0):
<mrf24j40_ie>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%edi
mov    $0xffffffe6,%esi
call   1030 <mrf24j40_write_short_ctrl_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrf24j40_ie>:
mov    $0x32,%edi
mov    $0xffffffe6,%esi
jmp    1030 <mrf24j40_write_short_ctrl_reg@plt>

LLVM IR (-O0):
define void @mrf24j40_ie() {
%1 = call i32 @mrf24j40_write_short_ctrl_reg(i32 50, i32 -26)
ret void
}

LLVM IR (-O2):
define void @mrf24j40_ie() {
%1 = tail call i32 @mrf24j40_write_short_ctrl_reg(i32 50, i32 -26)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *const);
int /*<<< orphan*/ stderr;
void usage(const char *const prog_name) {
  fprintf(stderr,
          "Usage: %s [options] an2k-input-files ...\n"
          "\t-h\n"
          "\t-b base-config-file\n"
          "\t-c supplemental-config-file\n"
          "\t-l log-level\n"
          "\t-version\n",
          prog_name);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [120 x i8] c"Usage: %s [options] an2k-input-files ...\0A\09-h\0A\09-b base-config-file\0A\09-c supplemental-config-file\0A\09-l log-level\0A\09-version\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(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 ([120 x i8], [120 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [120 x i8] c"Usage: %s [options] an2k-input-files ...\0A\09-h\0A\09-b base-config-file\0A\09-c supplemental-config-file\0A\09-l log-level\0A\09-version\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void border_ne_ext_diagonal_special_sand_short_vert(unsigned char *pic,
                                                    unsigned char *mirr) {
  *pic = 0x2C;
  *mirr = 0x02;
}


x86 assembly (clang, -O0):
<border_ne_ext_diagonal_special_sand_short_vert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2c,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_ne_ext_diagonal_special_sand_short_vert>:
movb   $0x2c,(%rdi)
movb   $0x2,(%rsi)
ret

LLVM IR (-O0):
define void @border_ne_ext_diagonal_special_sand_short_vert(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
store i8 44, i8* %5
%6 = load i8*, i8** %4
store i8 2, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_ne_ext_diagonal_special_sand_short_vert(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 44, i8* %0
store i8 2, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _cleanup();
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
void __xxx_never_called() {
  _cleanup();
  fflush(NULL);
  fclose(NULL);
}


x86 assembly (clang, -O0):
<__xxx_never_called>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <_cleanup@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <fflush@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <fclose@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__xxx_never_called>:
push   %rax
xor    %eax,%eax
call   1040 <_cleanup@plt>
xor    %edi,%edi
call   1050 <fflush@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define void @__xxx_never_called() {
%1 = call i32 (...) @_cleanup()
%2 = call i32 @fflush(i32* null)
%3 = call i32 @fclose(i32* null)
ret void
}

LLVM IR (-O2):
define void @__xxx_never_called() {
%1 = tail call i32 (...) @_cleanup()
%2 = tail call i32 @fflush(i32* null)
%3 = tail call i32 @fclose(i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
int puts(const char *s) {
  while (*s) {
    putchar(*s);
    s++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <puts+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <puts+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *realloc(int /*<<< orphan*/ *, size_t);
void *malloc(size_t i) {
  printf("Hello from malloc");
  return realloc(NULL, i);
}


x86 assembly (clang, -O0):
<malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1040 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <realloc@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Hello from malloc\00"
define i8* @malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = load i64, i64* %2
%5 = call i8* @realloc(i32* null, i64 %4)
ret i8* %5
}

LLVM IR (-O2):
@.str = [18 x i8] c"Hello from malloc\00"
define i8* @malloc(i64 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @realloc(i32* null, i64 %0)
ret i8* %3
}
/* Variables and functions */
int CheckHostCompatibilityEx(int, char *, char *, char *);
int CheckHostCompatibility(char *response_to_aticompat, char *firmware_version,
                           char *host_version) {
  return CheckHostCompatibilityEx((1), response_to_aticompat, firmware_version,
                                  host_version);
}


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

x86 assembly (clang, -O2):
<CheckHostCompatibility>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <CheckHostCompatibilityEx@plt>

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

LLVM IR (-O2):
define i32 @CheckHostCompatibility(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @CheckHostCompatibilityEx(i32 1, i8* %0, i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DatagramClient(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int nRet;
  if (argc != 2) {
    fprintf(stderr, "\nSyntax: udpcli <ServerIpAddr>\n");
    return 0;
  }
  DatagramClient(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1161 <main+0x41>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116e <main+0x4e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <DatagramClient@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1131 <main+0x11>
mov    0x8(%rsi),%rdi
call   1040 <DatagramClient@plt>
jmp    1146 <main+0x26>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"\0ASyntax: udpcli <ServerIpAddr>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %17
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @DatagramClient(i8* %15)
br label %17
17: ; preds = %12, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"\0ASyntax: udpcli <ServerIpAddr>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @DatagramClient(i8* %9)
br label %11
11: ; preds = %7, %4
ret i32 0
}
char *hello() { return "function"; }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"function\00"
define i8* @hello() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
double RAND_MAX;
float rand();
int bf_num(int sides) {
  return 1 + (int)((float)sides * rand() / (RAND_MAX + 1.0));
}


x86 assembly (clang, -O0):
<bf_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebc(%rip),%xmm1
mov    0x2e9d(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_num>:
push   %rax
cvtsi2ss %edi,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mulss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x2eb5(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xec1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @bf_num(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to float
%5 = call float (...) @rand()
%6 = fmul float %4, %5
%7 = fpext float %6 to double
%8 = load double, double* @RAND_MAX
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double %7, %9
%11 = fptosi double %10 to i32
%12 = add nsw i32 1, %11
ret i32 %12
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @bf_num(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = tail call float (...) @rand()
%4 = fmul float %3, %2
%5 = fpext float %4 to double
%6 = load double, double* @RAND_MAX
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %5, %7
%9 = fptosi double %8 to i32
%10 = add nsw i32 %9, 1
ret i32 %10
}
float set_mdcutoff(int ntot, float q1) {
  float n, tmp;
  if (ntot > 15)
    n = 15;
  else
    n = ntot;
  tmp = (300.0) / ((n * n) * 4.0 + 100.0);
  return tmp;
}


x86 assembly (clang, -O0):
<set_mdcutoff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
cmpl   $0xf,-0x4(%rbp)
jle    1128 <set_mdcutoff+0x28>
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1132 <set_mdcutoff+0x32>
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec8(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xec4(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mdcutoff>:
cmp    $0xf,%edi
mov    $0xf,%eax
cmovl  %edi,%eax
cvtsi2ss %eax,%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xee1(%rip),%xmm0
addsd  0xee1(%rip),%xmm0
movsd  0xee1(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @set_mdcutoff(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 15
br i1 %8, label %9, label %10
9: ; preds = %2
store float 1.500000e+01, float* %5
br label %13
10: ; preds = %2
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to float
store float %12, float* %5
br label %13
13: ; preds = %10, %9
%14 = load float, float* %5
%15 = load float, float* %5
%16 = fmul float %14, %15
%17 = fpext float %16 to double
%18 = call double @llvm.fmuladd.f64(double %17, double 4.000000e+00, double 1.000000e+02)
%19 = fdiv double 3.000000e+02, %18
%20 = fptrunc double %19 to float
store float %20, float* %6
%21 = load float, float* %6
ret float %21
}

LLVM IR (-O2):
define float @set_mdcutoff(i32 %0, float %1) {
%3 = icmp slt i32 %0, 15
%4 = select i1 %3, i32 %0, i32 15
%5 = sitofp i32 %4 to float
%6 = fmul float %5, %5
%7 = fpext float %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %7, double 4.000000e+00, double 1.000000e+02)
%9 = fdiv double 3.000000e+02, %8
%10 = fptrunc double %9 to float
ret float %10
}
/* Variables and functions */
scalar_t__ geteuid();
scalar_t__ getuid();
int is_root() { return getuid() == 0 || geteuid() == 0; }


x86 assembly (clang, -O0):
<is_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1152 <is_root+0x32>
mov    $0x0,%al
call   1040 <geteuid@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_root>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
test   %rax,%rax
je     1141 <is_root+0x21>
xor    %eax,%eax
call   1040 <geteuid@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_root() {
%1 = call i64 (...) @getuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i64 (...) @geteuid()
%5 = icmp eq i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ true, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_root() {
%1 = tail call i64 (...) @getuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @geteuid()
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ execl(char const *, char const *, char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void test_exec_exit(const char *self_exec) {
  if (self_exec == NULL)
    exit(0);
  else
    execl(self_exec, self_exec, "exit", (char *)0);
}


x86 assembly (clang, -O0):
<test_exec_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <test_exec_exit+0x1e>
xor    %edi,%edi
call   1030 <exit@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <execl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_exec_exit>:
test   %rdi,%rdi
je     1136 <test_exec_exit+0x16>
lea    0xed4(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
jmp    1040 <execl@plt>
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"exit\00"
define void @test_exec_exit(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %1
%6 = tail call i32 @execl(i8* %0, i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* null)
ret void
}
/* Variables and functions */
double pow(double, double);
double energy(double mass) { return pow(10.0, 8.0) * pow(3.0, 2.0) * mass; }


x86 assembly (clang, -O0):
<energy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
movsd  0xeeb(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  0xec1(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<energy>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @energy(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @pow(double 1.000000e+01, double 8.000000e+00)
%4 = call double @pow(double 3.000000e+00, double 2.000000e+00)
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @energy(double %0) {
%2 = fmul double %0, 9.000000e+08
ret double %2
}
char chrlcaps(char c) { return ((c >= 0x41) && (c <= 0x5A)) ? (c + 0x20) : c; }


x86 assembly (clang, -O0):
<chrlcaps>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <chrlcaps+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <chrlcaps+0x33>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    113a <chrlcaps+0x3a>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrlcaps>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @chrlcaps(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 32
br label %17
14: ; preds = %6, %1
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
br label %17
17: ; preds = %14, %10
%18 = phi i32 [ %13, %10 ], [ %16, %14 ]
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @chrlcaps(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
unsigned char inbyte(void) {
  unsigned char c;
  unsigned short disr;
  for (;;) {
    ((disr) = *((volatile unsigned short *)((0xfffff300 + 0x0C))));
    if (disr & 0x0001)
      break;
  }
  disr = disr & ~0x0001;
  ((c) = *((volatile unsigned char *)((0xfffff300 + 0x30))));
  (*((volatile unsigned short *)((0xfffff300 + 0x0C))) = (disr));
  return c;
}


x86 assembly (clang, -O0):
<inbyte>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff30c,%eax
mov    (%rax),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1125 <inbyte+0x25>
jmp    112a <inbyte+0x2a>
jmp    1104 <inbyte+0x4>
movzwl -0x4(%rbp),%eax
and    $0xfffffffe,%eax
mov    %ax,-0x4(%rbp)
mov    $0xfffff330,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
mov    -0x4(%rbp),%cx
mov    $0xfffff30c,%eax
mov    %cx,(%rax)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inbyte>:
mov    $0xfffff30c,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzwl (%rcx),%edx
test   $0x1,%dl
je     1110 <inbyte+0x10>
and    $0xfffe,%edx
mov    0x24(%rcx),%al
mov    %dx,(%rcx)
ret

LLVM IR (-O0):
define zeroext i8 @inbyte() {
%1 = alloca i8
%2 = alloca i16
br label %3
3: ; preds = %10, %0
%4 = load volatile i16, i16* inttoptr (i64 4294963980 to i16*)
store i16 %4, i16* %2
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
br label %11
10: ; preds = %3
br label %3
11: ; preds = %9
%12 = load i16, i16* %2
%13 = zext i16 %12 to i32
%14 = and i32 %13, -2
%15 = trunc i32 %14 to i16
store i16 %15, i16* %2
%16 = load volatile i8, i8* inttoptr (i64 4294964016 to i8*)
store i8 %16, i8* %1
%17 = load i16, i16* %2
store volatile i16 %17, i16* inttoptr (i64 4294963980 to i16*)
%18 = load i8, i8* %1
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @inbyte() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i16, i16* inttoptr (i64 4294963980 to i16*)
%3 = and i16 %2, 1
%4 = icmp eq i16 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = and i16 %2, -2
%7 = load volatile i8, i8* inttoptr (i64 4294964016 to i8*)
store volatile i16 %6, i16* inttoptr (i64 4294963980 to i16*)
ret i8 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int libc_posix_spawn(int /*<<< orphan*/ *, char *, void *, void *, char **,
                     char **);
int /*<<< orphan*/ watch_log(char *);
int posix_spawn(pid_t *a, char *b, void *c, void *d, char *e[], char *f[]) {
  watch_log("exec\n");
  return libc_posix_spawn(a, b, c, d, e, f);
}


x86 assembly (clang, -O0):
<posix_spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <watch_log@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1040 <libc_posix_spawn@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawn>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xebc(%rip),%rdi
call   1030 <watch_log@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r15,%r8
mov    %r14,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <libc_posix_spawn@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"exec\0A\00"
define i32 @posix_spawn(i32* %0, i8* %1, i8* %2, i8* %3, i8** %4, i8** %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8**
%12 = alloca i8**
store i32* %0, i32** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8** %4, i8*** %11
store i8** %5, i8*** %12
%13 = call i32 @watch_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%14 = load i32*, i32** %7
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i8*, i8** %10
%18 = load i8**, i8*** %11
%19 = load i8**, i8*** %12
%20 = call i32 @libc_posix_spawn(i32* %14, i8* %15, i8* %16, i8* %17, i8** %18, i8** %19)
ret i32 %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"exec\0A\00"
define i32 @posix_spawn(i32* %0, i8* %1, i8* %2, i8* %3, i8** %4, i8** %5) {
%7 = tail call i32 @watch_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @libc_posix_spawn(i32* %0, i8* %1, i8* %2, i8* %3, i8** %4, i8** %5)
ret i32 %8
}
__attribute__((no, noclone)) char *f4(char *p, int i) { return p + i; }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @f4(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
ret i8* %8
}

LLVM IR (-O2):
define i8* @f4(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ invalid_mem_exit(void *, char *);
void *malloc(size_t const);
void *new_mem(const size_t size) {
  void *ptr = malloc(size);
  invalid_mem_exit(ptr, "could not allocate memory");
  return ptr;
}


x86 assembly (clang, -O0):
<new_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1040 <invalid_mem_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_mem>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xed0(%rip),%rsi
mov    %rax,%rdi
call   1040 <invalid_mem_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"could not allocate memory\00"
define i8* @new_mem(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @invalid_mem_exit(i8* %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [26 x i8] c"could not allocate memory\00"
define i8* @new_mem(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @invalid_mem_exit(i8* %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("useful world!");
  puts("useless world!");
  puts("hmm world!");
  puts("yeah world!");
  puts("haha world!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"useful world!\00"
@.str.1 = [15 x i8] c"useless world!\00"
@.str.2 = [11 x i8] c"hmm world!\00"
@.str.3 = [12 x i8] c"yeah world!\00"
@.str.4 = [12 x i8] c"haha world!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"useful world!\00"
@.str.1 = [15 x i8] c"useless world!\00"
@.str.2 = [11 x i8] c"hmm world!\00"
@.str.3 = [12 x i8] c"yeah world!\00"
@.str.4 = [12 x i8] c"haha world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *res = malloc(size);
  if (!res)
    error(EXIT_FAILURE, errno, "malloc");
  return res;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1162 <xmalloc+0x42>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
lea    0xea3(%rip),%rdx
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <xmalloc+0x2c>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb9(%rip),%rdx
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [7 x i8] c"malloc\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @errno
%7 = tail call i32 @error(i32 %5, i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ is_prime(int);
int next(int n) {
  while (!is_prime(n))
    n += 2;
  return n;
}


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_prime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <next+0x28>
jmp    1146 <next+0x36>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <next+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <is_prime@plt>
add    $0x2,%ebx
test   %eax,%eax
je     1120 <next+0x10>
add    $0xfffffffe,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @next(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load i32, i32* %2
%5 = call i32 @is_prime(i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 2
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @next(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 @is_prime(i32 %3)
%5 = icmp eq i32 %4, 0
%6 = add nsw i32 %3, 2
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
void param_sysinit(struct kernel_param *param) {}


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

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

LLVM IR (-O0):
%struct.kernel_param = type opaque
define void @param_sysinit(%struct.kernel_param* %0) {
%2 = alloca %struct.kernel_param*
store %struct.kernel_param* %0, %struct.kernel_param** %2
ret void
}

LLVM IR (-O2):
%struct.kernel_param = type opaque
define void @param_sysinit(%struct.kernel_param* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_movesI(void *moves) { free(moves); }


x86 assembly (clang, -O0):
<free_movesI>:
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):
<free_movesI>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_movesI(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_SetClipRegion(void *);
void UI_ClearClipRegion(void) { trap_R_SetClipRegion(((void *)0)); }


x86 assembly (clang, -O0):
<UI_ClearClipRegion>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <trap_R_SetClipRegion@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_ClearClipRegion>:
xor    %edi,%edi
jmp    1030 <trap_R_SetClipRegion@plt>

LLVM IR (-O0):
define void @UI_ClearClipRegion() {
%1 = call i32 @trap_R_SetClipRegion(i8* null)
ret void
}

LLVM IR (-O2):
define void @UI_ClearClipRegion() {
%1 = tail call i32 @trap_R_SetClipRegion(i8* null)
ret void
}