xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ int_log2(int);
double FFT_num_flops(int N) {
  double Nd = (double)N;
  double logN = (double)int_log2(N);
  return (5.0 * Nd - 2) * logN + 2 * (Nd + 1);
}


x86 assembly (clang, -O0):
<FFT_num_flops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <int_log2@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xea7(%rip),%xmm3
addsd  -0x10(%rbp),%xmm3
movsd  0xe92(%rip),%xmm1
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FFT_num_flops>:
push   %rax
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
call   1030 <int_log2@plt>
cvtsi2sd %rax,%xmm2
movsd  0xed4(%rip),%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  0xecb(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xec7(%rip),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @FFT_num_flops(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
store double %6, double* %3
%7 = load i32, i32* %2
%8 = call i64 @int_log2(i32 %7)
%9 = sitofp i64 %8 to double
store double %9, double* %4
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double 5.000000e+00, double %10, double -2.000000e+00)
%12 = load double, double* %4
%13 = load double, double* %3
%14 = fadd double %13, 1.000000e+00
%15 = fmul double 2.000000e+00, %14
%16 = call double @llvm.fmuladd.f64(double %11, double %12, double %15)
ret double %16
}

LLVM IR (-O2):
define double @FFT_num_flops(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call i64 @int_log2(i32 %0)
%4 = sitofp i64 %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %2, double 5.000000e+00, double -2.000000e+00)
%6 = fadd double %2, 1.000000e+00
%7 = fmul double %6, 2.000000e+00
%8 = tail call double @llvm.fmuladd.f64(double %5, double %4, double %7)
ret double %8
}
int divisao(int num1, int num2) { return num2 == 0 ? 0 : num1 / num2; }


x86 assembly (clang, -O0):
<divisao>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111e <divisao+0x1e>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <divisao+0x28>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divisao>:
test   %esi,%esi
je     110a <divisao+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @divisao(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i32 %0, %1
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int usage() {
  fprintf(
      stdout,
      "usage: hmsg_monitor/hs tools\n"
      " 		hmsg_monitor --start hash message monitor\n"
      "		hs [add/del] [name=value] add name and value to hash table\n"
      "		hs commit save name and value to file\n"
      "		hs get [name] get value of name\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [210 x i8] c"usage: hmsg_monitor/hs tools\0A \09\09hmsg_monitor --start hash message monitor\0A\09\09hs [add/del] [name=value] add name and value to hash table\0A\09\09hs commit save name and value to file\0A\09\09hs get [name] get value of name\0A\00"
define i32 @usage() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([210 x i8], [210 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [210 x i8] c"usage: hmsg_monitor/hs tools\0A \09\09hmsg_monitor --start hash message monitor\0A\09\09hs [add/del] [name=value] add name and value to hash table\0A\09\09hs commit save name and value to file\0A\09\09hs get [name] get value of name\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([210 x i8], [210 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
double VAL2DB_EX(double x, double mindb) {
  return x <= exp((mindb)*0.11512925464970228420089957273422)
             ? mindb
             : (log(x) * 8.6858896380650365530225783783321);
}


x86 assembly (clang, -O0):
<VAL2DB_EX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebc(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     116c <VAL2DB_EX+0x4c>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1187 <VAL2DB_EX+0x67>
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
movsd  0xe8a(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VAL2DB_EX>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  0xec8(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm1,%xmm0
movsd  0x10(%rsp),%xmm0
jae    1164 <VAL2DB_EX+0x44>
movapd %xmm1,%xmm0
call   1040 <log@plt>
mulsd  0xea4(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @VAL2DB_EX(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 = fmul double %6, 0x3FBD791C5F888822
%8 = call double @exp(double %7)
%9 = fcmp ole double %5, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load double, double* %4
br label %16
12: ; preds = %2
%13 = load double, double* %3
%14 = call double @log(double %13)
%15 = fmul double %14, 0x40215F2CED384F29
br label %16
16: ; preds = %12, %10
%17 = phi double [ %11, %10 ], [ %15, %12 ]
ret double %17
}

LLVM IR (-O2):
define double @VAL2DB_EX(double %0, double %1) {
%3 = fmul double %1, 0x3FBD791C5F888822
%4 = tail call double @exp(double %3)
%5 = fcmp ult double %4, %0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call double @log(double %0)
%8 = fmul double %7, 0x40215F2CED384F29
br label %9
9: ; preds = %2, %6
%10 = phi double [ %8, %6 ], [ %1, %2 ]
ret double %10
}
/* Variables and functions */
int octet_matches_(char const *, char const *, int);
int ascii_casemap_matches(const char *pat, const char *text) {
  return octet_matches_(pat, text, 1);
}


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

x86 assembly (clang, -O2):
<ascii_casemap_matches>:
mov    $0x1,%edx
jmp    1030 <octet_matches_@plt>

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

LLVM IR (-O2):
define i32 @ascii_casemap_matches(i8* %0, i8* %1) {
%3 = tail call i32 @octet_matches_(i8* %0, i8* %1, i32 1)
ret i32 %3
}
long arch_callsize() { return 4; }


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

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

LLVM IR (-O0):
define i64 @arch_callsize() {
ret i64 4
}

LLVM IR (-O2):
define i64 @arch_callsize() {
ret i64 4
}
int execute_fallocate() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_fallocate() {
ret i32 0
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ do_something();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ getSyscallNum();
int /*<<< orphan*/ perror(char *);
int main() {
  pid_t pid;
  if (-1 == (pid = fork())) {
    perror("fork error!");
    return -1;
  }
  if (0 == pid) {
    do_something();
    exit(0);
  } else {
    getSyscallNum();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <fork@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1190 <main+0x40>
lea    0xe81(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b7 <main+0x67>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    11a9 <main+0x59>
mov    $0x0,%al
call   1030 <do_something@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1040 <getSyscallNum@plt>
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   1070 <fork@plt>
cmp    $0xffffffff,%eax
je     116e <main+0x1e>
test   %eax,%eax
je     1181 <main+0x31>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getSyscallNum@plt>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xe8b(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%ebx
jmp    116a <main+0x1a>
xor    %eax,%eax
call   1030 <do_something@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"fork error!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @fork()
store i32 %3, i32* %2
%4 = icmp eq i32 -1, %3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %16
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp eq i32 0, %8
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = call i32 (...) @do_something()
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %7
%14 = call i32 (...) @getSyscallNum()
br label %15
15: ; preds = %13
store i32 0, i32* %1
br label %16
16: ; preds = %15, %5
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [12 x i8] c"fork error!\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
switch i32 %1, label %7 [
i32 -1, label %2
i32 0, label %4
]
2: ; preds = %0
%3 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %9
4: ; preds = %0
%5 = tail call i32 (...) @do_something()
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %0
%8 = tail call i32 (...) @getSyscallNum()
br label %9
9: ; preds = %7, %2
%10 = phi i32 [ -1, %2 ], [ 0, %7 ]
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned char minor_code;
};
struct TYPE_4__ {
  TYPE_1__ xerror;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xerror_minor_code(void *_p, unsigned char _v) {
  ((XEvent *)_p)->xerror.minor_code = (unsigned char)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xerror_minor_code>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xerror_minor_code>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i8 }
define void @set_XEvent_xerror_minor_code(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i8 %5, i8* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xerror_minor_code(i8* nocapture writeonly %0, i8 zeroext %1) {
store i8 %1, i8* %0
ret void
}
void i2d_RSA_PUBKEY_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_RSA_PUBKEY_bio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void inserir(int vet[50], int *tamanho, int elemento) {
  if (*tamanho < 50) {
    vet[*tamanho] = elemento;
    (*tamanho)++;
  } else {
    printf("Vetor cheio!");
  }
}


x86 assembly (clang, -O0):
<inserir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x32,(%rax)
jge    1151 <inserir+0x41>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    115d <inserir+0x4d>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inserir>:
movslq (%rsi),%rax
cmp    $0x31,%rax
jg     1120 <inserir+0x10>
mov    %edx,(%rdi,%rax,4)
addl   $0x1,(%rsi)
ret
lea    0xed9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Vetor cheio!\00"
define void @inserir(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** %5
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, 50
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i32, i32* %6
%12 = load i32*, i32** %4
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %12, i64 %15
store i32 %11, i32* %16
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
store i32 %19, i32* %17
br label %22
20: ; preds = %3
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %10
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Vetor cheio!\00"
define void @inserir(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 50
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %2, i32* %8
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %13
11: ; preds = %3
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %6
ret void
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int thinit() { return syscall(61, 0, 0); }


x86 assembly (clang, -O0):
<thinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3d,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<thinit>:
mov    $0x3d,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @thinit() {
%1 = call i32 @syscall(i32 61, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @thinit() {
%1 = tail call i32 @syscall(i32 61, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void Report_std(const char *text) { printf("%s\n", text); }


x86 assembly (clang, -O0):
<Report_std>:
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):
<Report_std>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @Report_std(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int strinsert(char *s1, char c, int pos) {
  char oldc;
  char *s;
  for (s = s1 + pos; c; s++) {
    oldc = *s;
    *s = c;
    c = oldc;
  }
  *s = '\0';
  return 1;
}


x86 assembly (clang, -O0):
<strinsert>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
cmpb   $0x0,-0x9(%rbp)
je     1153 <strinsert+0x53>
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1120 <strinsert+0x20>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strinsert>:
movslq %edx,%rax
add    %rdi,%rax
test   %sil,%sil
je     1120 <strinsert+0x20>
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
mov    %sil,(%rax)
add    $0x1,%rax
mov    %ecx,%esi
test   %cl,%cl
jne    1110 <strinsert+0x10>
movb   $0x0,(%rax)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @strinsert(i8* nocapture %0, i8 signext %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = icmp eq i8 %1, 0
br i1 %6, label %13, label %7
7: ; preds = %3, %7
%8 = phi i8* [ %11, %7 ], [ %5, %3 ]
%9 = phi i8 [ %10, %7 ], [ %1, %3 ]
%10 = load i8, i8* %8
store i8 %9, i8* %8
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = icmp eq i8 %10, 0
br i1 %12, label %13, label %7
13: ; preds = %7, %3
%14 = phi i8* [ %5, %3 ], [ %11, %7 ]
store i8 0, i8* %14
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ RTFRouteToken();
int /*<<< orphan*/ RTFSkipGroup();
void ReadPictGroup(void) {
  RTFSkipGroup();
  RTFRouteToken();
}


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

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

LLVM IR (-O0):
define void @ReadPictGroup() {
%1 = call i32 (...) @RTFSkipGroup()
%2 = call i32 (...) @RTFRouteToken()
ret void
}

LLVM IR (-O2):
define void @ReadPictGroup() {
%1 = tail call i32 (...) @RTFSkipGroup()
%2 = tail call i32 (...) @RTFRouteToken()
ret void
}
/* Variables and functions */
float atof(char *);
float pow(int, float);
int main(int argc, char **argv) {
  float y = atof(argv[1]);
  float x = pow(100., y);
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    $0x64,%edi
call   1040 <pow@plt>
movss  %xmm0,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <atof@plt>
mov    $0x64,%edi
call   1040 <pow@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call float @atof(i8* %10)
store float %11, float* %6
%12 = load float, float* %6
%13 = call float @pow(i32 100, float %12)
store float %13, float* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call float @atof(i8* %4)
%6 = tail call float @pow(i32 100, float %5)
ret i32 0
}
/* Variables and functions */
int func();
int main(void) { return func() == 1 ? 0 : 1; }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <func@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @func()
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 0, i32 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func()
%2 = icmp ne i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int fwrite(char *, int, int, int /*<<< orphan*/ *);
char *malloc(int);
int vsprintf(char *, char const *, int /*<<< orphan*/);
int vfprintf(FILE *stream, const char *format, va_list arg) {
  int i;
  char *s = malloc(4096);
  i = vsprintf(s, format, arg);
  i = fwrite(s, 1, i, stream);
  free(s);
  return i;
}


x86 assembly (clang, -O0):
<vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x1000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <vsprintf@plt>
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1060 <fwrite@plt>
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfprintf>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x1000,%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
call   1050 <vsprintf@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1060 <fwrite@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @vfprintf(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = call i8* @malloc(i32 4096)
store i8* %9, i8** %8
%10 = load i8*, i8** %8
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @vsprintf(i8* %10, i8* %11, i32 %12)
store i32 %13, i32* %7
%14 = load i8*, i8** %8
%15 = load i32, i32* %7
%16 = load i32*, i32** %4
%17 = call i32 @fwrite(i8* %14, i32 1, i32 %15, i32* %16)
store i32 %17, i32* %7
%18 = load i8*, i8** %8
%19 = call i32 @free(i8* %18)
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @vfprintf(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call dereferenceable_or_null(4096) i8* @malloc(i32 4096)
%5 = tail call i32 @vsprintf(i8* %4, i8* %1, i32 %2)
%6 = tail call i32 @fwrite(i8* %4, i32 1, i32 %5, i32* %0)
%7 = tail call i32 @free(i8* %4)
ret i32 %6
}
/* Type definitions */
struct xdispline {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dlright(struct xdispline *);
int /*<<< orphan*/ wl_rcursor(struct xdispline *);
void wl_dlright(struct xdispline *line) {
  dlright(line);
  wl_rcursor(line);
}


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

x86 assembly (clang, -O2):
<wl_dlright>:
push   %rbx
mov    %rdi,%rbx
call   1030 <dlright@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <wl_rcursor@plt>

LLVM IR (-O0):
%struct.xdispline = type { i32 }
define void @wl_dlright(%struct.xdispline* %0) {
%2 = alloca %struct.xdispline*
store %struct.xdispline* %0, %struct.xdispline** %2
%3 = load %struct.xdispline*, %struct.xdispline** %2
%4 = call i32 @dlright(%struct.xdispline* %3)
%5 = load %struct.xdispline*, %struct.xdispline** %2
%6 = call i32 @wl_rcursor(%struct.xdispline* %5)
ret void
}

LLVM IR (-O2):
%struct.xdispline = type { i32 }
define void @wl_dlright(%struct.xdispline* %0) {
%2 = tail call i32 @dlright(%struct.xdispline* %0)
%3 = tail call i32 @wl_rcursor(%struct.xdispline* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ c;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int fgetc(FILE *file) {
  unsigned char c;
  if (fread(&c, sizeof(c), 1, file) == sizeof(c)) {
    return c;
  } else {
    return EOF;
  }
}


x86 assembly (clang, -O0):
<fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x11(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
cltq
cmp    $0x1,%rax
jne    1148 <fgetc+0x38>
movzbl -0x11(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <fgetc+0x44>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc>:
push   %rax
mov    %rdi,%rcx
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     1138 <fgetc+0x28>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
movzbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @fgetc(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @fread(i8* %4, i32 1, i32 1, i32* %5)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
store i32 %11, i32* %2
br label %14
12: ; preds = %1
%13 = load i32, i32* @EOF
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fgetc(i32* nocapture %0) {
%2 = alloca i8
%3 = call i32 @fread(i8* %2, i32 1, i32 1, i32* %0)
%4 = icmp eq i32 %3, 1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = load i32, i32* @EOF
%8 = select i1 %4, i32 %6, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ format_float_types();
int /*<<< orphan*/ format_integer_types();
int /*<<< orphan*/ format_string_types();
int /*<<< orphan*/ format_to_string();
int main(int argc, char **argv) {
  format_to_string();
  format_integer_types();
  format_float_types();
  format_string_types();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <format_to_string@plt>
mov    $0x0,%al
call   1050 <format_integer_types@plt>
mov    $0x0,%al
call   1040 <format_float_types@plt>
mov    $0x0,%al
call   1030 <format_string_types@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <format_to_string@plt>
xor    %eax,%eax
call   1050 <format_integer_types@plt>
xor    %eax,%eax
call   1040 <format_float_types@plt>
xor    %eax,%eax
call   1030 <format_string_types@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @format_to_string()
%7 = call i32 (...) @format_integer_types()
%8 = call i32 (...) @format_float_types()
%9 = call i32 (...) @format_string_types()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @format_to_string()
%4 = tail call i32 (...) @format_integer_types()
%5 = tail call i32 (...) @format_float_types()
%6 = tail call i32 (...) @format_string_types()
ret i32 0
}
/* Variables and functions */
float powf(int, double);
float db_to_coeff(const float db) {
  if (db <= -80)
    return 0;
  return powf(10, 0.05 * db);
}


x86 assembly (clang, -O0):
<db_to_coeff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     113c <db_to_coeff+0x2c>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1160 <db_to_coeff+0x50>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xebb(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <powf@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_to_coeff>:
movss  0xee8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    1133 <db_to_coeff+0x23>
cvtss2sd %xmm0,%xmm0
mulsd  0xedf(%rip),%xmm0
mov    $0xa,%edi
jmp    1030 <powf@plt>
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @db_to_coeff(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ole float %4, -8.000000e+01
br i1 %5, label %6, label %7
6: ; preds = %1
store float 0.000000e+00, float* %2
br label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fmul double 5.000000e-02, %9
%11 = call float @powf(i32 10, double %10)
store float %11, float* %2
br label %12
12: ; preds = %7, %6
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @db_to_coeff(float %0) {
%2 = fcmp ugt float %0, -8.000000e+01
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fpext float %0 to double
%5 = fmul double %4, 5.000000e-02
%6 = tail call float @powf(i32 10, double %5)
br label %7
7: ; preds = %1, %3
%8 = phi float [ %6, %3 ], [ 0.000000e+00, %1 ]
ret float %8
}
/* Type definitions */
typedef unsigned int uint8_t;
typedef unsigned int const uint32_t;

/* Variables and functions */
uint32_t be24toh_ptr(const uint8_t *p) {
  return p[2] | (p[1] << 8U) | (p[0] << 16U);
}


x86 assembly (clang, -O0):
<be24toh_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be24toh_ptr>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x8,%ecx
or     0x8(%rdi),%ecx
shl    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @be24toh_ptr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = shl i32 %13, 16
%15 = or i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @be24toh_ptr(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = or i32 %6, %3
%8 = load i32, i32* %0
%9 = shl i32 %8, 16
%10 = or i32 %7, %9
ret i32 %10
}
void swap_bits(int *a, int *b) {
  *a = *a ^ *b;
  *b = *a ^ *b;
  *a = *a ^ *b;
}


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

x86 assembly (clang, -O2):
<swap_bits>:
mov    (%rsi),%eax
xor    (%rdi),%eax
mov    %eax,(%rdi)
xor    (%rsi),%eax
mov    %eax,(%rsi)
xor    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @swap_bits(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = xor i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = xor i32 %12, %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = xor i32 %18, %20
%22 = load i32*, i32** %3
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @swap_bits(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = xor i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = xor i32 %8, %7
store i32 %9, i32* %0
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_gid;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
gid_t posix_stat_st_gid(const struct stat *st) { return st->st_gid; }


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

x86 assembly (clang, -O2):
<posix_stat_st_gid>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @posix_stat_st_gid(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @posix_stat_st_gid(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int ISNAN(double x) {
  volatile double a = x;
  if (a != a)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ISNAN>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    1132 <ISNAN+0x32>
jp     1132 <ISNAN+0x32>
jmp    113e <ISNAN+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <ISNAN+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISNAN>:
movsd  %xmm0,-0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
cmpneqsd -0x8(%rsp),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ISNAN(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
store volatile double %5, double* %4
%6 = load volatile double, double* %4
%7 = load volatile double, double* %4
%8 = fcmp une double %6, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ISNAN(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
store volatile double %0, double* %2
%4 = load volatile double, double* %2
%5 = load volatile double, double* %2
%6 = fcmp une double %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void freeVolD(double *volume) { free(volume); }


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

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

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

LLVM IR (-O2):
define void @freeVolD(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ find(int /*<<< orphan*/ *, int /*<<< orphan*/, int *, int *);
int test_empty_array() {
  int one = 0;
  int two = 0;
  find(NULL, 0, &one, &two);
  return 0 == one && 0 == two;
}


x86 assembly (clang, -O0):
<test_empty_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1030 <find@plt>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x9(%rbp)
jne    1154 <test_empty_array+0x44>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_empty_array>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <find@plt>
mov    0x4(%rsp),%ecx
xor    %eax,%eax
or     (%rsp),%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_empty_array() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @find(i32* null, i32 0, i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = icmp eq i32 0, %4
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp eq i32 0, %7
br label %9
9: ; preds = %6, %0
%10 = phi i1 [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_empty_array() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @find(i32* null, i32 0, i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
%10 = select i1 %7, i1 %9, i1 false
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ get_lexval();
int /*<<< orphan*/ root();
int yyselect();
YYSTART() {
  switch (yyselect()) {
  case 14: {
    root();
    get_lexval();
  } break;
  }
}


x86 assembly (clang, -O0):
<YYSTART>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <yyselect@plt>
sub    $0xe,%eax
jne    115b <YYSTART+0x2b>
jmp    114d <YYSTART+0x1d>
mov    $0x0,%al
call   1050 <root@plt>
mov    $0x0,%al
call   1040 <get_lexval@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<YYSTART>:
push   %rax
xor    %eax,%eax
call   1030 <yyselect@plt>
cmp    $0xe,%eax
jne    114b <YYSTART+0x1b>
xor    %eax,%eax
call   1050 <root@plt>
xor    %eax,%eax
call   1040 <get_lexval@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @YYSTART() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %6 [
i32 14, label %3
]
3: ; preds = %0
%4 = call i32 (...) @root()
%5 = call i32 (...) @get_lexval()
br label %6
6: ; preds = %0, %3
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @YYSTART() {
%1 = tail call i32 (...) @yyselect()
%2 = icmp eq i32 %1, 14
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @root()
%5 = tail call i32 (...) @get_lexval()
br label %6
6: ; preds = %0, %3
ret i32 undef
}
void deletejob(int pid) {}


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

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

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

LLVM IR (-O2):
define void @deletejob(i32 %0) {
ret void
}
void openlog(const char *ident, int option, int facility) {
  ((void)(ident));
  ((void)(option));
  ((void)(facility));
}


x86 assembly (clang, -O0):
<openlog>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @openlog(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
struct pollfd {
  int fd;
  int /*<<< orphan*/ events;
};

/* Variables and functions */
int /*<<< orphan*/ POLLIN;
int poll(struct pollfd *, int, int);
int qmpoll(int fd, int timeout) {
  struct pollfd fds[1];
  fds[0].fd = fd;
  fds[0].events = POLLIN;
  return poll(fds, 1, timeout);
}


x86 assembly (clang, -O0):
<qmpoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    $0x1,%esi
call   1030 <poll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qmpoll>:
push   %rax
mov    %esi,%edx
mov    %edi,(%rsp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <poll@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.pollfd = type { i32, i32 }
@POLLIN = global i32 0
define i32 @qmpoll(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [1 x %struct.pollfd]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %5, i64 0, i64 0
%8 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %7, i32 0, i32 0
store i32 %6, i32* %8
%9 = load i32, i32* @POLLIN
%10 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %5, i64 0, i64 0
%11 = getelementptr inbounds %struct.pollfd, %struct.pollfd* %10, i32 0, i32 1
store i32 %9, i32* %11
%12 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %5, i64 0, i64 0
%13 = load i32, i32* %4
%14 = call i32 @poll(%struct.pollfd* %12, i32 1, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.pollfd = type { i32, i32 }
@POLLIN = global i32 0
define i32 @qmpoll(i32 %0, i32 %1) {
%3 = alloca [1 x %struct.pollfd]
%4 = bitcast [1 x %struct.pollfd]* %3 to i8*
%5 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %3, i64 0, i64 0, i32 0
store i32 %0, i32* %6
%7 = load i32, i32* @POLLIN
%8 = getelementptr inbounds [1 x %struct.pollfd], [1 x %struct.pollfd]* %3, i64 0, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @poll(%struct.pollfd* %5, i32 1, i32 %1)
ret i32 %9
}
/* Variables and functions */
int *malloc(int);
main() { int *ptr = malloc(32); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 32)
ret i32 0
}
char *keyseq_verify(char **end, struct command_arg *arg) {
  *end = 0;
  return 0;
}


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

x86 assembly (clang, -O2):
<keyseq_verify>:
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.command_arg = type opaque
define i8* @keyseq_verify(i8** %0, %struct.command_arg* %1) {
%3 = alloca i8**
%4 = alloca %struct.command_arg*
store i8** %0, i8*** %3
store %struct.command_arg* %1, %struct.command_arg** %4
%5 = load i8**, i8*** %3
store i8* null, i8** %5
ret i8* null
}

LLVM IR (-O2):
%struct.command_arg = type opaque
define noalias i8* @keyseq_verify(i8** nocapture writeonly %0, %struct.command_arg* nocapture readnone %1) {
store i8* null, i8** %0
ret i8* null
}