xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cputc(int);
void cputw(int c) {
  cputc(c >> 8);
  cputc(c);
}


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

x86 assembly (clang, -O2):
<cputw>:
push   %rbx
mov    %edi,%ebx
sar    $0x8,%edi
call   1030 <cputc@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <cputc@plt>

LLVM IR (-O0):
define void @cputw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = call i32 @cputc(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @cputc(i32 %6)
ret void
}

LLVM IR (-O2):
define void @cputw(i32 %0) {
%2 = ashr i32 %0, 8
%3 = tail call i32 @cputc(i32 %2)
%4 = tail call i32 @cputc(i32 %0)
ret void
}
/* Variables and functions */
float sqrt(int);
int exact_square(int a) {
  float IS_square;
  IS_square = sqrt(a);
  if (IS_square - (int)IS_square == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvttss2si -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1158 <exact_square+0x48>
jp     1158 <exact_square+0x48>
movl   $0x1,-0x4(%rbp)
jmp    115f <exact_square+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
push   %rax
call   1030 <sqrt@plt>
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cmpeqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @exact_square(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call float @sqrt(i32 %5)
store float %6, float* %4
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fptosi float %8 to i32
%10 = sitofp i32 %9 to float
%11 = fsub float %7, %10
%12 = fcmp oeq float %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = tail call float @sqrt(i32 %0)
%3 = fptosi float %2 to i32
%4 = sitofp i32 %3 to float
%5 = fsub float %2, %4
%6 = fcmp oeq float %5, 0.000000e+00
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printString(char *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ uintToBase(int /*<<< orphan*/, char *, int);
void printHex(uint64_t num) {
  static char buffer[64] = {'0'};
  uintToBase(num, buffer, 16);
  printString(buffer, 0, 155, 255);
}


x86 assembly (clang, -O0):
<printHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f0b(%rip),%rsi
mov    $0x10,%edx
call   1030 <uintToBase@plt>
lea    0x2efa(%rip),%rdi
xor    %esi,%esi
mov    $0x9b,%edx
mov    $0xff,%ecx
call   1040 <printString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHex>:
push   %rbx
lea    0x2f18(%rip),%rbx
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <uintToBase@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x9b,%edx
mov    $0xff,%ecx
pop    %rbx
jmp    1040 <printString@plt>

LLVM IR (-O0):
@printHex.buffer = internal global <{ i8, [63 x i8] }> <{ i8 48, [63 x i8] zeroinitializer }>
define void @printHex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @uintToBase(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* bitcast (<{ i8, [63 x i8] }>* @printHex.buffer to [64 x i8]*), i64 0, i64 0), i32 16)
%5 = call i32 @printString(i8* getelementptr inbounds ([64 x i8], [64 x i8]* bitcast (<{ i8, [63 x i8] }>* @printHex.buffer to [64 x i8]*), i64 0, i64 0), i32 0, i32 155, i32 255)
ret void
}

LLVM IR (-O2):
@printHex.buffer = internal global <{ i8, [63 x i8] }> <{ i8 48, [63 x i8] zeroinitializer }>
define void @printHex(i32 %0) {
%2 = tail call i32 @uintToBase(i32 %0, i8* getelementptr inbounds (<{ i8, [63 x i8] }>, <{ i8, [63 x i8] }>* @printHex.buffer, i64 0, i32 0), i32 16)
%3 = tail call i32 @printString(i8* getelementptr inbounds (<{ i8, [63 x i8] }>, <{ i8, [63 x i8] }>* @printHex.buffer, i64 0, i32 0), i32 0, i32 155, i32 255)
ret void
}
int test_imm_69uint8_mem(unsigned char *val) {
  return ((*val) & (0x69 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_69uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 105
%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_69uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 105
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ omap_enable_layer(int /*<<< orphan*/);
void pl_vout_close(void) { omap_enable_layer(0); }


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

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

LLVM IR (-O0):
define void @pl_vout_close() {
%1 = call i32 @omap_enable_layer(i32 0)
ret void
}

LLVM IR (-O2):
define void @pl_vout_close() {
%1 = tail call i32 @omap_enable_layer(i32 0)
ret void
}
void drawCharacterSelect() {}


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

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

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

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

/* Variables and functions */
int dumpllitem(struct ll *, int);
void dumpllitems(struct ll *list) {
  int i, ret = 0;
  for (i = 0; ret != 1; i++) {
    ret = dumpllitem(list, i);
  }
}


x86 assembly (clang, -O0):
<dumpllitems>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x10(%rbp)
je     1151 <dumpllitems+0x41>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <dumpllitem@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <dumpllitems+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpllitems>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <dumpllitem@plt>
add    $0x1,%ebp
cmp    $0x1,%eax
jne    1120 <dumpllitems+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.ll = type { i32 }
define void @dumpllitems(%struct.ll* %0) {
%2 = alloca %struct.ll*
%3 = alloca i32
%4 = alloca i32
store %struct.ll* %0, %struct.ll** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load %struct.ll*, %struct.ll** %2
%10 = load i32, i32* %3
%11 = call i32 @dumpllitem(%struct.ll* %9, i32 %10)
store i32 %11, i32* %4
br label %12
12: ; preds = %8
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.ll = type { i32 }
define void @dumpllitems(%struct.ll* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @dumpllitem(%struct.ll* %0, i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %4, 1
br i1 %6, label %7, label %2
7: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, ...);
void Jump(char *label) {
  Inst_Printf("ba", "%s", label);
  Inst_Printf("nop", "");
}


x86 assembly (clang, -O0):
<Jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
lea    0xeca(%rip),%rdi
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Jump>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
xor    %eax,%eax
call   1030 <Inst_Printf@plt>
lea    0xed6(%rip),%rdi
lea    0xecb(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ba\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"nop\00"
@.str.3 = [1 x i8] zeroinitializer
define void @Jump(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ba\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"nop\00"
@.str.3 = [1 x i8] zeroinitializer
define void @Jump(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void pthread_testcancel(void) {}


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

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

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

LLVM IR (-O2):
define void @pthread_testcancel() {
ret void
}
/* Type definitions */
typedef size_t off_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *mem_address(off_t offset, size_t len, int read, void *userdata) {
  void *data = userdata;
  assert(offset + len <= ((size_t)1024 * 1024 * 1024));
  assert(read || !read);
  return data + offset;
}


x86 assembly (clang, -O0):
<mem_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
cmp    $0x40000000,%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x29(%rbp)
jne    1165 <mem_address+0x55>
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x28(%rbp),%rax
add    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_address>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdi,%r14
add    %rdi,%rsi
xor    %edi,%edi
cmp    $0x40000001,%rsi
setb   %dil
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
add    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mem_address(i64 %0, i64 %1, i32 %2, i8* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i8*, i8** %8
store i8* %10, i8** %9
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = add i64 %11, %12
%14 = icmp ule i64 %13, 1073741824
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %7
%18 = icmp ne i32 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %4
%20 = load i32, i32* %7
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
br label %23
23: ; preds = %19, %4
%24 = phi i1 [ true, %4 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = load i8*, i8** %9
%28 = load i64, i64* %5
%29 = getelementptr i8, i8* %27, i64 %28
ret i8* %29
}

LLVM IR (-O2):
define i8* @mem_address(i64 %0, i64 %1, i32 %2, i8* readnone %3) {
%5 = add i64 %1, %0
%6 = icmp ult i64 %5, 1073741825
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @assert(i32 1)
%10 = getelementptr i8, i8* %3, i64 %0
ret i8* %10
}
void mcapi_set_debug_level(int d) {}


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

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

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

LLVM IR (-O2):
define void @mcapi_set_debug_level(i32 %0) {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
scalar_t__ fstat(int /*<<< orphan*/, struct stat *);
bool check_file(FILE *file) {
  struct stat statbuf;
  if (fstat(fileno(file), &statbuf) < 0)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<check_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,%edi
lea    -0x18(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0x0,%rax
jge    1156 <check_file+0x36>
movl   $0x0,-0x4(%rbp)
jmp    115d <check_file+0x3d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_file>:
push   %rax
call   1030 <fileno@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1040 <fstat@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @check_file(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca %struct.stat
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @fileno(i32* %5)
%7 = call i64 @fstat(i32 %6, %struct.stat* %4)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @check_file(i32* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i32 @fileno(i32* %0)
%5 = call i64 @fstat(i32 %4, %struct.stat* %2)
%6 = lshr i64 %5, 63
%7 = trunc i64 %6 to i32
%8 = xor i32 %7, 1
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ __le64;

/* Variables and functions */
int /*<<< orphan*/ htole64(int /*<<< orphan*/);
__le64 cpu_to_le64(uint64_t x) { return (__le64)htole64(x); }


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

x86 assembly (clang, -O2):
<cpu_to_le64>:
jmp    1030 <htole64@plt>

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

LLVM IR (-O2):
define i32 @cpu_to_le64(i32 %0) {
%2 = tail call i32 @htole64(i32 %0)
ret i32 %2
}
int top(int *a, int *top1) { return *(a + *(top1)); }


x86 assembly (clang, -O0):
<top>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<top>:
movslq (%rsi),%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @top(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 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @top(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ IniAf_lc898122_sharp();
int /*<<< orphan*/ IniClk_lc898122_sharp();
int /*<<< orphan*/ IniCmd_lc898122_sharp();
void IniSetAf_lc898122_sharp(void) {
  IniCmd_lc898122_sharp();
  IniClk_lc898122_sharp();
  IniAf_lc898122_sharp();
}


x86 assembly (clang, -O0):
<IniSetAf_lc898122_sharp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <IniCmd_lc898122_sharp@plt>
mov    $0x0,%al
call   1030 <IniClk_lc898122_sharp@plt>
mov    $0x0,%al
call   1040 <IniAf_lc898122_sharp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IniSetAf_lc898122_sharp>:
push   %rax
xor    %eax,%eax
call   1050 <IniCmd_lc898122_sharp@plt>
xor    %eax,%eax
call   1030 <IniClk_lc898122_sharp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <IniAf_lc898122_sharp@plt>

LLVM IR (-O0):
define void @IniSetAf_lc898122_sharp() {
%1 = call i32 (...) @IniCmd_lc898122_sharp()
%2 = call i32 (...) @IniClk_lc898122_sharp()
%3 = call i32 (...) @IniAf_lc898122_sharp()
ret void
}

LLVM IR (-O2):
define void @IniSetAf_lc898122_sharp() {
%1 = tail call i32 (...) @IniCmd_lc898122_sharp()
%2 = tail call i32 (...) @IniClk_lc898122_sharp()
%3 = tail call i32 (...) @IniAf_lc898122_sharp()
ret void
}
int __mp_writecontents(char *s, void *p) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__mp_writecontents(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isREAD(const char *tok) { return strcmp(tok, "read") == 0; }


x86 assembly (clang, -O0):
<isREAD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isREAD>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"read\00"
define i32 @isREAD(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"read\00"
define i32 @isREAD(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
scalar_t__ sg_get_unaligned_be16(void const *);
int sg_get_unaligned_be32(int /*<<< orphan*/ const *);
uint64_t sg_get_unaligned_be48(const void *p) {
  return (uint64_t)sg_get_unaligned_be16(p) << 32 |
         sg_get_unaligned_be32((const uint8_t *)p + 2);
}


x86 assembly (clang, -O0):
<sg_get_unaligned_be48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sg_get_unaligned_be16@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1040 <sg_get_unaligned_be32@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_get_unaligned_be48>:
push   %rbx
mov    %rdi,%rbx
call   1030 <sg_get_unaligned_be16@plt>
add    $0x8,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <sg_get_unaligned_be32@plt>

LLVM IR (-O0):
define i32 @sg_get_unaligned_be48(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @sg_get_unaligned_be16(i8* %3)
%5 = trunc i64 %4 to i32
%6 = shl i32 %5, 32
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = call i32 @sg_get_unaligned_be32(i32* %9)
%11 = or i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @sg_get_unaligned_be48(i8* %0) {
%2 = tail call i64 @sg_get_unaligned_be16(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 8
%4 = bitcast i8* %3 to i32*
%5 = tail call i32 @sg_get_unaligned_be32(i32* %4)
ret i32 poison
}
/* Variables and functions */
int yogrt_get_interval1();
int iyogrt_get_interval1__(void) { return yogrt_get_interval1(); }


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

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

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

LLVM IR (-O2):
define i32 @iyogrt_get_interval1__() {
%1 = tail call i32 (...) @yogrt_get_interval1()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ spawn(char *, char **);
int main() {
  char *arg_list[] = {"ls", "-l", "/", NULL};
  spawn("ls", arg_list);
  printf("Done with main program\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2cca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cc7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2cc4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cc1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1040 <spawn@plt>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0x2ce5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2cc9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xebe(%rip),%rdi
mov    %rsp,%rsi
call   1040 <spawn@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [2 x i8] c"/\00"
@__const.main.arg_list = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.3 = [24 x i8] c"Done with main program\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8*]
store i32 0, i32* %1
%3 = bitcast [4 x i8*]* %2 to i8*
%4 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%5 = call i32 @spawn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [2 x i8] c"/\00"
@__const.main.arg_list = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* null]
@str = [23 x i8] c"Done with main program\00"
define i32 @main() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%4 = call i32 @spawn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void mdp4_dma_e_done_dtv(void) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_dma_e_done_dtv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPI_IOC_WR_MODE;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int *);
void setupspi(int fd) {
  int mode = 0;
  ioctl(fd, SPI_IOC_WR_MODE, &mode);
}


x86 assembly (clang, -O0):
<setupspi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupspi>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rax
ret

LLVM IR (-O0):
@SPI_IOC_WR_MODE = global i32 0
define void @setupspi(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SPI_IOC_WR_MODE
%6 = call i32 @ioctl(i32 %4, i32 %5, i32* %3)
ret void
}

LLVM IR (-O2):
@SPI_IOC_WR_MODE = global i32 0
define void @setupspi(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* @SPI_IOC_WR_MODE
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
ret void
}
void foo692() {}


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

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

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

LLVM IR (-O2):
define void @foo692() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *freer(void *ptr) {
  free(ptr);
  return (NULL);
}


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

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

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

LLVM IR (-O2):
define noalias i8* @freer(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i8* null
}
/* Variables and functions */
int exp(double const);
double soft_plus_gradient(const double x) { return 1. / (1. + exp(-x)); }


x86 assembly (clang, -O0):
<soft_plus_gradient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeaa(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soft_plus_gradient>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm1
movsd  0xee7(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @soft_plus_gradient(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i32 @exp(double %4)
%6 = sitofp i32 %5 to double
%7 = fadd double 1.000000e+00, %6
%8 = fdiv double 1.000000e+00, %7
ret double %8
}

LLVM IR (-O2):
define double @soft_plus_gradient(double %0) {
%2 = fneg double %0
%3 = tail call i32 @exp(double %2)
%4 = sitofp i32 %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double 1.000000e+00, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ timesup();
void *time_prnt(void *q) {
  while (2) {
    timesup();
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<time_prnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <timesup@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112c <time_prnt+0xc>

x86 assembly (clang, -O2):
<time_prnt>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <timesup@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <time_prnt+0x10>

LLVM IR (-O0):
define i8* @time_prnt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @timesup()
%5 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
define noalias i8* @time_prnt(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @timesup()
%4 = tail call i32 @sleep(i32 1)
br label %2
}
/* Variables and functions */
void *memdup_suffix0(void const *, size_t);
scalar_t__ size_multiply_overflow(size_t, size_t);
void *memdup_suffix0_multiply(const void *p, size_t size, size_t need) {
  if (size_multiply_overflow(size, need))
    return NULL;
  return memdup_suffix0(p, size * need);
}


x86 assembly (clang, -O0):
<memdup_suffix0_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <size_multiply_overflow@plt>
cmp    $0x0,%rax
je     1158 <memdup_suffix0_multiply+0x38>
movq   $0x0,-0x8(%rbp)
jmp    116e <memdup_suffix0_multiply+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
imul   -0x20(%rbp),%rsi
call   1040 <memdup_suffix0@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup_suffix0_multiply>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <size_multiply_overflow@plt>
test   %rax,%rax
je     1146 <memdup_suffix0_multiply+0x26>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
imul   %r15,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memdup_suffix0@plt>

LLVM IR (-O0):
define i8* @memdup_suffix0_multiply(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %6
%9 = load i64, i64* %7
%10 = call i64 @size_multiply_overflow(i64 %8, i64 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
store i8* null, i8** %4
br label %19
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = load i64, i64* %7
%17 = mul i64 %15, %16
%18 = call i8* @memdup_suffix0(i8* %14, i64 %17)
store i8* %18, i8** %4
br label %19
19: ; preds = %13, %12
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
define i8* @memdup_suffix0_multiply(i8* %0, i64 %1, i64 %2) {
%4 = tail call i64 @size_multiply_overflow(i64 %1, i64 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = mul i64 %2, %1
%8 = tail call i8* @memdup_suffix0(i8* %0, i64 %7)
br label %9
9: ; preds = %3, %6
%10 = phi i8* [ %8, %6 ], [ null, %3 ]
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int timlib_get_line(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int get_line(char *in_line, FILE *infile) {
  return timlib_get_line(in_line, infile, 0);
}


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

x86 assembly (clang, -O2):
<get_line>:
xor    %edx,%edx
jmp    1030 <timlib_get_line@plt>

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

LLVM IR (-O2):
define i32 @get_line(i8* %0, i32* %1) {
%3 = tail call i32 @timlib_get_line(i8* %0, i32* %1, i32 0)
ret i32 %3
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 && (*s1 == *s2)) {
    s1++;
    s2++;
  }
  return *s1 - *s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movsbl %al,%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br label %18
18: ; preds = %10, %5
%19 = phi i1 [ false, %5 ], [ %17, %10 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = sext i8 %18 to i32
%20 = load i8, i8* %17
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
float menor_nota(float valor[3]) {
  float menor = valor[0];
  for (int i = 1; i < 3; i++)
    if (valor[i] < menor)
      menor = valor[i];
  return menor;
}


x86 assembly (clang, -O0):
<menor_nota>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1166 <menor_nota+0x66>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1153 <menor_nota+0x53>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1158 <menor_nota+0x58>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <menor_nota+0x1c>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<menor_nota>:
movss  0x4(%rdi),%xmm1
movss  0x8(%rdi),%xmm0
minss  (%rdi),%xmm1
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @menor_nota(float* %0) {
%2 = alloca float*
%3 = alloca float
%4 = alloca i32
store float* %0, float** %2
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
store float %7, float* %3
store i32 1, i32* %4
br label %8
8: ; preds = %26, %1
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load float*, float** %2
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds float, float* %12, i64 %14
%16 = load float, float* %15
%17 = load float, float* %3
%18 = fcmp olt float %16, %17
br i1 %18, label %19, label %25
19: ; preds = %11
%20 = load float*, float** %2
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds float, float* %20, i64 %22
%24 = load float, float* %23
store float %24, float* %3
br label %25
25: ; preds = %19, %11
br label %26
26: ; preds = %25
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %8
29: ; preds = %8
%30 = load float, float* %3
ret float %30
}

LLVM IR (-O2):
define float @menor_nota(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fcmp olt float %4, %2
%6 = select i1 %5, float %4, float %2
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = fcmp olt float %8, %6
%10 = select i1 %9, float %8, float %6
ret float %10
}
int isleap(int year) {
  return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
}


x86 assembly (clang, -O0):
<isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <isleap+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <isleap+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleap>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <isleap+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <isleap+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isleap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
ic() { printf("Indie, Chiny"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Indie, Chiny\00"
define i32 @ic() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"Indie, Chiny\00"
define i32 @ic() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ cmp_immediate_test();
int /*<<< orphan*/ cmp_memory_test();
int /*<<< orphan*/ cmp_register_test();
int /*<<< orphan*/ complement_accumulator_test();
int /*<<< orphan*/ complement_carry_test();
int /*<<< orphan*/ set_carry_test();
int main(int argc, const char *argv[]) {
  cmp_register_test();
  cmp_memory_test();
  cmp_immediate_test();
  complement_accumulator_test();
  complement_carry_test();
  set_carry_test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <cmp_register_test@plt>
mov    $0x0,%al
call   1080 <cmp_memory_test@plt>
mov    $0x0,%al
call   1050 <cmp_immediate_test@plt>
mov    $0x0,%al
call   1040 <complement_accumulator_test@plt>
mov    $0x0,%al
call   1060 <complement_carry_test@plt>
mov    $0x0,%al
call   1030 <set_carry_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <cmp_register_test@plt>
xor    %eax,%eax
call   1080 <cmp_memory_test@plt>
xor    %eax,%eax
call   1050 <cmp_immediate_test@plt>
xor    %eax,%eax
call   1040 <complement_accumulator_test@plt>
xor    %eax,%eax
call   1060 <complement_carry_test@plt>
xor    %eax,%eax
call   1030 <set_carry_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @cmp_register_test()
%7 = call i32 (...) @cmp_memory_test()
%8 = call i32 (...) @cmp_immediate_test()
%9 = call i32 (...) @complement_accumulator_test()
%10 = call i32 (...) @complement_carry_test()
%11 = call i32 (...) @set_carry_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @cmp_register_test()
%4 = tail call i32 (...) @cmp_memory_test()
%5 = tail call i32 (...) @cmp_immediate_test()
%6 = tail call i32 (...) @complement_accumulator_test()
%7 = tail call i32 (...) @complement_carry_test()
%8 = tail call i32 (...) @set_carry_test()
ret i32 0
}
int func1() { return 4; }


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

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

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

LLVM IR (-O2):
define i32 @func1() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int inet_pton(int /*<<< orphan*/, char *, unsigned int *);
int ip_str_to_int(char *ip_str, unsigned int *ip) {
  return inet_pton(AF_INET, ip_str, ip);
}


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

x86 assembly (clang, -O2):
<ip_str_to_int>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <inet_pton@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
define i32 @ip_str_to_int(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @AF_INET
%6 = load i8*, i8** %3
%7 = load i32*, i32** %4
%8 = call i32 @inet_pton(i32 %5, i8* %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
@AF_INET = global i32 0
define i32 @ip_str_to_int(i8* %0, i32* %1) {
%3 = load i32, i32* @AF_INET
%4 = tail call i32 @inet_pton(i32 %3, i8* %0, i32* %1)
ret i32 %4
}
int test_imm_7Fint64_midword_reg(long long val) {
  return ((val >> 16) & (0x7F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Fint64_midword_reg>:
test   $0x7f0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Fint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 127
%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_7Fint64_midword_reg(i64 %0) {
%2 = and i64 %0, 8323072
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exec_shr(int, int, int);
void test_shr(void) {
  int i;
  for (i = 0; i < 32; i++)
    exec_shr(0x21ad3d34, 0x12345678, i);
  for (i = 0; i < 32; i++)
    exec_shr(0x813f3421, 0x82345678, i);
}


x86 assembly (clang, -O0):
<test_shr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    1149 <test_shr+0x39>
mov    -0x4(%rbp),%edx
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
call   1030 <exec_shr@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test_shr+0xf>
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    117a <test_shr+0x6a>
mov    -0x4(%rbp),%edx
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
call   1030 <exec_shr@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <test_shr+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_shr>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
mov    %ebx,%edx
call   1030 <exec_shr@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1120 <test_shr+0x10>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
mov    %ebx,%edx
call   1030 <exec_shr@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1140 <test_shr+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_shr() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 32
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @exec_shr(i32 565001524, i32 305419896, i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
store i32 0, i32* %1
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 32
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %1
%17 = call i32 @exec_shr(i32 -2126564319, i32 -2110499208, i32 %16)
br label %18
18: ; preds = %15
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %12
21: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @test_shr() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @exec_shr(i32 565001524, i32 305419896, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = tail call i32 @exec_shr(i32 -2126564319, i32 -2110499208, i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %6
11: ; preds = %6
ret void
}
void emitheader(void) {}


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

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

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

LLVM IR (-O2):
define void @emitheader() {
ret void
}