xunge/DecIR huggingface dataset:
void FPUFlushToZeroModeSet(unsigned long ulMode) {
  (*((volatile unsigned long *)(0xE000EF3C))) =
      ((*((volatile unsigned long *)(0xE000EF3C))) & ~(0x01000000)) | ulMode;
}


x86 assembly (clang, -O0):
<FPUFlushToZeroModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xe000ef3c,%eax
mov    (%rax),%rcx
and    $0xfffffffffeffffff,%rcx
or     -0x8(%rbp),%rcx
mov    $0xe000ef3c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPUFlushToZeroModeSet>:
mov    $0xe000ef3c,%eax
mov    $0xfffffffffeffffff,%rcx
and    (%rax),%rcx
or     %rdi,%rcx
mov    %rcx,(%rax)
ret

LLVM IR (-O0):
define void @FPUFlushToZeroModeSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 3758157628 to i64*)
%4 = and i64 %3, -16777217
%5 = load i64, i64* %2
%6 = or i64 %4, %5
store volatile i64 %6, i64* inttoptr (i64 3758157628 to i64*)
ret void
}

LLVM IR (-O2):
define void @FPUFlushToZeroModeSet(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 3758157628 to i64*)
%3 = and i64 %2, -16777217
%4 = or i64 %3, %0
store volatile i64 %4, i64* inttoptr (i64 3758157628 to i64*)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t complementBit_fun_uint64_t(uint64_t x, uint32_t i) {
  return x ^ 1 << i;
}


x86 assembly (clang, -O0):
<complementBit_fun_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @complementBit_fun_uint64_t(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 = shl i32 1, %6
%8 = xor i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @complementBit_fun_uint64_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
/* Variables and functions */
scalar_t__ calloc(int, int);
void mem_leak(void) {
  char *munch = NULL;
  munch = (char *)calloc(128 * 1000, sizeof(char));
}


x86 assembly (clang, -O0):
<mem_leak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x1f400,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_leak>:
mov    $0x1f400,%edi
mov    $0x1,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define void @mem_leak() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i64 @calloc(i32 128000, i32 1)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
ret void
}

LLVM IR (-O2):
define void @mem_leak() {
%1 = tail call i64 @calloc(i32 128000, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int sscanf(char *, char *, int *);
char *strstr(char *, char *);
int boardType(void) {
  FILE *fp;
  char buf[1024], *ptr;
  int n, board = 1;
  return 1;
  if ((fp = fopen("/proc/cmdline", "r"))) {
    while (fgets(buf, sizeof(buf), fp)) {
      if ((ptr = strstr(buf, "mem_size=")) &&
          (sscanf(&ptr[9], "%x", &n) == 1) && (n == 0x3F000000)) {
        board = 2;
        break;
      } else if ((ptr = strstr(buf, "boardrev=")) &&
                 (sscanf(&ptr[9], "%x", &n) == 1) &&
                 ((n == 0x02) || (n == 0x03))) {
        board = 0;
        break;
      }
    }
    fclose(fp);
  }
  return board;
}


x86 assembly (clang, -O0):
<boardType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3a0,%rsp
movl   $0x1,-0x420(%rbp)
mov    $0x1,%eax
add    $0x3a0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @boardType() {
%1 = alloca i32*
%2 = alloca [1024 x i8]
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 1, i32* %5
ret i32 1
}

LLVM IR (-O2):
define i32 @boardType() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ progNew();
void progExecuteNEW(void *vp) { progNew(); }


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

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

LLVM IR (-O0):
define void @progExecuteNEW(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @progNew()
ret void
}

LLVM IR (-O2):
define void @progExecuteNEW(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @progNew()
ret void
}
/* Variables and functions */
int __builtin_nyuzi_read_control_reg(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void tlb_miss_handler() {
  printf("TLB miss %08x\n", __builtin_nyuzi_read_control_reg(5));
  exit(0);
}


x86 assembly (clang, -O0):
<tlb_miss_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<tlb_miss_handler>:
push   %rax
mov    $0x5,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"TLB miss %08x\0A\00"
define void @tlb_miss_handler() {
%1 = call i32 @__builtin_nyuzi_read_control_reg(i32 5)
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"TLB miss %08x\0A\00"
define void @tlb_miss_handler() {
%1 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *memcpy(void *, void *, int);
void test1(void *ptr) {
  if (memcpy(ptr, ptr, 8) != ptr)
    abort();
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
cmp    -0x8(%rbp),%rax
je     114f <test1+0x2f>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
cmp    %rbx,%rax
jne    1138 <test1+0x18>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @memcpy(i8* %3, i8* %4, i32 8)
%6 = load i8*, i8** %2
%7 = icmp ne i8* %5, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @test1(i8* %0) {
%2 = tail call i8* @memcpy(i8* %0, i8* %0, i32 8)
%3 = icmp eq i8* %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
int dobro(int x) { return x + x; }


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

x86 assembly (clang, -O2):
<dobro>:
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @dobro(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @dobro(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
int do_638() { return 638; }


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

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

LLVM IR (-O0):
define i32 @do_638() {
ret i32 638
}

LLVM IR (-O2):
define i32 @do_638() {
ret i32 638
}
/* Variables and functions */
scalar_t__ sqrt(float);
float VecLength3iv(const int v[3]) {
  return ((float)sqrt((float)v[0] * (float)v[0] + (float)v[1] * (float)v[1] +
                      (float)v[2] * (float)v[2]));
}


x86 assembly (clang, -O0):
<VecLength3iv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm1
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm2
mov    -0x8(%rbp),%rax
cvtsi2ssl 0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2ssl 0x4(%rax),%xmm3
mulss  %xmm3,%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
cvtsi2ssl 0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2ssl 0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecLength3iv>:
push   %rax
cvtsi2ssl (%rdi),%xmm1
cvtsi2ssl 0x4(%rdi),%xmm2
mulss  %xmm2,%xmm2
cvtsi2ssl 0x8(%rdi),%xmm0
mulss  %xmm1,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @VecLength3iv(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to float
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to float
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = sitofp i32 %13 to float
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = sitofp i32 %17 to float
%19 = fmul float %14, %18
%20 = call float @llvm.fmuladd.f32(float %6, float %10, float %19)
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = sitofp i32 %23 to float
%25 = load i32*, i32** %2
%26 = getelementptr inbounds i32, i32* %25, i64 2
%27 = load i32, i32* %26
%28 = sitofp i32 %27 to float
%29 = call float @llvm.fmuladd.f32(float %24, float %28, float %20)
%30 = call i64 @sqrt(float %29)
%31 = sitofp i64 %30 to float
ret float %31
}

LLVM IR (-O2):
define float @VecLength3iv(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sitofp i32 %2 to float
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to float
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %3, float %3, float %7)
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to float
%12 = tail call float @llvm.fmuladd.f32(float %11, float %11, float %8)
%13 = tail call i64 @sqrt(float %12)
%14 = sitofp i64 %13 to float
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World.\n");
  printf("First Github Project!\n");
  printf("안녕하새오 세영이애오\n");
  printf("안녕하새오 채연이애오\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
call   1030 <printf@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    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World.\0A\00"
@.str.1 = [23 x i8] c"First Github Project!\0A\00"
@.str.2 = [33 x i8] c"\EC\95\88\EB\85\95\ED\95\98\EC\83\88\EC\98\A4 \EC\84\B8\EC\98\81\EC\9D\B4\EC\95\A0\EC\98\A4\0A\00"
@.str.3 = [33 x i8] c"\EC\95\88\EB\85\95\ED\95\98\EC\83\88\EC\98\A4 \EC\B1\84\EC\97\B0\EC\9D\B4\EC\95\A0\EC\98\A4\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World.\00"
@str.4 = [22 x i8] c"First Github Project!\00"
@str.5 = [32 x i8] c"\EC\95\88\EB\85\95\ED\95\98\EC\83\88\EC\98\A4 \EC\84\B8\EC\98\81\EC\9D\B4\EC\95\A0\EC\98\A4\00"
@str.6 = [32 x i8] c"\EC\95\88\EB\85\95\ED\95\98\EC\83\88\EC\98\A4 \EC\B1\84\EC\97\B0\EC\9D\B4\EC\95\A0\EC\98\A4\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
void sfx_enable(int enable) {}


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

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

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

LLVM IR (-O2):
define void @sfx_enable(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exitfun();
void signaled(int signo) {
  (void)signo;
  exitfun();
}


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

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

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

LLVM IR (-O2):
define void @signaled(i32 %0) {
%2 = tail call i32 (...) @exitfun()
ret void
}
/* Variables and functions */
int ArrayLen(const void *Table) {
  int Size = 0;
  if (Table == NULL)
    return 0;
  while (*((void **)Table) != NULL) {
    Table += sizeof(void *);
    ++Size;
  }
  return Size;
}


x86 assembly (clang, -O0):
<ArrayLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <ArrayLen+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1159 <ArrayLen+0x59>
jmp    112b <ArrayLen+0x2b>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1153 <ArrayLen+0x53>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <ArrayLen+0x2b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ArrayLen>:
xor    %eax,%eax
test   %rdi,%rdi
je     111c <ArrayLen+0x1c>
cmpq   $0x0,(%rdi)
je     111c <ArrayLen+0x1c>
xor    %eax,%eax
nop
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <ArrayLen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ArrayLen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %15, label %7
7: ; preds = %3, %7
%8 = phi i32 [ %11, %7 ], [ 0, %3 ]
%9 = phi i8* [ %10, %7 ], [ %0, %3 ]
%10 = getelementptr i8, i8* %9, i64 8
%11 = add nuw nsw i32 %8, 1
%12 = bitcast i8* %10 to i8**
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %7
15: ; preds = %7, %3, %1
%16 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %11, %7 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  const char *helloString = "bum!";
  printf("Hello World\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"bum!\00"
@.str.1 = [13 x i8] c"Hello World\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int main(int argc, char *argv[]) {
  int x[1024];
#pragma acc data copyin(x [0:N])
  {
    int *xp;
#pragma acc host_data use_device(x)
    {
#pragma acc parallel copyout(xp)
      { xp = x; }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1010(%rbp),%rax
mov    %rax,-0x1018(%rbp)
xor    %eax,%eax
add    $0xfa0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i32]
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [1024 x i32], [1024 x i32]* %6, i64 0, i64 0
store i32* %8, i32** %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void demmt_nv_call_method_data(struct mmt_nvidia_call_method_data *call,
                               void *state) {}


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

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

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

LLVM IR (-O2):
%struct.mmt_nvidia_call_method_data = type opaque
define void @demmt_nv_call_method_data(%struct.mmt_nvidia_call_method_data* nocapture %0, i8* nocapture %1) {
ret void
}
int isoptionchar(char coal) { return (coal == '-'); }


x86 assembly (clang, -O0):
<isoptionchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isoptionchar>:
xor    %eax,%eax
cmp    $0x2d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isoptionchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 45
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isoptionchar(i8 signext %0) {
%2 = icmp eq i8 %0, 45
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int i;
  int j;
  i = j;
  int c;
  c = 0;
  int n;
  assume(n >= 50000);
  assume(n <= 100000);
  while (c < n) {
    i = i + 1;
    j = j + 2;
    c = c + 1;
  }
  assert(i + (n / 2) == j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xc350,-0x14(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
cmpl   $0x186a0,-0x14(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1190 <main+0x70>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1164 <main+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <assume@plt>
mov    $0x1,%edi
call   1040 <assume@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* %3
store i32 %6, i32* %2
store i32 0, i32* %4
%7 = load i32, i32* %5
%8 = icmp sge i32 %7, 50000
%9 = zext i1 %8 to i32
%10 = call i32 @assume(i32 %9)
%11 = load i32, i32* %5
%12 = icmp sle i32 %11, 100000
%13 = zext i1 %12 to i32
%14 = call i32 @assume(i32 %13)
br label %15
15: ; preds = %19, %0
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 2
store i32 %23, i32* %3
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %15
26: ; preds = %15
%27 = load i32, i32* %2
%28 = load i32, i32* %5
%29 = sdiv i32 %28, 2
%30 = add nsw i32 %27, %29
%31 = load i32, i32* %3
%32 = icmp eq i32 %30, %31
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 1)
%2 = tail call i32 @assume(i32 1)
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
int b_fun() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @b_fun() {
ret i32 0
}
double do_fprem1(void) {
  double res;
  __asm__ __volatile__("ffree %%st(0)\n\t"
                       "ffree %%st(1)\n\t"
                       "fldpi\n\t"
                       "fldln2\n\t"
                       "fprem1\n\t"
                       "fstpl 0(%0)"
                       :
                       : "r"(&res));
  return res;
}


x86 assembly (clang, -O0):
<do_fprem1>:
push   %rbp
mov    %rsp,%rbp
lea    -0x8(%rbp),%rax
ffree  %st(0)
ffree  %st(1)
fldpi
fldln2
fprem1
fstpl  (%rax)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_fprem1>:
lea    -0x8(%rsp),%rax
ffree  %st(0)
ffree  %st(1)
fldpi
fldln2
fprem1
fstpl  (%rax)
movsd  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @do_fprem1() {
%1 = alloca double
%2 = load double, double* %1
ret double %2
}

LLVM IR (-O2):
define double @do_fprem1() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = load double, double* %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 1;
  printf("!(a-2)\t%d\n", !(a - 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"!(a-2)\09%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 2
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"!(a-2)\09%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f(short *);
main() {
  short x = -10;
  if (!f(&x))
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0xfff6,-0x6(%rbp)
lea    -0x6(%rbp),%rdi
call   1040 <f@plt>
cmp    $0x0,%eax
jne    115e <main+0x2e>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0xfff6,0x6(%rsp)
lea    0x6(%rsp),%rdi
call   1040 <f@plt>
test   %eax,%eax
jne    114d <main+0x1d>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
store i16 -10, i16* %2
%3 = call i32 @f(i16* %2)
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
store i16 -10, i16* %1
%3 = call i32 @f(i16* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = call i32 @exit(i32 0)
unreachable
}
long double testl(long double x, int sel1, int sel2) {
  long double input = sel1 ? -x : x + 1;
  if (sel2)
    return __builtin_cosl(input);
  else
    return __builtin_coshl(input);
}


x86 assembly (clang, -O0):
<testl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
mov    %edi,-0x24(%rbp)
mov    %esi,-0x28(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     114b <testl+0x2b>
fldt   -0x20(%rbp)
fchs
fstpt  -0x4c(%rbp)
jmp    1155 <testl+0x35>
fldt   -0x20(%rbp)
fld1
faddp  %st,%st(1)
fstpt  -0x4c(%rbp)
fldt   -0x4c(%rbp)
fstpt  -0x40(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     117a <testl+0x5a>
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <cosl@plt>
fstpt  -0x10(%rbp)
jmp    118a <testl+0x6a>
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <coshl@plt>
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
test   %edi,%edi
fld    %st(0)
fchs
fld1
faddp  %st,%st(2)
fcmove %st(1),%st
fstp   %st(1)
test   %esi,%esi
je     1147 <testl+0x27>
fstpt  (%rsp)
call   1040 <cosl@plt>
add    $0x18,%rsp
ret
fstpt  (%rsp)
call   1030 <coshl@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define x86_fp80 @testl(x86_fp80 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = fneg x86_fp80 %0
%6 = fadd x86_fp80 %0, 0xK3FFF8000000000000000
%7 = select i1 %4, x86_fp80 %6, x86_fp80 %5
%8 = icmp eq i32 %2, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call x86_fp80 @cosl(x86_fp80 %7)
br label %13
11: ; preds = %3
%12 = tail call x86_fp80 @coshl(x86_fp80 %7)
br label %13
13: ; preds = %11, %9
%14 = phi x86_fp80 [ %10, %9 ], [ %12, %11 ]
ret x86_fp80 %14
}
int lsh_overflow(int a, int b) { return a << b; }


x86 assembly (clang, -O0):
<lsh_overflow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsh_overflow>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @lsh_overflow(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 = shl i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @lsh_overflow(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ kcurses_addch(int /*<<< orphan*/);
void kcurses_addstr(const char *str) {
  while (*str)
    kcurses_addch(*str++);
}


x86 assembly (clang, -O0):
<kcurses_addstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <kcurses_addstr+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <kcurses_addch@plt>
jmp    111c <kcurses_addstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @kcurses_addstr(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 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @kcurses_addch(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @kcurses_addstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @kcurses_addch(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int max(int left, int right) { return right > left ? right : left; }


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

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_duplicate_indicator();
int main() {
  test_duplicate_indicator();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_duplicate_indicator@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_duplicate_indicator@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_duplicate_indicator()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_duplicate_indicator()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nrerror(char *);
void usage(void) {
  nrerror("usage: AnalyseSeqs [-X[bswnm]] [-Q] [-M{mask}] \n"
          "                   [-D{H|A[,cost]|G[,cost1,cost2]}] [-d{D|B|H|S}]");
}


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

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

LLVM IR (-O0):
@.str = [114 x i8] c"usage: AnalyseSeqs [-X[bswnm]] [-Q] [-M{mask}] \0A [-D{H|A[,cost]|G[,cost1,cost2]}] [-d{D|B|H|S}]\00"
define void @usage() {
%1 = call i32 @nrerror(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [114 x i8] c"usage: AnalyseSeqs [-X[bswnm]] [-Q] [-M{mask}] \0A [-D{H|A[,cost]|G[,cost1,cost2]}] [-d{D|B|H|S}]\00"
define void @usage() {
%1 = tail call i32 @nrerror(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_55int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x55 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_55int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 85
%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_55int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 5570560
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void afficheMot(char *mot) {
  int i = 0;
  while (mot[i] != '\0') {
    printf("%c", mot[i]);
    i++;
  }
  printf(" ");
}


x86 assembly (clang, -O0):
<afficheMot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1160 <afficheMot+0x50>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <afficheMot+0x13>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficheMot>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <afficheMot+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 <afficheMot+0x10>
mov    $0x20,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @afficheMot(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = sext i8 %6 to i32
%8 = tail call i32 @putchar(i32 %7)
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = tail call i32 @putchar(i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error_msg(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void exec_error(const char *argv0) {
  error_msg("Unable to exec '%s': %s", argv0, strerror(errno));
}


x86 assembly (clang, -O0):
<exec_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb1(%rip),%rdi
call   1030 <error_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_error>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <error_msg@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Unable to exec '%s': %s\00"
@errno = global i32 0
define void @exec_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i32 @strerror(i32 %4)
%6 = call i32 @error_msg(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Unable to exec '%s': %s\00"
@errno = global i32 0
define void @exec_error(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @strerror(i32 %2)
%4 = tail call i32 @error_msg(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char result[1024];
  itoa(111, result, 7);
  printf("%d\n", 111);
  printf("%s\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rsi
mov    $0x6f,%edi
mov    $0x7,%edx
call   1040 <itoa@plt>
lea    0xeb1(%rip),%rdi
mov    $0x6f,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x410(%rbp),%rsi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    $0x6f,%edi
mov    %rbx,%rsi
mov    $0x7,%edx
call   1050 <itoa@plt>
lea    0xeac(%rip),%rdi
mov    $0x6f,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @itoa(i32 111, i8* %3, i32 7)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 111)
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @itoa(i32 111, i8* %2, i32 7)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 111)
%5 = call i32 @puts(i8* %2)
ret i32 0
}
int max(int i, int j, int k) {
  int mid = i > j ? i : j;
  return mid > k ? mid : k;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1124 <max+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112a <max+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1147 <max+0x47>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    114d <max+0x4d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
cmp    %edx,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %0, i32 %1
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %5, i32 %2
ret i32 %7
}
/* Variables and functions */
float __ocml_log10_f32(float);
float __log10f(float x) { return __ocml_log10_f32(x); }


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

x86 assembly (clang, -O2):
<__log10f>:
jmp    1030 <__ocml_log10_f32@plt>

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

LLVM IR (-O2):
define float @__log10f(float %0) {
%2 = tail call float @__ocml_log10_f32(float %0)
ret float %2
}
__attribute__((no, noclone)) int f7(int x) { return x > 0 ? ~x : x; }


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111f <f7+0x1f>
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <f7+0x25>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
neg    %eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = xor i32 %6, -1
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @f7(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = sext i1 %2 to i32
%4 = xor i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ xrd_SL();
int x_rev() {
  (void)xrd_SL();
  return (0);
}


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

x86 assembly (clang, -O2):
<x_rev>:
push   %rax
xor    %eax,%eax
call   1030 <xrd_SL@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @x_rev() {
%1 = call i32 (...) @xrd_SL()
ret i32 0
}

LLVM IR (-O2):
define i32 @x_rev() {
%1 = tail call i32 (...) @xrd_SL()
ret i32 0
}
void java_io_FileDescriptor_oneTimeInitialization__() {}


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

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

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

LLVM IR (-O2):
define void @java_io_FileDescriptor_oneTimeInitialization__() {
ret void
}
int test_imm_E8uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xE8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E8uint64_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, 232
%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_E8uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15204352
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}