xunge/DecIR huggingface dataset:
void INT_Excep_MTU3_TGIB3(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU3_TGIB3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f2() {
  int x = 17;
  int array[10];
  int y = 123;
  printf("%d\n", array[-2]);
  printf("%d\n", array[-1]);
  printf("%d\n", array[10]);
  printf("%d\n", array[11]);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x11,-0x4(%rbp)
movl   $0x7b,-0x34(%rbp)
mov    -0x38(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @f2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 poison)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 poison)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 poison)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 poison)
ret void
}
int test_imm_67int64_lowword_mem(long long *val) {
  return ((*val) & (0x67 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_67int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 103
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int _open(char *path, int flags, ...) {
  (void)(path);
  (void)(flags);
  return -1;
}


x86 assembly (clang, -O0):
<_open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_open(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
ret i32 -1
}

LLVM IR (-O2):
define i32 @_open(i8* nocapture readnone %0, i32 %1, ...) {
ret i32 -1
}
void gensync(void) {}


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

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

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

LLVM IR (-O2):
define void @gensync() {
ret void
}
/* Variables and functions */
int getMax(int, int);
int getMin(int, int);
double scoreKMerDiscrepancy(int value1, int value2) {
  int high = getMax(value1, value2);
  int low = getMin(value1, value2);
  high = getMax(high, 1);
  low = getMax(low, 1);
  double score = (double)high - (double)low;
  return score;
}


x86 assembly (clang, -O0):
<scoreKMerDiscrepancy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <getMax@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <getMin@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
call   1040 <getMax@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x1,%esi
call   1040 <getMax@plt>
mov    %eax,-0x10(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scoreKMerDiscrepancy>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <getMax@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <getMin@plt>
mov    %eax,%ebx
mov    %r14d,%edi
mov    $0x1,%esi
call   1040 <getMax@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x1,%esi
call   1040 <getMax@plt>
cvtsi2sd %ebp,%xmm0
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define double @scoreKMerDiscrepancy(i32 %0, i32 %1) {
%3 = tail call i32 @getMax(i32 %0, i32 %1)
%4 = tail call i32 @getMin(i32 %0, i32 %1)
%5 = tail call i32 @getMax(i32 %3, i32 1)
%6 = tail call i32 @getMax(i32 %4, i32 1)
%7 = sitofp i32 %5 to double
%8 = sitofp i32 %6 to double
%9 = fsub double %7, %8
ret double %9
}
void nop_pause(void) { __asm __volatile("pause"); }


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

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

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

LLVM IR (-O2):
define void @nop_pause() {
tail call void asm sideeffect "pause", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct xrow_header {
  int dummy;
};
struct vclock {
  int dummy;
};

/* Variables and functions */
void xrow_decode_sudirribe(struct xrow_header *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *, struct vclock *);
void xrow_decode_vclock(struct xrow_header *row, struct vclock *vclock) {
  return xrow_decode_sudirribe(row, NULL, NULL, vclock);
}


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

x86 assembly (clang, -O2):
<xrow_decode_vclock>:
mov    %rsi,%rcx
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <xrow_decode_sudirribe@plt>

LLVM IR (-O0):
%struct.xrow_header = type { i32 }
%struct.vclock = type { i32 }
define void @xrow_decode_vclock(%struct.xrow_header* %0, %struct.vclock* %1) {
%3 = alloca %struct.xrow_header*
%4 = alloca %struct.vclock*
store %struct.xrow_header* %0, %struct.xrow_header** %3
store %struct.vclock* %1, %struct.vclock** %4
%5 = load %struct.xrow_header*, %struct.xrow_header** %3
%6 = load %struct.vclock*, %struct.vclock** %4
ret void
}

LLVM IR (-O2):
%struct.xrow_header = type { i32 }
%struct.vclock = type { i32 }
define void @xrow_decode_vclock(%struct.xrow_header* %0, %struct.vclock* %1) {
tail call void @xrow_decode_sudirribe(%struct.xrow_header* %0, i32* null, i32* null, %struct.vclock* %1)
ret void
}
int f() { return 0x1337; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 4919
}

LLVM IR (-O2):
define i32 @f() {
ret i32 4919
}
void I420Scale() {}


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

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

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

LLVM IR (-O2):
define void @I420Scale() {
ret void
}
int main(void) {
  __float128 input, output;
  input = power_of_two(-1);
  if ((double)input != 0.5) {
    __builtin_abort();
  }
  output = calc1(input);
  if ((double)output != 0.5) {
    __builtin_abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    $0xffffffff,%edi
call   1050 <power_of_two@plt>
mov    %eax,%edi
call   11d0 <__floatsitf>
movaps %xmm0,-0x20(%rbp)
movaps -0x20(%rbp),%xmm0
call   1270 <__trunctfdf2>
movsd  0xe99(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    117c <main+0x4c>
jp     117c <main+0x4c>
jmp    1181 <main+0x51>
call   1030 <abort@plt>
movaps -0x20(%rbp),%xmm0
mov    $0x1,%al
call   1040 <calc1@plt>
mov    %eax,%edi
call   11d0 <__floatsitf>
movaps %xmm0,-0x30(%rbp)
movaps -0x30(%rbp),%xmm0
call   1270 <__trunctfdf2>
movsd  0xe58(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11bd <main+0x8d>
jp     11bd <main+0x8d>
jmp    11c2 <main+0x92>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
xor    %eax,%eax
call   1040 <power_of_two@plt>
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca fp128
%3 = alloca fp128
store i32 0, i32* %1
%4 = call i32 (i32, ...) bitcast (i32 (...)* @power_of_two to i32 (i32, ...)*)(i32 -1)
%5 = sitofp i32 %4 to fp128
store fp128 %5, fp128* %2
%6 = load fp128, fp128* %2
%7 = fptrunc fp128 %6 to double
%8 = fcmp une double %7, 5.000000e-01
br i1 %8, label %9, label %10
9: ; preds = %0
unreachable
10: ; preds = %0
%11 = load fp128, fp128* %2
%12 = call i32 (fp128, ...) bitcast (i32 (...)* @calc1 to i32 (fp128, ...)*)(fp128 %11)
%13 = sitofp i32 %12 to fp128
store fp128 %13, fp128* %3
%14 = load fp128, fp128* %3
%15 = fptrunc fp128 %14 to double
%16 = fcmp une double %15, 5.000000e-01
br i1 %16, label %17, label %18
17: ; preds = %10
unreachable
18: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @power_of_two to i32 (i32, ...)*)(i32 -1)
tail call void @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ init_setproctitle(char ***);
int /*<<< orphan*/ setproctitle(char *);
int sleep(int);
int main(int argc, char **argv) {
  init_setproctitle(&argv);
  setproctitle("whatever-you-want");
  return sleep(10);
}


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    -0x10(%rbp),%rdi
call   1040 <init_setproctitle@plt>
lea    0xeaa(%rip),%rdi
call   1030 <setproctitle@plt>
mov    $0xa,%edi
call   1050 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rdi
call   1040 <init_setproctitle@plt>
lea    0xebc(%rip),%rdi
call   1030 <setproctitle@plt>
mov    $0xa,%edi
call   1050 <sleep@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"whatever-you-want\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 @init_setproctitle(i8*** %5)
%7 = call i32 @setproctitle(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @sleep(i32 10)
ret i32 %8
}

LLVM IR (-O2):
@.str = [18 x i8] c"whatever-you-want\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8**
store i8** %1, i8*** %3
%4 = call i32 @init_setproctitle(i8*** %3)
%5 = call i32 @setproctitle(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @sleep(i32 10)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ io_printf(char *);
int /*<<< orphan*/ itoa(char *, int, int);
void io_print_x(int x) {
  char num[32];
  itoa(num, x, 16);
  io_printf(num);
}


x86 assembly (clang, -O0):
<io_print_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    $0x10,%edx
call   1040 <itoa@plt>
lea    -0x30(%rbp),%rdi
call   1030 <io_printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_print_x>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%esi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%edx
call   1040 <itoa@plt>
mov    %rbx,%rdi
call   1030 <io_printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @io_print_x(i32 %0) {
%2 = alloca i32
%3 = alloca [32 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @itoa(i8* %4, i32 %5, i32 16)
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%8 = call i32 @io_printf(i8* %7)
ret void
}

LLVM IR (-O2):
define void @io_print_x(i32 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = call i32 @itoa(i8* %3, i32 %0, i32 16)
%5 = call i32 @io_printf(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
ny() {
  printf("This opcode not implemeted yet.\n");
  exit(2);
}


x86 assembly (clang, -O0):
<ny>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ny>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"This opcode not implemeted yet.\0A\00"
define i32 @ny() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@str = [32 x i8] c"This opcode not implemeted yet.\00"
define i32 @ny() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 2)
unreachable
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int dumpio_fopen(char *, int);
int /*<<< orphan*/ dumpio_set_str(char *, char const *, int);
void dumpio_fopen_(int32_t *fid, const char *fname, int32_t *mode,
                   int32_t fname_len) {
  int32_t ierr;
  char _fname[256];
  int32_t _fname_len = fname_len;
  if (_fname_len > 256 - 1) {
    _fname_len = 256 - 1;
  }
  dumpio_set_str(_fname, fname, _fname_len);
  *fid = dumpio_fopen(_fname, *mode);
}


x86 assembly (clang, -O0):
<dumpio_fopen_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x124(%rbp)
cmpl   $0xff,-0x124(%rbp)
jle    115d <dumpio_fopen_+0x3d>
movl   $0xff,-0x124(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x124(%rbp),%edx
call   1040 <dumpio_set_str@plt>
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
call   1030 <dumpio_fopen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpio_fopen_>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rdx,%rbx
mov    %rdi,%r14
cmp    $0xff,%ecx
mov    $0xff,%edx
cmovl  %ecx,%edx
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <dumpio_set_str@plt>
mov    (%rbx),%esi
mov    %r15,%rdi
call   1030 <dumpio_fopen@plt>
mov    %eax,(%r14)
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @dumpio_fopen_(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca [256 x i8]
%11 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%12 = load i32, i32* %8
store i32 %12, i32* %11
%13 = load i32, i32* %11
%14 = icmp sgt i32 %13, 255
br i1 %14, label %15, label %16
15: ; preds = %4
store i32 255, i32* %11
br label %16
16: ; preds = %15, %4
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%18 = load i8*, i8** %6
%19 = load i32, i32* %11
%20 = call i32 @dumpio_set_str(i8* %17, i8* %18, i32 %19)
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%22 = load i32*, i32** %7
%23 = load i32, i32* %22
%24 = call i32 @dumpio_fopen(i8* %21, i32 %23)
%25 = load i32*, i32** %5
store i32 %24, i32* %25
ret void
}

LLVM IR (-O2):
define void @dumpio_fopen_(i32* nocapture writeonly %0, i8* %1, i32* nocapture %2, i32 %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = icmp slt i32 %3, 255
%8 = select i1 %7, i32 %3, i32 255
%9 = call i32 @dumpio_set_str(i8* %6, i8* %1, i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @dumpio_fopen(i8* %6, i32 %10)
store i32 %11, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ arc4random_uniform(int /*<<< orphan*/);
void uninitvar(void) {
  uint32_t uint32Uninit;
  (void)arc4random_uniform(uint32Uninit);
}


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

x86 assembly (clang, -O2):
<uninitvar>:
jmp    1030 <arc4random_uniform@plt>

LLVM IR (-O0):
define void @uninitvar() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @arc4random_uniform(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar() {
%1 = tail call i32 @arc4random_uniform(i32 undef)
ret void
}
/* Variables and functions */
scalar_t__ isspace(int);
int isprint(int c) { return (c >= ' ' && c < 256) || isspace(c); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jl     1137 <isprint+0x27>
mov    $0x1,%al
cmpl   $0x100,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1149 <isprint+0x39>
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
lea    -0x20(%rdi),%ecx
mov    $0x1,%eax
cmp    $0xe0,%ecx
jb     1135 <isprint+0x25>
push   %rax
call   1030 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 256
br i1 %7, label %12, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = call i64 @isspace(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ true, %5 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 224
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @isspace(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ xalloc_fail();
void *xmalloc(size_t size) {
  void *ptr = NULL;
  if (size != 0)
    ptr = malloc(size);
  assert(ptr != NULL);
  if (ptr == NULL)
    xalloc_fail();
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115c <xmalloc+0x2c>
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1180 <xmalloc+0x50>
mov    $0x0,%al
call   1030 <xalloc_fail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
test   %rdi,%rdi
je     1140 <xmalloc+0x10>
call   1050 <malloc@plt>
mov    %rax,%rbx
jmp    1142 <xmalloc+0x12>
xor    %ebx,%ebx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
test   %rbx,%rbx
jne    115c <xmalloc+0x2c>
xor    %eax,%eax
call   1030 <xalloc_fail@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* null, i8** %3
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %3
br label %9
9: ; preds = %6, %1
%10 = load i8*, i8** %3
%11 = icmp ne i8* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %3
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %9
%17 = call i32 (...) @xalloc_fail()
br label %18
18: ; preds = %16, %9
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @xmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
br label %5
5: ; preds = %3, %1
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = icmp eq i8* %6, null
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = tail call i32 (...) @xalloc_fail()
br label %13
13: ; preds = %11, %5
ret i8* %6
}
int test_imm_8Euint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x8E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Euint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9306112
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct test_gettimeofday_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mocktime_enable_mocking();
void __attribute__((weak))
test_gettimeofday_setup(struct test_gettimeofday_data *data) {
  mocktime_enable_mocking();
}


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

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

LLVM IR (-O0):
%struct.test_gettimeofday_data = type { i32 }
define weak void @test_gettimeofday_setup(%struct.test_gettimeofday_data* %0) {
%2 = alloca %struct.test_gettimeofday_data*
store %struct.test_gettimeofday_data* %0, %struct.test_gettimeofday_data** %2
%3 = call i32 (...) @mocktime_enable_mocking()
ret void
}

LLVM IR (-O2):
%struct.test_gettimeofday_data = type { i32 }
define weak void @test_gettimeofday_setup(%struct.test_gettimeofday_data* %0) {
%2 = tail call i32 (...) @mocktime_enable_mocking()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ ttyreset(int /*<<< orphan*/);
void sigcatch(int sig) {
  ttyreset(0);
  exit(0);
}


x86 assembly (clang, -O0):
<sigcatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <ttyreset@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigcatch>:
push   %rax
xor    %edi,%edi
call   1030 <ttyreset@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sigcatch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @ttyreset(i32 0)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigcatch(i32 %0) {
%2 = tail call i32 @ttyreset(i32 0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dxl_write_byte(unsigned char, int, unsigned char);
void setLocked(unsigned char id, unsigned char locked) {
  dxl_write_byte(id, (47), locked);
}


x86 assembly (clang, -O0):
<setLocked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x2f,%esi
movzbl %al,%edi
movzbl -0x2(%rbp),%edx
call   1030 <dxl_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setLocked>:
mov    %esi,%edx
mov    $0x2f,%esi
jmp    1030 <dxl_write_byte@plt>

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

LLVM IR (-O2):
define void @setLocked(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @dxl_write_byte(i8 zeroext %0, i32 47, i8 zeroext %1)
ret void
}
/* Type definitions */
typedef unsigned int uint16_t;

/* Variables and functions */
void *memzero16(void *dest, size_t n) {
  uint16_t z16 = 0U;
  do {
    uint16_t *p = (uint16_t *)dest;
    for (; n >= sizeof(uint16_t); n -= sizeof(uint16_t))
      *p++ = z16;
  } while (0);
  return (dest);
}


x86 assembly (clang, -O0):
<memzero16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x4,-0x10(%rbp)
jb     114b <memzero16+0x4b>
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x20(%rbp)
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
sub    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    111b <memzero16+0x1b>
jmp    1150 <memzero16+0x50>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memzero16>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x4,%rsi
jb     112b <memzero16+0x1b>
mov    %rsi,%rdx
and    $0xfffffffffffffffc,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @memzero16(i8* returned writeonly %0, i64 %1) {
%3 = icmp ugt i64 %1, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = and i64 %1, -4
br label %6
6: ; preds = %4, %2
ret i8* %0
}
unsigned int rnd_xor(unsigned int x) {
  x ^= (x << 6);
  x ^= (x >> 3);
  x ^= (x << 17);
  return x;
}


x86 assembly (clang, -O0):
<rnd_xor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x6,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x3,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x11,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd_xor>:
mov    %edi,%eax
shl    $0x6,%eax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x3,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shl    $0x11,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @rnd_xor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 6
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 3
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = shl i32 %11, 17
%13 = load i32, i32* %2
%14 = xor i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @rnd_xor(i32 %0) {
%2 = shl i32 %0, 6
%3 = xor i32 %2, %0
%4 = lshr i32 %3, 3
%5 = xor i32 %4, %3
%6 = shl i32 %5, 17
%7 = xor i32 %6, %5
ret i32 %7
}
int foo1b(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @foo1b() {
ret i32 0
}
const char *get_arg_list_start_from_call(const char *call_buf) {
  const char *c;
  for (c = call_buf; *c != '(' && *c != 0; c++)
    ;
  return c;
}


x86 assembly (clang, -O0):
<get_arg_list_start_from_call>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x28,%ecx
mov    %al,-0x11(%rbp)
je     1135 <get_arg_list_start_from_call+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1145 <get_arg_list_start_from_call+0x45>
jmp    115b <get_arg_list_start_from_call+0x5b>
jmp    114a <get_arg_list_start_from_call+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <get_arg_list_start_from_call+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_arg_list_start_from_call>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <get_arg_list_start_from_call+0x22>
cmp    $0x28,%cl
je     1122 <get_arg_list_start_from_call+0x22>
add    $0x1,%rax
jmp    1110 <get_arg_list_start_from_call+0x10>
ret

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

LLVM IR (-O2):
define i8* @get_arg_list_start_from_call(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 40, label %7
i8 0, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
ret i8* %3
}
int test_imm_93int8_mem(signed char *val) {
  return ((*val) & (0x93 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_93int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -109
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bv(long *, long *);
void h(long *m, long *p) {
  long cb = *p;
  bv(m, &cb);
}


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

x86 assembly (clang, -O2):
<h>:
push   %rax
mov    (%rsi),%rax
mov    %rax,(%rsp)
mov    %rsp,%rsi
call   1030 <bv@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @h(i64* %0, i64* nocapture %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = load i64, i64* %1
store i64 %5, i64* %3
%6 = call i32 @bv(i64* %0, i64* %3)
ret void
}
AX0AR1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (((short *)10000000)[x0]) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<AX0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x87a22(%rax),%dx
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
mov    %dx,(%rax,%rcx,2)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0AR1>:
movzwl 0x87a22(%r9),%eax
movslq %edx,%rcx
mov    %ax,0x989680(%rcx,%rcx,1)
ret

LLVM IR (-O0):
define i32 @AX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %13
%17 = getelementptr inbounds i16, i16* %16, i64 277777
%18 = load i16, i16* %17
%19 = load i32, i32* %10
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %20
store i16 %18, i16* %21
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @AX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = getelementptr inbounds i16, i16* %5, i64 277777
%8 = load i16, i16* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %9
store i16 %8, i16* %10
ret i32 undef
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_bindir(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_bindir>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_bindir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_bindir(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double testfunc(double, int);
int main() {
  double data1 = 3.14159;
  int data2 = 10;
  double result;
  result = testfunc(data1, data2);
  printf("The proper result is %f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <testfunc@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0xa,%edi
call   1030 <testfunc@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"The proper result is %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
%4 = alloca double
store i32 0, i32* %1
store double 3.141590e+00, double* %2
store i32 10, i32* %3
%5 = load double, double* %2
%6 = load i32, i32* %3
%7 = call double @testfunc(double %5, i32 %6)
store double %7, double* %4
%8 = load double, double* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"The proper result is %f\0A\00"
define i32 @main() {
%1 = tail call double @testfunc(double 3.141590e+00, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
int f(int j) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 0
}
unsigned long hash5(const char *str) {
  unsigned long hash = 0x811c9dc5;
  while (*str) {
    hash ^= (unsigned char)*str++;
    hash *= 0x01000193;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x811c9dc5,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <hash5+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
imul   $0x1000193,-0x10(%rbp),%rax
01
mov    %rax,-0x10(%rbp)
jmp    1111 <hash5+0x11>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash5>:
mov    $0x811c9dc5,%eax
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash5+0x28>
add    $0x1,%rdi
nop
movzbl %cl,%ecx
xor    %rax,%rcx
imul   $0x1000193,%rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash5+0x10>
ret

LLVM IR (-O0):
define i64 @hash5(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 2166136261, i64* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = zext i8 %11 to i64
%13 = load i64, i64* %3
%14 = xor i64 %13, %12
store i64 %14, i64* %3
%15 = load i64, i64* %3
%16 = mul i64 %15, 16777619
store i64 %16, i64* %3
br label %4
17: ; preds = %4
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @hash5(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 2166136261, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = zext i8 %5 to i64
%10 = xor i64 %6, %9
%11 = mul i64 %10, 16777619
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 2166136261, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
char *find_any_ptr(char *string, char *stop) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @find_any_ptr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @find_any_ptr(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
void ff_hevc_put_hevc_pel_pixels32_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels32_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpticalFlowSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void OpticalFlowSettingsUpdated() {
  UAVObjUpdated(OpticalFlowSettingsHandle());
}


x86 assembly (clang, -O0):
<OpticalFlowSettingsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OpticalFlowSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpticalFlowSettingsUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <OpticalFlowSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @OpticalFlowSettingsUpdated() {
%1 = call i32 (...) @OpticalFlowSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OpticalFlowSettingsUpdated() {
%1 = tail call i32 (...) @OpticalFlowSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void detail_super_ddf(struct supertype *st, char *homehost) {}


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

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

LLVM IR (-O0):
%struct.supertype = type opaque
define void @detail_super_ddf(%struct.supertype* %0, i8* %1) {
%3 = alloca %struct.supertype*
%4 = alloca i8*
store %struct.supertype* %0, %struct.supertype** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.supertype = type opaque
define void @detail_super_ddf(%struct.supertype* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ft_memdel(void **ap) {
  if (*ap == NULL)
    return;
  free(*ap);
  *ap = NULL;
}


x86 assembly (clang, -O0):
<ft_memdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    112f <ft_memdel+0x1f>
jmp    1146 <ft_memdel+0x36>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memdel>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <ft_memdel+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_memdel(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %12
7: ; preds = %1
%8 = load i8**, i8*** %2
%9 = load i8*, i8** %8
%10 = call i32 @free(i8* %9)
%11 = load i8**, i8*** %2
store i8* null, i8** %11
br label %12
12: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @ft_memdel(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void vpn_ws_exit(int code) { exit(code); }


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

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

LLVM IR (-O0):
define void @vpn_ws_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @vpn_ws_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ppuSetNameTblHorizontal();
int /*<<< orphan*/ ppuSetNameTblVertical();
void mmc2_4setParamsFXXX(uint16_t addr, uint8_t val) {
  (void)addr;
  if ((val & 1) == 0) {
    ppuSetNameTblVertical();
  } else {
    ppuSetNameTblHorizontal();
  }
}


x86 assembly (clang, -O0):
<mmc2_4setParamsFXXX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1149 <mmc2_4setParamsFXXX+0x29>
mov    $0x0,%al
call   1040 <ppuSetNameTblVertical@plt>
jmp    1150 <mmc2_4setParamsFXXX+0x30>
mov    $0x0,%al
call   1030 <ppuSetNameTblHorizontal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmc2_4setParamsFXXX>:
xor    %eax,%eax
test   $0x1,%sil
jne    112d <mmc2_4setParamsFXXX+0xd>
jmp    1040 <ppuSetNameTblVertical@plt>
jmp    1030 <ppuSetNameTblHorizontal@plt>

LLVM IR (-O0):
define void @mmc2_4setParamsFXXX(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @ppuSetNameTblVertical()
br label %13
11: ; preds = %2
%12 = call i32 (...) @ppuSetNameTblHorizontal()
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
define void @mmc2_4setParamsFXXX(i32 %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @ppuSetNameTblVertical()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @ppuSetNameTblHorizontal()
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ h(int, void (*)(int));
void g(int i, ...) { h(i + 1, &g); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    0x2ec0(%rip),%rsi
call   1030 <h@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
add    $0x1,%edi
mov    0x2ece(%rip),%rsi
jmp    1030 <h@plt>

LLVM IR (-O0):
define void @g(i32 %0, ...) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @h(i32 %4, void (i32)* bitcast (void (i32, ...)* @g to void (i32)*))
ret void
}

LLVM IR (-O2):
define void @g(i32 %0, ...) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @h(i32 %2, void (i32)* bitcast (void (i32, ...)* @g to void (i32)*))
ret void
}