xunge/DecIR huggingface dataset:
void glViewport(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glViewport() {
ret void
}
void glLoadMatrixx(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glLoadMatrixx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __softboundcets_abort();
int atoi(char const *);
__attribute__((__weak__, __always___)) int softboundcets_atoi(const char *ptr) {
  if (ptr == NULL) {
    __softboundcets_abort();
  }
  return atoi(ptr);
}


x86 assembly (clang, -O0):
<softboundcets_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <softboundcets_atoi+0x1e>
mov    $0x0,%al
call   1040 <__softboundcets_abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_atoi>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1130 <softboundcets_atoi+0x10>
xor    %eax,%eax
call   1040 <__softboundcets_abort@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <atoi@plt>

LLVM IR (-O0):
define weak i32 @softboundcets_atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @__softboundcets_abort()
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
%9 = call i32 @atoi(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define weak i32 @softboundcets_atoi(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @__softboundcets_abort()
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @atoi(i8* %0)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int kill(pid_t pid, int sig) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @kill(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ gpio_init();
int /*<<< orphan*/ gpio_sio(int, int);
int /*<<< orphan*/ stoi(char *);
int /*<<< orphan*/ write_setting(int /*<<< orphan*/, char, int /*<<< orphan*/);
int main(int argc, char **argv) {
  gpio_init();
  gpio_sio(27, 1);
  write_setting(stoi(*(argv + 1)), **(argv + 2), stoi(*(argv + 3)));
  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)
mov    $0x0,%al
call   1060 <gpio_init@plt>
mov    $0x1b,%edi
mov    $0x1,%esi
call   1040 <gpio_sio@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <stoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <stoi@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%edx
mov    -0x11(%rbp),%al
movsbl %al,%esi
call   1030 <write_setting@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %eax,%eax
call   1060 <gpio_init@plt>
mov    $0x1b,%edi
mov    $0x1,%esi
call   1040 <gpio_sio@plt>
mov    0x8(%rbx),%rdi
call   1050 <stoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rax
mov    0x18(%rbx),%rdi
movsbl (%rax),%ebx
call   1050 <stoi@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <write_setting@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
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 (...) @gpio_init()
%7 = call i32 @gpio_sio(i32 27, i32 1)
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @stoi(i8* %10)
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = load i8, i8* %14
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 3
%18 = load i8*, i8** %17
%19 = call i32 @stoi(i8* %18)
%20 = call i32 @write_setting(i32 %11, i8 signext %15, i32 %19)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @gpio_init()
%4 = tail call i32 @gpio_sio(i32 27, i32 1)
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @stoi(i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8*, i8** %1, i64 3
%12 = load i8*, i8** %11
%13 = tail call i32 @stoi(i8* %12)
%14 = tail call i32 @write_setting(i32 %7, i8 signext %10, i32 %13)
ret i32 0
}
/* Type definitions */
typedef void uint8_t;
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
void *ptr_add(void *p, ptrdiff_t x) { return (uint8_t *)p + x; }


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

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

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

LLVM IR (-O2):
define i8* @ptr_add(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr i8, i8* %0, i64 %3
ret i8* %4
}
/* Variables and functions */
int symlink(char const *, char const *);
int _symlink(const char *target, const char *path) {
  return symlink(target, path);
}


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

x86 assembly (clang, -O2):
<_symlink>:
jmp    1030 <symlink@plt>

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

LLVM IR (-O2):
define i32 @_symlink(i8* %0, i8* %1) {
%3 = tail call i32 @symlink(i8* %0, i8* %1)
ret i32 %3
}
float test_01(int val) {
  char valbytes[sizeof(int)];
  __builtin_memcpy(valbytes, &val, sizeof(int));
  float result;
  __builtin_memcpy(&result, valbytes, sizeof(float));
  return result;
}


x86 assembly (clang, -O0):
<test_01>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_01>:
movd   %edi,%xmm0
ret

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

LLVM IR (-O2):
define float @test_01(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
void v9fs_readpage_to_fscache(struct inode *inode, struct page *page) {}


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
%struct.page = type opaque
define void @v9fs_readpage_to_fscache(%struct.inode* nocapture %0, %struct.page* nocapture %1) {
ret void
}
int test_imm_F5int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xF5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F5int64_highword_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, 32
%6 = and i64 %5, 245
%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_F5int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1052266987520
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double diff8360(double a, double b) {
  double d;
  d = a - b;
  if (d >= 180.0)
    return (d - 360.0);
  if (d < -180.0)
    return (d + 360.0);
  return (d);
}


x86 assembly (clang, -O0):
<diff8360>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     114f <diff8360+0x4f>
movsd  -0x20(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1183 <diff8360+0x83>
movsd  0xeb1(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1179 <diff8360+0x79>
movsd  0xea6(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1183 <diff8360+0x83>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff8360>:
subsd  %xmm1,%xmm0
ucomisd 0xef4(%rip),%xmm0
jae    1125 <diff8360+0x25>
movsd  0xefa(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1124 <diff8360+0x24>
addsd  0xef4(%rip),%xmm0
ret
addsd  0xedb(%rip),%xmm0
ret

LLVM IR (-O0):
define double @diff8360(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
store double %9, double* %6
%10 = load double, double* %6
%11 = fcmp oge double %10, 1.800000e+02
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load double, double* %6
%14 = fsub double %13, 3.600000e+02
store double %14, double* %3
br label %23
15: ; preds = %2
%16 = load double, double* %6
%17 = fcmp olt double %16, -1.800000e+02
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load double, double* %6
%20 = fadd double %19, 3.600000e+02
store double %20, double* %3
br label %23
21: ; preds = %15
%22 = load double, double* %6
store double %22, double* %3
br label %23
23: ; preds = %21, %18, %12
%24 = load double, double* %3
ret double %24
}

LLVM IR (-O2):
define double @diff8360(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fcmp ult double %3, 1.800000e+02
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = fadd double %3, -3.600000e+02
br label %11
7: ; preds = %2
%8 = fcmp olt double %3, -1.800000e+02
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = fadd double %3, 3.600000e+02
br label %11
11: ; preds = %7, %9, %5
%12 = phi double [ %6, %5 ], [ %10, %9 ], [ %3, %7 ]
ret double %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ FSETLOCKING_BYCALLER;
int /*<<< orphan*/ __fsetlocking(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fidopen(int, char const *);
FILE *get_std_stream(int fid, const char *mode) {
  FILE *term = fidopen(fid, mode);
  assert(term);
  __fsetlocking(term, FSETLOCKING_BYCALLER);
  return term;
}


x86 assembly (clang, -O0):
<get_std_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <fidopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
call   1050 <__fsetlocking@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_std_stream>:
push   %rbx
call   1040 <fidopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <__fsetlocking@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@FSETLOCKING_BYCALLER = global i32 0
define i32* @get_std_stream(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32* @fidopen(i32 %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = call i32 @assert(i32* %9)
%11 = load i32*, i32** %5
%12 = load i32, i32* @FSETLOCKING_BYCALLER
%13 = call i32 @__fsetlocking(i32* %11, i32 %12)
%14 = load i32*, i32** %5
ret i32* %14
}

LLVM IR (-O2):
@FSETLOCKING_BYCALLER = global i32 0
define i32* @get_std_stream(i32 %0, i8* %1) {
%3 = tail call i32* @fidopen(i32 %0, i8* %1)
%4 = tail call i32 @assert(i32* %3)
%5 = load i32, i32* @FSETLOCKING_BYCALLER
%6 = tail call i32 @__fsetlocking(i32* %3, i32 %5)
ret i32* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t test_key_hash(const void *ptr) {
  return ((uint32_t)(uintptr_t)ptr) >> 2;
}


x86 assembly (clang, -O0):
<test_key_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_key_hash>:
mov    %rdi,%rax
sar    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @test_key_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = ashr i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_key_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = ashr i32 %3, 2
ret i32 %4
}
__attribute__((weak)) void __hlt_modules_init(void *ctx) {}


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

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

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

LLVM IR (-O2):
define weak void @__hlt_modules_init(i8* %0) {
ret void
}
void hfixed_(i) int *i;
{ hfixedwidth(*i); }


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

x86 assembly (clang, -O2):
<hfixed_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <hfixedwidth@plt>

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

LLVM IR (-O2):
define void @hfixed_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @hfixedwidth to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *);
int main() {
  int n, c;
  c = scanf("%d", &n);
  while (c != 1) {
    c = scanf("%d", &n);
  }
  printf("%d \n", exact_square(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1174 <main+0x44>
lea    0xe9d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
jmp    1152 <main+0x22>
mov    -0x8(%rbp),%edi
call   1040 <exact_square@plt>
mov    %eax,%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1170 <main+0x40>
lea    0xeaf(%rip),%r14
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1160 <main+0x30>
mov    0x4(%rsp),%edi
call   1040 <exact_square@plt>
lea    0xe83(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %0, %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %5
8: ; preds = %5, %0
%9 = load i32, i32* %1
%10 = call i32 @exact_square(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ d2i_of_void;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ DSA;

/* Variables and functions */
int /*<<< orphan*/ *PEM_ASN1_read(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *, void **,
                                  int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ PEM_STRING_DSAPARAMS;
scalar_t__ d2i_DSAparams;
DSA *PEM_read_DSAparams(FILE *fp, DSA **x, pem_password_cb *cb, void *u) {
  return PEM_ASN1_read((d2i_of_void *)d2i_DSAparams, PEM_STRING_DSAPARAMS, fp,
                       (void **)x, cb, u);
}


x86 assembly (clang, -O0):
<PEM_read_DSAparams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <PEM_ASN1_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_DSAparams>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebd(%rip),%rax
mov    (%rax),%rdi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
jmp    1030 <PEM_ASN1_read@plt>

LLVM IR (-O0):
@d2i_DSAparams = global i64 0
@PEM_STRING_DSAPARAMS = global i32 0
define i32* @PEM_read_DSAparams(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i64, i64* @d2i_DSAparams
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* @PEM_STRING_DSAPARAMS
%12 = load i32*, i32** %5
%13 = load i32**, i32*** %6
%14 = bitcast i32** %13 to i8**
%15 = load i32*, i32** %7
%16 = load i8*, i8** %8
%17 = call i32* @PEM_ASN1_read(i32* %10, i32 %11, i32* %12, i8** %14, i32* %15, i8* %16)
ret i32* %17
}

LLVM IR (-O2):
@d2i_DSAparams = global i64 0
@PEM_STRING_DSAPARAMS = global i32 0
define i32* @PEM_read_DSAparams(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = load i64, i64* @d2i_DSAparams
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_DSAPARAMS
%8 = bitcast i32** %1 to i8**
%9 = tail call i32* @PEM_ASN1_read(i32* %6, i32 %7, i32* %0, i8** %8, i32* %2, i8* %3)
ret i32* %9
}
/* Variables and functions */
int ns2qsq();
int ns2qsq_(void) { return ns2qsq(); }


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

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

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

LLVM IR (-O2):
define i32 @ns2qsq_() {
%1 = tail call i32 (...) @ns2qsq()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sys_puts(char *);
int main(void) {
  sys_puts("Hello world\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 <sys_puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sys_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world\0A\00"
define i32 @main() {
%1 = tail call i32 @sys_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double dmin(double a, double b) { return (a < b ? a : b); }


x86 assembly (clang, -O0):
<dmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <dmin+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <dmin+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmin>:
minsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @dmin(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ oom_adj_to_oom_score_adj(int);
void oom_score_adj_conversion_1(void) { (void)oom_adj_to_oom_score_adj(16); }


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

x86 assembly (clang, -O2):
<oom_score_adj_conversion_1>:
mov    $0x10,%edi
jmp    1030 <oom_adj_to_oom_score_adj@plt>

LLVM IR (-O0):
define void @oom_score_adj_conversion_1() {
%1 = call i32 @oom_adj_to_oom_score_adj(i32 16)
ret void
}

LLVM IR (-O2):
define void @oom_score_adj_conversion_1() {
%1 = tail call i32 @oom_adj_to_oom_score_adj(i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
int assert_master(int condition) {
  if (!condition) {
    printf("\tTEST FAILED.\n");
  }
  assert(condition);
  return 0;
}


x86 assembly (clang, -O0):
<assert_master>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1141 <assert_master+0x21>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_master>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jne    1133 <assert_master+0x13>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\09TEST FAILED.\0A\00"
define i32 @assert_master(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"\09TEST FAILED.\00"
define i32 @assert_master(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @assert(i32 %0)
ret i32 0
}
/* Variables and functions */
scalar_t__ CoreTest();
scalar_t__ ModeTest();
scalar_t__ StreamTest();
int main() {
  if (CoreTest())
    return 1;
  if (ModeTest())
    return 1;
  if (StreamTest())
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <CoreTest@plt>
cmp    $0x0,%rax
je     115c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    119d <main+0x6d>
mov    $0x0,%al
call   1040 <ModeTest@plt>
cmp    $0x0,%rax
je     1179 <main+0x49>
movl   $0x1,-0x4(%rbp)
jmp    119d <main+0x6d>
mov    $0x0,%al
call   1030 <StreamTest@plt>
cmp    $0x0,%rax
je     1196 <main+0x66>
movl   $0x1,-0x4(%rbp)
jmp    119d <main+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <CoreTest@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    115d <main+0x2d>
xor    %eax,%eax
call   1040 <ModeTest@plt>
test   %rax,%rax
jne    115d <main+0x2d>
xor    %eax,%eax
call   1030 <StreamTest@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @CoreTest()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %14
5: ; preds = %0
%6 = call i64 (...) @ModeTest()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 1, i32* %1
br label %14
9: ; preds = %5
%10 = call i64 (...) @StreamTest()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 1, i32* %1
br label %14
13: ; preds = %9
store i32 0, i32* %1
br label %14
14: ; preds = %13, %12, %8, %4
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @CoreTest()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i64 (...) @ModeTest()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 (...) @StreamTest()
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %0 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
void XcmsTekHVCClipVC() {}


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

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

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

LLVM IR (-O2):
define void @XcmsTekHVCClipVC() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Mystrcpy(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char desc[20] = {0};
  char src[20] = "Hello World";
  Mystrcpy(desc, src);
  printf("%s\n", desc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1050 <memset@plt>
mov    0xeaa(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xea5(%rip),%eax
mov    %eax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <Mystrcpy@plt>
lea    -0x20(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x0,0x30(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0x20(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <Mystrcpy@plt>
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.src = [20 x i8] c"Hello World\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
store i32 0, i32* %1
%4 = bitcast [20 x i8]* %2 to i8*
%5 = bitcast [20 x i8]* %3 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = call i32 @Mystrcpy(i8* %6, i8* %7)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.src = [20 x i8] c"Hello World\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @Mystrcpy(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
struct udev_queue {
  int dummy;
};
struct udev_list_entry {
  int dummy;
};

/* Variables and functions */
__attribute__((visibility("default"))) struct udev_list_entry *
udev_queue_get_queued_list_entry(struct udev_queue *udev_queue) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.udev_list_entry = type { i32 }
%struct.udev_queue = type { i32 }
define %struct.udev_list_entry* @udev_queue_get_queued_list_entry(%struct.udev_queue* %0) {
%2 = alloca %struct.udev_queue*
store %struct.udev_queue* %0, %struct.udev_queue** %2
ret %struct.udev_list_entry* null
}

LLVM IR (-O2):
%struct.udev_list_entry = type { i32 }
%struct.udev_queue = type { i32 }
define noalias %struct.udev_list_entry* @udev_queue_get_queued_list_entry(%struct.udev_queue* nocapture readnone %0) {
ret %struct.udev_list_entry* null
}
/* Variables and functions */
int /*<<< orphan*/ additive_expr();
int /*<<< orphan*/ relational_expr_stub();
void relational_expr() {
  additive_expr();
  relational_expr_stub();
}


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

x86 assembly (clang, -O2):
<relational_expr>:
push   %rax
xor    %eax,%eax
call   1030 <additive_expr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <relational_expr_stub@plt>

LLVM IR (-O0):
define void @relational_expr() {
%1 = call i32 (...) @additive_expr()
%2 = call i32 (...) @relational_expr_stub()
ret void
}

LLVM IR (-O2):
define void @relational_expr() {
%1 = tail call i32 (...) @additive_expr()
%2 = tail call i32 (...) @relational_expr_stub()
ret void
}
int my_strlen(char *str) {
  char *s;
  s = str;
  while (*str)
    str++;
  return (str - s);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <my_strlen+0x2e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <my_strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo();
int main(void) {
  if (foo() != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x1,%eax
je     1146 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x1,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
unsigned char log2_approx(unsigned int x) {
  int i;
  unsigned char l2;
  l2 = 0;
  for (i = 0; i < 31; i++)
    if ((x & (1 << i)) != 0)
      l2 = i + 1;
  return (l2);
}


x86 assembly (clang, -O0):
<log2_approx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1f,-0x8(%rbp)
jge    1152 <log2_approx+0x52>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     113f <log2_approx+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x9(%rbp)
jmp    1144 <log2_approx+0x44>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <log2_approx+0x12>
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2_approx>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x1(%rcx),%edx
bt     %ecx,%edi
movzbl %al,%eax
movzbl %dl,%edx
cmovb  %edx,%eax
lea    0x2(%rcx),%esi
bt     %edx,%edi
movzbl %sil,%esi
cmovb  %esi,%eax
lea    0x3(%rcx),%edx
bt     %esi,%edi
cmovb  %edx,%eax
cmp    $0x1f,%edx
je     1150 <log2_approx+0x50>
add    $0x4,%cl
bt     %edx,%edi
movzbl %al,%esi
movzbl %cl,%eax
cmovae %esi,%eax
add    $0x1,%edx
mov    %edx,%ecx
jmp    1110 <log2_approx+0x10>
ret

LLVM IR (-O0):
define zeroext i8 @log2_approx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %2
store i8 0, i8* %4
store i32 0, i32* %3
br label %5
5: ; preds = %19, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 31
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = shl i32 1, %10
%12 = and i32 %9, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
%17 = trunc i32 %16 to i8
store i8 %17, i8* %4
br label %18
18: ; preds = %14, %8
br label %19
19: ; preds = %18
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %5
22: ; preds = %5
%23 = load i8, i8* %4
ret i8 %23
}

LLVM IR (-O2):
define zeroext i8 @log2_approx(i32 %0) {
br label %2
2: ; preds = %27, %1
%3 = phi i8 [ 0, %1 ], [ %33, %27 ]
%4 = phi i32 [ 0, %1 ], [ %34, %27 ]
%5 = shl nuw nsw i32 1, %4
%6 = and i32 %5, %0
%7 = icmp eq i32 %6, 0
%8 = trunc i32 %4 to i8
%9 = or i8 %8, 1
%10 = select i1 %7, i8 %3, i8 %9
%11 = or i32 %4, 1
%12 = shl nuw nsw i32 1, %11
%13 = and i32 %12, %0
%14 = icmp eq i32 %13, 0
%15 = trunc i32 %11 to i8
%16 = add nuw nsw i8 %15, 1
%17 = select i1 %14, i8 %10, i8 %16
%18 = or i32 %4, 2
%19 = shl nuw nsw i32 1, %18
%20 = and i32 %19, %0
%21 = icmp eq i32 %20, 0
%22 = trunc i32 %18 to i8
%23 = or i8 %22, 1
%24 = select i1 %21, i8 %17, i8 %23
%25 = or i32 %4, 3
%26 = icmp eq i32 %25, 31
br i1 %26, label %35, label %27
27: ; preds = %2
%28 = shl nuw nsw i32 1, %25
%29 = and i32 %28, %0
%30 = icmp eq i32 %29, 0
%31 = trunc i32 %25 to i8
%32 = add nuw nsw i8 %31, 1
%33 = select i1 %30, i8 %24, i8 %32
%34 = add nuw nsw i32 %4, 4
br label %2
35: ; preds = %2
ret i8 %24
}
void av_init_packet() {}


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

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

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

LLVM IR (-O2):
define void @av_init_packet() {
ret void
}
/* Variables and functions */
int read(int, char *, int);
int /*<<< orphan*/ reportError(char *);
int target(int fd) {
  char buf[10];
  int b = read(fd, buf, 7);
  if (b < 0) {
    reportError(buf);
    return -22;
  }
  return b;
}


x86 assembly (clang, -O0):
<target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x12(%rbp),%rsi
mov    $0x7,%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    115e <target+0x3e>
lea    -0x12(%rbp),%rdi
call   1040 <reportError@plt>
movl   $0xffffffea,-0x4(%rbp)
jmp    1164 <target+0x44>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<target>:
sub    $0x18,%rsp
lea    0xe(%rsp),%rsi
mov    $0x7,%edx
call   1030 <read@plt>
test   %eax,%eax
js     113c <target+0x1c>
add    $0x18,%rsp
ret
lea    0xe(%rsp),%rdi
call   1040 <reportError@plt>
mov    $0xffffffea,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @target(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 7)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @reportError(i8* %3)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ -22, %6 ], [ %4, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ argv;

/* Variables and functions */
int /*<<< orphan*/ my_printf(char *);
scalar_t__ optind;
int ps_main(int, char **);
int exec_ps() {
  optind = 0;
  char *argv[] = {"ps", NULL};
  int argc = (int)(sizeof(argv) / sizeof(argv[0])) - 1;
  my_printf("Execute: ps\n");
  if (ps_main(argc, argv) == 9999) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<exec_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2eb1(%rip),%rax
movq   $0x0,(%rax)
mov    0x2cc3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cc0(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x24(%rbp)
lea    0xea9(%rip),%rdi
call   1030 <my_printf@plt>
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1040 <ps_main@plt>
cmp    $0x270f,%eax
jne    1182 <exec_ps+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1189 <exec_ps+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_ps>:
sub    $0x18,%rsp
mov    0x2eb5(%rip),%rax
movq   $0x0,(%rax)
movaps 0x2cc7(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xebf(%rip),%rdi
call   1030 <my_printf@plt>
mov    %rsp,%rsi
mov    $0x1,%edi
call   1040 <ps_main@plt>
xor    %ecx,%ecx
cmp    $0x270f,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@optind = global i64 0
@.str = [3 x i8] c"ps\00"
@__const.exec_ps.argv = [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [13 x i8] c"Execute: ps\0A\00"
define i32 @exec_ps() {
%1 = alloca i32
%2 = alloca [2 x i8*]
%3 = alloca i32
store i64 0, i64* @optind
%4 = bitcast [2 x i8*]* %2 to i8*
store i32 1, i32* %3
%5 = call i32 @my_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
%8 = call i32 @ps_main(i32 %6, i8** %7)
%9 = icmp eq i32 %8, 9999
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 1, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@optind = global i64 0
@.str = [3 x i8] c"ps\00"
@__const.exec_ps.argv = [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [13 x i8] c"Execute: ps\0A\00"
define i32 @exec_ps() {
%1 = alloca [2 x i8*]
store i64 0, i64* @optind
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = tail call i32 @my_printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%5 = call i32 @ps_main(i32 1, i8** %4)
%6 = icmp eq i32 %5, 9999
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
unsigned long vx86_NBSB_Read(int /*<<< orphan*/, unsigned char);
unsigned long nb_Read(unsigned char offset) {
  return vx86_NBSB_Read(0, offset);
}


x86 assembly (clang, -O0):
<nb_Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
movzbl -0x1(%rbp),%esi
call   1030 <vx86_NBSB_Read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nb_Read>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <vx86_NBSB_Read@plt>

LLVM IR (-O0):
define i64 @nb_Read(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @vx86_NBSB_Read(i32 0, i8 zeroext %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @nb_Read(i8 zeroext %0) {
%2 = tail call i64 @vx86_NBSB_Read(i32 0, i8 zeroext %0)
ret i64 %2
}
/* Variables and functions */
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ write(int, char *, int);
main() {
  char buf[512];
  int n;
  for (;;) {
    while ((n = read(0, buf, sizeof buf)) > 0)
      write(1, buf, n);
    sleep(10);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
jmp    1147 <main+0x17>
lea    -0x210(%rbp),%rsi
xor    %edi,%edi
mov    $0x200,%edx
call   1040 <read@plt>
mov    %eax,-0x214(%rbp)
cmp    $0x0,%eax
jle    1185 <main+0x55>
lea    -0x210(%rbp),%rsi
mov    -0x214(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
jmp    1147 <main+0x17>
mov    $0xa,%edi
call   1050 <sleep@plt>
jmp    1142 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x200,%rsp
mov    %rsp,%rbx
jmp    114f <main+0x1f>
nopl   (%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x200,%edx
call   1040 <read@plt>
test   %eax,%eax
jg     1140 <main+0x10>
mov    $0xa,%edi
call   1050 <sleep@plt>
jmp    114f <main+0x1f>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [512 x i8]
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %13, %0
br label %5
5: ; preds = %9, %4
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%7 = call i32 @read(i32 0, i8* %6, i32 512)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%11 = load i32, i32* %3
%12 = call i32 @write(i32 1, i8* %10, i32 %11)
br label %5
13: ; preds = %5
%14 = call i32 @sleep(i32 10)
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %11, %0
%4 = call i32 @read(i32 0, i8* %2, i32 512)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %4, %3 ]
%8 = call i32 @write(i32 1, i8* %2, i32 %7)
%9 = call i32 @read(i32 0, i8* %2, i32 512)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %3
%12 = tail call i32 @sleep(i32 10)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ srand(double);
void math_random_setSeed(double value) { srand(value); }


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

x86 assembly (clang, -O2):
<math_random_setSeed>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @math_random_setSeed(double %0) {
%2 = tail call i32 @srand(double %0)
ret void
}