xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M18_f(char *s) {
  debug("M18_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M18_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M18_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M18_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M18_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M18_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M18_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void psocReadMemoryBarrier() { __asm__ __volatile__("lfence" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @psocReadMemoryBarrier() {
tail call void asm sideeffect "lfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long quot;
  long rem;
};
typedef TYPE_1__ ldiv_t;

/* Variables and functions */
ldiv_t ldiv(long numer, long denom) {
  ldiv_t r;
  r.quot = numer / denom;
  r.rem = numer % denom;
  return r;
}


x86 assembly (clang, -O0):
<ldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <ldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = sdiv i64 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = srem i64 %10, %11
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i64 %12, i64* %13
%14 = bitcast %struct.TYPE_3__* %3 to { i64, i64 }*
%15 = load { i64, i64 }, { i64, i64 }* %14
ret { i64, i64 } %15
}

LLVM IR (-O2):
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = srem i64 %0, %1
%5 = insertvalue { i64, i64 } poison, i64 %3, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
const char *Lock_Name(void) { return "Lock"; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"Lock\00"
define i8* @Lock_Name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
int lower_bound(int v[], int n, int x) {
  int low = 0;
  int high = n;
  while (low < high) {
    int mid = (low + high) / 2;
    if (v[mid] >= x)
      high = mid;
    else
      low = mid + 1;
  }
  return low;
}


x86 assembly (clang, -O0):
<lower_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1165 <lower_bound+0x65>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jl     1157 <lower_bound+0x57>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1160 <lower_bound+0x60>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <lower_bound+0x1b>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_bound>:
xor    %eax,%eax
test   %esi,%esi
jg     1117 <lower_bound+0x17>
jmp    113b <lower_bound+0x3b>
nopl   0x0(%rax,%rax,1)
mov    %r9d,%esi
cmp    %esi,%eax
jge    113b <lower_bound+0x3b>
lea    (%rax,%rsi,1),%r8d
mov    %r8d,%r9d
shr    $0x1f,%r9d
add    %r8d,%r9d
sar    %r9d
movslq %r9d,%rcx
cmp    %edx,(%rdi,%rcx,4)
jge    1110 <lower_bound+0x10>
add    $0x1,%r9d
mov    %r9d,%eax
cmp    %esi,%eax
jl     1117 <lower_bound+0x17>
ret

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

LLVM IR (-O2):
define i32 @lower_bound(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %18
5: ; preds = %3, %5
%6 = phi i32 [ %16, %5 ], [ 0, %3 ]
%7 = phi i32 [ %15, %5 ], [ %1, %3 ]
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %8, 2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp slt i32 %12, %2
%14 = add nsw i32 %9, 1
%15 = select i1 %13, i32 %7, i32 %9
%16 = select i1 %13, i32 %14, i32 %6
%17 = icmp slt i32 %16, %15
br i1 %17, label %5, label %18
18: ; preds = %5, %3
%19 = phi i32 [ 0, %3 ], [ %16, %5 ]
ret i32 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ *hybris_set_realrwlock(int /*<<< orphan*/ *);
int pthread_rwlock_rdlock(int /*<<< orphan*/ *);
int my_pthread_rwlock_rdlock(pthread_rwlock_t *__rwlock) {
  pthread_rwlock_t *realrwlock = hybris_set_realrwlock(__rwlock);
  return pthread_rwlock_rdlock(realrwlock);
}


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

x86 assembly (clang, -O2):
<my_pthread_rwlock_rdlock>:
push   %rax
call   1040 <hybris_set_realrwlock@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <pthread_rwlock_rdlock@plt>

LLVM IR (-O0):
define i32 @my_pthread_rwlock_rdlock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32* @hybris_set_realrwlock(i32* %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @pthread_rwlock_rdlock(i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @my_pthread_rwlock_rdlock(i32* %0) {
%2 = tail call i32* @hybris_set_realrwlock(i32* %0)
%3 = tail call i32 @pthread_rwlock_rdlock(i32* %2)
ret i32 %3
}
regx0imm1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((p0[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x21,(%rax,%rcx,4)
jg     1136 <regx0imm1+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <regx0imm1+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0imm1>:
movslq %edx,%rcx
xor    %eax,%eax
cmpl   $0x22,(%r8,%rcx,4)
setl   %al
ret

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

LLVM IR (-O2):
define i32 @regx0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
%9 = load i32, i32* %8
%10 = icmp slt i32 %9, 34
%11 = zext i1 %10 to i32
ret i32 %11
}
void mips_mem_config_parse_entry(struct config_t *config, char *section) {}


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

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

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

LLVM IR (-O2):
%struct.config_t = type opaque
define void @mips_mem_config_parse_entry(%struct.config_t* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long long findNb(long long);
int /*<<< orphan*/ printf(char *, long long, long long);
void testequal(long long m, long long exp) {
  long long act = findNb(m);
  if (act != exp)
    printf("Error. Expected %lld but got %lld\n", exp, act);
  assert(act == exp);
}


x86 assembly (clang, -O0):
<testequal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <findNb@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     116f <testequal+0x3f>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testequal>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1050 <findNb@plt>
mov    %rax,%rbx
cmp    %r14,%rax
je     1156 <testequal+0x26>
lea    0xeb5(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %edi,%edi
cmp    %r14,%rbx
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Error. Expected %lld but got %lld\0A\00"
define void @testequal(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = call i64 @findNb(i64 %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %12, i64 %13)
br label %15
15: ; preds = %11, %2
%16 = load i64, i64* %5
%17 = load i64, i64* %4
%18 = icmp eq i64 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Error. Expected %lld but got %lld\0A\00"
define void @testequal(i64 %0, i64 %1) {
%3 = tail call i64 @findNb(i64 %0)
%4 = icmp eq i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %1, i64 %3)
br label %7
7: ; preds = %5, %2
%8 = zext i1 %4 to i32
%9 = tail call i32 @assert(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ConvertString(char *);
int /*<<< orphan*/ free(char *);
char *getBraceParam();
void CmdResizeBox(int code) {
  char *size, *options, *content;
  size = getBraceParam();
  options = getBraceParam();
  content = getBraceParam();
  free(size);
  free(options);
  ConvertString(content);
  free(content);
}


x86 assembly (clang, -O0):
<CmdResizeBox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getBraceParam@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getBraceParam@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1050 <ConvertString@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdResizeBox>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getBraceParam@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <getBraceParam@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1040 <getBraceParam@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1050 <ConvertString@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @CmdResizeBox(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %2
%6 = call i8* (...) @getBraceParam()
store i8* %6, i8** %3
%7 = call i8* (...) @getBraceParam()
store i8* %7, i8** %4
%8 = call i8* (...) @getBraceParam()
store i8* %8, i8** %5
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @free(i8* %11)
%13 = load i8*, i8** %5
%14 = call i32 @ConvertString(i8* %13)
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
define void @CmdResizeBox(i32 %0) {
%2 = tail call i8* (...) @getBraceParam()
%3 = tail call i8* (...) @getBraceParam()
%4 = tail call i8* (...) @getBraceParam()
%5 = tail call i32 @free(i8* %2)
%6 = tail call i32 @free(i8* %3)
%7 = tail call i32 @ConvertString(i8* %4)
%8 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ absolutelong();
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc8(int /*<<< orphan*/);
void sbcLong8(void) { sbc8(readmem65816(absolutelong())); }


x86 assembly (clang, -O0):
<sbcLong8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <absolutelong@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1040 <sbc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcLong8>:
push   %rax
xor    %eax,%eax
call   1030 <absolutelong@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sbc8@plt>

LLVM IR (-O0):
define void @sbcLong8() {
%1 = call i32 (...) @absolutelong()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @sbc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcLong8() {
%1 = tail call i32 (...) @absolutelong()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @sbc8(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int is_permutation(int, int);
void is_permutation_test(void) {
  assert(is_permutation(12345, 32415));
  assert(!is_permutation(12345, 32615));
}


x86 assembly (clang, -O0):
<is_permutation_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3039,%edi
mov    $0x7e9f,%esi
call   1040 <is_permutation@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0x3039,%edi
mov    $0x7f67,%esi
call   1040 <is_permutation@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_permutation_test>:
push   %rax
mov    $0x3039,%edi
mov    $0x7e9f,%esi
call   1040 <is_permutation@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0x3039,%edi
mov    $0x7f67,%esi
call   1040 <is_permutation@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @is_permutation_test() {
%1 = call i32 @is_permutation(i32 12345, i32 32415)
%2 = call i32 @assert(i32 %1)
%3 = call i32 @is_permutation(i32 12345, i32 32615)
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
define void @is_permutation_test() {
%1 = tail call i32 @is_permutation(i32 12345, i32 32415)
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 @is_permutation(i32 12345, i32 32615)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret void
}
/* Variables and functions */
int htoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char chars[] = {'0', 'x', '1', '1', 'f'};
  printf("%d\n", htoi(chars));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x9(%rbp),%rdi
call   1040 <htoi@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x66,0x4(%rsp)
movl   $0x31317830,(%rsp)
mov    %rsp,%rdi
call   1040 <htoi@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@__const.main.chars = [5 x i8] c"0x11f"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @htoi(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
double ifrac(x)
double x;
{
  unsigned long lx;
  long double y, z;
  z = floor(x);
  lx = z;
  y = x - z;
  printf(" int = %lx\n", lx);
  return (y);
}


x86 assembly (clang, -O0):
<ifrac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x40(%rbp)
fldl   -0x40(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
flds   0xeb5(%rip)
fucomi %st(1),%st
setbe  %al
fldz
fcmovbe %st(1),%st
fstp   %st(1)
fsubrp %st,%st(1)
fnstcw -0x4a(%rbp)
movzwl -0x4a(%rbp),%ecx
or     $0xc00,%ecx
mov    %cx,-0x4c(%rbp)
fldcw  -0x4c(%rbp)
fistpll -0x38(%rbp)
fldcw  -0x4a(%rbp)
movzbl %al,%eax
mov    %eax,%ecx
shl    $0x3f,%rcx
mov    -0x38(%rbp),%rax
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
fldl   -0x8(%rbp)
fldt   -0x30(%rbp)
fsubrp %st,%st(1)
fstpt  -0x20(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe68(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fldt   -0x20(%rbp)
fstpl  -0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifrac>:
sub    $0x28,%rsp
movsd  %xmm0,(%rsp)
call   1040 <floor@plt>
cvttsd2si %xmm0,%rax
movsd  %xmm0,0x18(%rsp)
mov    %rax,%rcx
sar    $0x3f,%rcx
subsd  0xeb8(%rip),%xmm0
cvttsd2si %xmm0,%rsi
and    %rcx,%rsi
or     %rax,%rsi
movsd  (%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
fldl   0x20(%rsp)
fsubl  0x18(%rsp)
fstpt  (%rsp)
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fldt   (%rsp)
fstpl  0x10(%rsp)
movsd  0x10(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c" int = %lx\0A\00"
define double @ifrac(double %0) {
%2 = alloca double
%3 = alloca i64
%4 = alloca x86_fp80
%5 = alloca x86_fp80
store double %0, double* %2
%6 = load double, double* %2
%7 = call double @llvm.floor.f64(double %6)
%8 = fpext double %7 to x86_fp80
store x86_fp80 %8, x86_fp80* %5
%9 = load x86_fp80, x86_fp80* %5
%10 = fptoui x86_fp80 %9 to i64
store i64 %10, i64* %3
%11 = load double, double* %2
%12 = fpext double %11 to x86_fp80
%13 = load x86_fp80, x86_fp80* %5
%14 = fsub x86_fp80 %12, %13
store x86_fp80 %14, x86_fp80* %4
%15 = load i64, i64* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %15)
%17 = load x86_fp80, x86_fp80* %4
%18 = fptrunc x86_fp80 %17 to double
ret double %18
}

LLVM IR (-O2):
@.str = [12 x i8] c" int = %lx\0A\00"
define double @ifrac(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fpext double %2 to x86_fp80
%4 = fptoui double %2 to i64
%5 = fpext double %0 to x86_fp80
%6 = fsub x86_fp80 %5, %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %4)
%8 = fptrunc x86_fp80 %6 to double
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, char *, int, int);
void ireadps(char *str, int maxlen) { syscall(0x4973, str, 1, maxlen); }


x86 assembly (clang, -O0):
<ireadps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%ecx
mov    $0x4973,%edi
mov    $0x1,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ireadps>:
mov    %esi,%ecx
mov    %rdi,%rsi
mov    $0x4973,%edi
mov    $0x1,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define void @ireadps(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 @syscall(i32 18803, i8* %5, i32 1, i32 %6)
ret void
}

LLVM IR (-O2):
define void @ireadps(i8* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 18803, i8* %0, i32 1, i32 %1)
ret void
}
unsigned extract(unsigned nr, unsigned short p, unsigned short n) {
  return nr << p >> (sizeof(unsigned) * 8 - n);
}


x86 assembly (clang, -O0):
<extract>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %edi,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
movzwl -0x6(%rbp),%ecx
shl    %cl,%eax
movzwl -0x8(%rbp),%ecx
mov    %ecx,%edx
mov    $0x20,%ecx
sub    %rdx,%rcx
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %dl
mov    %edx,%ecx
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @extract(i32 %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
store i32 %0, i32* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i32, i32* %4
%8 = load i16, i16* %5
%9 = zext i16 %8 to i32
%10 = shl i32 %7, %9
%11 = load i16, i16* %6
%12 = zext i16 %11 to i64
%13 = sub i64 32, %12
%14 = trunc i64 %13 to i32
%15 = lshr i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @extract(i32 %0, i16 zeroext %1, i16 zeroext %2) {
%4 = zext i16 %1 to i32
%5 = shl i32 %0, %4
%6 = zext i16 %2 to i32
%7 = sub nsw i32 32, %6
%8 = lshr i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ js_getbtnfor(int, int);
int /*<<< orphan*/ js_setmapping(int, int, int);
void js_setifnull(int i, int btn, int keypress) {
  if (!js_getbtnfor(i, keypress))
    js_setmapping(i, btn, keypress);
}


x86 assembly (clang, -O0):
<js_setifnull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <js_getbtnfor@plt>
cmp    $0x0,%eax
jne    1153 <js_setifnull+0x33>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <js_setmapping@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<js_setifnull>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %edx,%esi
call   1040 <js_getbtnfor@plt>
test   %eax,%eax
je     113b <js_setifnull+0x1b>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <js_setmapping@plt>

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

LLVM IR (-O2):
define void @js_setifnull(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @js_getbtnfor(i32 %0, i32 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @js_setmapping(i32 %0, i32 %1, i32 %2)
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
struct i2c_client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_value(int /*<<< orphan*/, struct i2c_client *);
int gslX680_shutdown_low(struct i2c_client *cliente) {
  send_value(0, cliente);
  return 0;
}


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

x86 assembly (clang, -O2):
<gslX680_shutdown_low>:
push   %rax
mov    %rdi,%rsi
xor    %edi,%edi
call   1030 <send_value@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.i2c_client = type { i32 }
define i32 @gslX680_shutdown_low(%struct.i2c_client* %0) {
%2 = tail call i32 @send_value(i32 0, %struct.i2c_client* %0)
ret i32 0
}
/* Variables and functions */
double DSlater_4S_5S(double, double, double);
double DSlater_5S_4S(double rij, double xii, double xij) {
  return DSlater_4S_5S(rij, xij, xii);
}


x86 assembly (clang, -O0):
<DSlater_5S_4S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
call   1030 <DSlater_4S_5S@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSlater_5S_4S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <DSlater_4S_5S@plt>

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

LLVM IR (-O2):
define double @DSlater_5S_4S(double %0, double %1, double %2) {
%4 = tail call double @DSlater_4S_5S(double %0, double %2, double %1)
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ float_t;

/* Variables and functions */
float __rmod(float, int /*<<< orphan*/);
float r_mod(float *x, float_t *y) { return (__rmod(*x, *y)); }


x86 assembly (clang, -O0):
<r_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <__rmod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_mod>:
movss  (%rdi),%xmm0
mov    (%rsi),%edi
jmp    1030 <__rmod@plt>

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

LLVM IR (-O2):
define float @r_mod(float* nocapture %0, i32* nocapture %1) {
%3 = load float, float* %0
%4 = load i32, i32* %1
%5 = tail call float @__rmod(float %3, i32 %4)
ret float %5
}
/* Variables and functions */
int sync_wait(int, int);
int sync_wait_parent(int fd[2], int seq) { return sync_wait(fd[0], seq); }


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

x86 assembly (clang, -O2):
<sync_wait_parent>:
mov    (%rdi),%edi
jmp    1030 <sync_wait@plt>

LLVM IR (-O0):
define i32 @sync_wait_parent(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = call i32 @sync_wait(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @sync_wait_parent(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @sync_wait(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void yella_default_ptr_destructor(void *elem, void *udata) { free(elem); }


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

x86 assembly (clang, -O2):
<yella_default_ptr_destructor>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @yella_default_ptr_destructor(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 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @yella_default_ptr_destructor(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
long long PAPI_get_real_cyc();
void papif_get_real_cyc__(long long *real_cyc) {
  *real_cyc = PAPI_get_real_cyc();
}


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

x86 assembly (clang, -O2):
<papif_get_real_cyc__>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_get_real_cyc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_get_real_cyc__(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @PAPI_get_real_cyc()
store i64 %2, i64* %0
ret void
}
void foo_2_2_2_1_2_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_2_1_2_2_1() {
ret void
}
/* Variables and functions */
void *internal(int);
void *ref_internal() { return internal(42); }


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

x86 assembly (clang, -O2):
<ref_internal>:
mov    $0x2a,%edi
jmp    1030 <internal@plt>

LLVM IR (-O0):
define i8* @ref_internal() {
%1 = call i8* @internal(i32 42)
ret i8* %1
}

LLVM IR (-O2):
define i8* @ref_internal() {
%1 = tail call i8* @internal(i32 42)
ret i8* %1
}
int is_ack_packet(int opcode) { return (opcode == 4); }


x86 assembly (clang, -O0):
<is_ack_packet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ack_packet>:
xor    %eax,%eax
cmp    $0x4,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_ack_packet(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = zext i1 %2 to i32
ret i32 %3
}
int push(int *stack, int top, int x) {
  if (top == 20 - 1) {
    return 0;
  }
  top = top + 1;
  stack[top] = x;
  return top;
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x13,-0x14(%rbp)
jne    1124 <push+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1141 <push+0x41>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
xor    %eax,%eax
cmp    $0x13,%esi
je     1113 <push+0x13>
movslq %esi,%rax
add    $0x1,%esi
mov    %edx,0x4(%rdi,%rax,4)
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @push(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 19
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = add nsw i32 %1, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %2, i32* %8
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %10
}
/* Type definitions */
struct debug_buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ debug_buf_write_char(struct debug_buf *, int /*<<< orphan*/);
void debug_buf_write_str(struct debug_buf *buf, char *str) {
  while (*str)
    debug_buf_write_char(buf, *str++);
}


x86 assembly (clang, -O0):
<debug_buf_write_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <debug_buf_write_str+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <debug_buf_write_char@plt>
jmp    1120 <debug_buf_write_str+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_buf_write_str>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1146 <debug_buf_write_str+0x36>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <debug_buf_write_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <debug_buf_write_str+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.debug_buf = type { i32 }
define void @debug_buf_write_str(%struct.debug_buf* %0, i8* %1) {
%3 = alloca %struct.debug_buf*
%4 = alloca i8*
store %struct.debug_buf* %0, %struct.debug_buf** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load %struct.debug_buf*, %struct.debug_buf** %3
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %4
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = call i32 @debug_buf_write_char(%struct.debug_buf* %10, i32 %14)
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.debug_buf = type { i32 }
define void @debug_buf_write_str(%struct.debug_buf* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @debug_buf_write_char(%struct.debug_buf* %0, i32 %9)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
void foo577(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo577(i32 %0) {
ret void
}
struct s3c24x0_usb_host *s3c24x0_get_base_usb_host(void) {
  return (struct s3c24x0_usb_host *)0x49000000;
}


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

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

LLVM IR (-O0):
%struct.s3c24x0_usb_host = type opaque
define %struct.s3c24x0_usb_host* @s3c24x0_get_base_usb_host() {
ret %struct.s3c24x0_usb_host* inttoptr (i64 1224736768 to %struct.s3c24x0_usb_host*)
}

LLVM IR (-O2):
%struct.s3c24x0_usb_host = type opaque
define %struct.s3c24x0_usb_host* @s3c24x0_get_base_usb_host() {
ret %struct.s3c24x0_usb_host* inttoptr (i64 1224736768 to %struct.s3c24x0_usb_host*)
}
int pdf_aes_write(void *_ctx, char *in, char *out, int req) {
  int tmplen = 0;
  return tmplen;
}


x86 assembly (clang, -O0):
<pdf_aes_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pdf_aes_write(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_init(int /*<<< orphan*/ *, void *);
int bglpth_pthread_mutex_init(pthread_mutex_t *mutex, void *val) {
  return pthread_mutex_init(mutex, val);
}


x86 assembly (clang, -O0):
<bglpth_pthread_mutex_init>:
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 <pthread_mutex_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bglpth_pthread_mutex_init>:
jmp    1030 <pthread_mutex_init@plt>

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

LLVM IR (-O2):
define i32 @bglpth_pthread_mutex_init(i32* %0, i8* %1) {
%3 = tail call i32 @pthread_mutex_init(i32* %0, i8* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ do_wep(int /*<<< orphan*/ const *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/, int /*<<< orphan*/ const *,
                          int /*<<< orphan*/, int);
int32_t wep_encrypt(const uint8_t *src, uint8_t *dest, uint32_t len,
                    const uint8_t *wepkey, uint32_t keylen) {
  return do_wep(src, dest, len, wepkey, keylen, 1);
}


x86 assembly (clang, -O0):
<wep_encrypt>:
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    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    $0x1,%r9d
call   1030 <do_wep@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wep_encrypt>:
mov    $0x1,%r9d
jmp    1030 <do_wep@plt>

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

LLVM IR (-O2):
define i32 @wep_encrypt(i32* %0, i32* %1, i32 %2, i32* %3, i32 %4) {
%6 = tail call i32 @do_wep(i32* %0, i32* %1, i32 %2, i32* %3, i32 %4, i32 1)
ret i32 %6
}
int gpio_close(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gpio_close() {
ret i32 0
}
/* Variables and functions */
int go_add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = go_add(2, 3);
  printf("Result: %d\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <go_add@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <go_add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Result: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @go_add(i32 2, i32 3)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Result: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @go_add(i32 2, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void RTMpCpuIdFromSetIndex(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMpCpuIdFromSetIndex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void say_hello(char *name) { printf("Hello %s!\n", name); }


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

x86 assembly (clang, -O2):
<say_hello>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Hello %s!\0A\00"
define void @say_hello(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Hello %s!\0A\00"
define void @say_hello(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void cmp_reg32_imm32(int reg32, unsigned int imm32) {
  put8(0x81);
  put8(0xF8 + reg32);
  put32(imm32);
}


x86 assembly (clang, -O0):
<cmp_reg32_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x81,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0xf8,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_reg32_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x81,%edi
call   1030 <put8@plt>
add    $0xf8,%ebp
mov    %ebp,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @cmp_reg32_imm32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 129)
%6 = load i32, i32* %3
%7 = add nsw i32 248, %6
%8 = call i32 @put8(i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @put32(i32 %9)
ret void
}

LLVM IR (-O2):
define void @cmp_reg32_imm32(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 129)
%4 = add nsw i32 %0, 248
%5 = tail call i32 @put8(i32 %4)
%6 = tail call i32 @put32(i32 %1)
ret void
}
/* Variables and functions */
int test_svarint(int);
char *test_svarint3() {
  do {
    if (!(test_svarint(0x01) == -1))
      return "error, test_svarint3";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_svarint3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <test_svarint@plt>
cmp    $0xffffffff,%eax
je     113b <test_svarint3+0x2b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <test_svarint3+0x38>
jmp    1140 <test_svarint3+0x30>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_svarint3>:
push   %rax
mov    $0x1,%edi
call   1030 <test_svarint@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
lea    0xed9(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"error, test_svarint3\00"
define i8* @test_svarint3() {
%1 = tail call i32 @test_svarint(i32 1)
%2 = icmp eq i32 %1, -1
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}