xunge/DecIR huggingface dataset:
int floordiv(int a, int n) { return a >= 0 ? a / n : -1 - (-1 - a) / n; }


x86 assembly (clang, -O0):
<floordiv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1123 <floordiv+0x23>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
jmp    113b <floordiv+0x3b>
mov    $0xffffffff,%eax
sub    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    $0xffffffff,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @floordiv(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 = icmp sge i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
br label %17
11: ; preds = %2
%12 = load i32, i32* %3
%13 = sub nsw i32 -1, %12
%14 = load i32, i32* %4
%15 = sdiv i32 %13, %14
%16 = sub nsw i32 -1, %15
br label %17
17: ; preds = %11, %7
%18 = phi i32 [ %10, %7 ], [ %16, %11 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @floordiv(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = sdiv i32 %0, %1
br label %10
6: ; preds = %2
%7 = xor i32 %0, -1
%8 = sdiv i32 %7, %1
%9 = xor i32 %8, -1
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ %5, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ float_le(int, int);
int main(int argc, char *argv[]) {
  assert(float_le(-0, +0));
  assert(float_le(+0, -0));
  assert(float_le(0, 3));
  assert(float_le(-4, -0));
  assert(float_le(-4, 4));
  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)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <float_le@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <float_le@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <float_le@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0xfffffffc,%edi
xor    %esi,%esi
call   1040 <float_le@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0xfffffffc,%edi
mov    $0x4,%esi
call   1040 <float_le@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <float_le@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <float_le@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1040 <float_le@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0xfffffffc,%edi
xor    %esi,%esi
call   1040 <float_le@plt>
mov    %eax,%edi
call   1030 <assert@plt>
mov    $0xfffffffc,%edi
mov    $0x4,%esi
call   1040 <float_le@plt>
mov    %eax,%edi
call   1030 <assert@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 @float_le(i32 0, i32 0)
%7 = call i32 @assert(i32 %6)
%8 = call i32 @float_le(i32 0, i32 0)
%9 = call i32 @assert(i32 %8)
%10 = call i32 @float_le(i32 0, i32 3)
%11 = call i32 @assert(i32 %10)
%12 = call i32 @float_le(i32 -4, i32 0)
%13 = call i32 @assert(i32 %12)
%14 = call i32 @float_le(i32 -4, i32 4)
%15 = call i32 @assert(i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @float_le(i32 0, i32 0)
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @float_le(i32 0, i32 0)
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @float_le(i32 0, i32 3)
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @float_le(i32 -4, i32 0)
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @float_le(i32 -4, i32 4)
%12 = tail call i32 @assert(i32 %11)
ret i32 0
}
m1() {}


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

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

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

LLVM IR (-O2):
define i32 @m1() {
ret i32 undef
}
int OS_ispc(int index) { return (index >= 6); }


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

x86 assembly (clang, -O2):
<OS_ispc>:
xor    %eax,%eax
cmp    $0x6,%edi
setge  %al
ret

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

LLVM IR (-O2):
define i32 @OS_ispc(i32 %0) {
%2 = icmp sgt i32 %0, 5
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
struct timespec millis_to_timespec(long ms) {
  assert(ms >= 0);
  struct timespec ts;
  ts.tv_sec = ms / 1000;
  ts.tv_nsec = (ms & 999) * 1000000l;
  return ts;
}


x86 assembly (clang, -O0):
<millis_to_timespec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
test   %rax,%rax
setns  %al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x7,%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
and    $0x3e7,%eax
imul   $0xf4240,%rax,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<millis_to_timespec>:
push   %rbx
mov    %rdi,%rbx
shr    $0x3f,%rdi
xor    $0x1,%edi
call   1030 <assert@plt>
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rbx,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
and    $0x3e7,%ebx
imul   $0xf4240,%rbx,%rdx
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @millis_to_timespec(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sge i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i64, i64* %3
%9 = sdiv i64 %8, 1000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 %9, i64* %10
%11 = load i64, i64* %3
%12 = and i64 %11, 999
%13 = mul nsw i64 %12, 1000000
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 %13, i64* %14
%15 = bitcast %struct.timespec* %2 to { i64, i64 }*
%16 = load { i64, i64 }, { i64, i64 }* %15
ret { i64, i64 } %16
}

LLVM IR (-O2):
define { i64, i64 } @millis_to_timespec(i64 %0) {
%2 = lshr i64 %0, 63
%3 = trunc i64 %2 to i32
%4 = xor i32 %3, 1
%5 = tail call i32 @assert(i32 %4)
%6 = sdiv i64 %0, 1000
%7 = and i64 %0, 999
%8 = mul nuw nsw i64 %7, 1000000
%9 = insertvalue { i64, i64 } poison, i64 %6, 0
%10 = insertvalue { i64, i64 } %9, i64 %8, 1
ret { i64, i64 } %10
}
int test(int arg) {
  if (arg > 0 || arg == 0)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111b <test+0x1b>
cmpl   $0x0,-0x8(%rbp)
jne    1127 <test+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <test+0x2e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %edi,%eax
sar    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = ashr i32 %0, 31
ret i32 %2
}
void test45_Test4_pollen__run__E() {}


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

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

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

LLVM IR (-O2):
define void @test45_Test4_pollen__run__E() {
ret void
}
/* Variables and functions */
float iteracao(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int numero;
  float resultado = 0;
  printf("Até que termo quer somar: ");
  scanf("%d", &numero);
  resultado = iteracao(numero);
  printf("\n %.2f \n", resultado);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <iteracao@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <iteracao@plt>
cvtss2sd %xmm0,%xmm0
lea    0xebb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"At\C3\A9 que termo quer somar: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"\0A %.2f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call float @iteracao(i32 %6)
store float %7, float* %3
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"At\C3\A9 que termo quer somar: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"\0A %.2f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call float @iteracao(i32 %5)
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
int msm_jtag_restore_unregister(struct notifier_block *nb) { return 0; }


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

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

LLVM IR (-O0):
%struct.notifier_block = type opaque
define i32 @msm_jtag_restore_unregister(%struct.notifier_block* %0) {
%2 = alloca %struct.notifier_block*
store %struct.notifier_block* %0, %struct.notifier_block** %2
ret i32 0
}

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @msm_jtag_restore_unregister(%struct.notifier_block* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int IOS_Open(char *, int /*<<< orphan*/);
int FSA_Open(void) { return IOS_Open("/dev/fsa", 0); }


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

x86 assembly (clang, -O2):
<FSA_Open>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <IOS_Open@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/fsa\00"
define i32 @FSA_Open() {
%1 = call i32 @IOS_Open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %1
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/fsa\00"
define i32 @FSA_Open() {
%1 = tail call i32 @IOS_Open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %1
}
/* Variables and functions */
void ui_reset_clip(void) {}


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

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

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

LLVM IR (-O2):
define void @ui_reset_clip() {
ret void
}
int test_imm_D4uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xD4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D4uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 212
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_D4uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 910533066752
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void clobber(void) { asm volatile("" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @clobber() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void exch(void **a, void **b) {
  void *p = *a;
  *a = *b;
  *b = p;
}


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

x86 assembly (clang, -O2):
<exch>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @exch(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @exch(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  int sum = 0;
#pragma acc parallel num_gangs(GANGS) num_workers(WORKERS)                     \
    vector_length(VECTOR_WIDTH)
  {
#pragma acc loop gang worker vector
    for (int i = 0; i < ((5) * (10) * (32)); i++) {
#pragma acc atomic update
      sum = sum + 1;
    }
  }
  printf("sum=%d, expected %d\n", sum, ((5) * (10) * (32)));
  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)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x640,-0x18(%rbp)
jge    1158 <main+0x48>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <main+0x24>
mov    -0x14(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x640,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"sum=%d, expected %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 1600, i32 1600)
ret i32 0
}
unsigned long hshstrehash(const char *string) {
  unsigned long h;
  h = 0;
  while (*string) {
    h = h * 37UL + (unsigned char)*string++;
  }
  return h;
}


x86 assembly (clang, -O0):
<hshstrehash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <hshstrehash+0x40>
imul   $0x25,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hshstrehash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hshstrehash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <hshstrehash+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,8),%rdx
lea    (%rax,%rdx,4),%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hshstrehash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hshstrehash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 37
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = zext i8 %5 to i64
%11 = add i64 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
void bcm43xx_debugfs_log_txstat(struct bcm43xx_private *bcm,
                                struct bcm43xx_xmitstatus *status) {}


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

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

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

LLVM IR (-O2):
%struct.bcm43xx_private = type opaque
%struct.bcm43xx_xmitstatus = type opaque
define void @bcm43xx_debugfs_log_txstat(%struct.bcm43xx_private* nocapture %0, %struct.bcm43xx_xmitstatus* nocapture %1) {
ret void
}
void UYVYToUV422Row_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @UYVYToUV422Row_Any_AVX2() {
ret void
}
int _strlen(char *s) {
  if (*s == '\0')
    return (0);
  return (1 + _strlen(s + 1));
}


x86 assembly (clang, -O0):
<_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1138 <_strlen+0x28>
movl   $0x0,-0x4(%rbp)
jmp    114b <_strlen+0x3b>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <_strlen@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strlen>:
cmpb   $0x0,(%rdi)
je     111c <_strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void yymodify(buf) char *buf;
{
  register char *cp;
  for (cp = buf; *cp; cp++)
    if (isupper((int)*cp))
      *cp = toupper(*cp);
}


x86 assembly (clang, -O0):
<yymodify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1180 <yymodify+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%eax
je     116a <yymodify+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    116f <yymodify+0x4f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <yymodify+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yymodify>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1165 <yymodify+0x45>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    114b <yymodify+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <yymodify+0x45>
movsbl %al,%ebp
mov    %ebp,%edi
call   1040 <isupper@plt>
test   %eax,%eax
je     1140 <yymodify+0x20>
mov    %ebp,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
jmp    1140 <yymodify+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @yymodify(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @isupper(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = tail call i32 @toupper(i32 %7)
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
br label %13
13: ; preds = %4, %10
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %13, %1
ret void
}
void add_s(float *source1, float *source2, float *target) {
  *target = (*source1) + (*source2);
}


x86 assembly (clang, -O0):
<add_s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_s>:
movss  (%rdi),%xmm0
addss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @add_s(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = load float, float* %7
%9 = load float*, float** %5
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = load float*, float** %6
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @add_s(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fadd float %4, %5
store float %6, float* %2
ret void
}
int id_sort_compare_key(const void *a, const void *b) {
  if (*((long long *)a) < *((long long *)b))
    return -1;
  if (*((long long *)a) > *((long long *)b))
    return +1;
  return 0;
}


x86 assembly (clang, -O0):
<id_sort_compare_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jge    112c <id_sort_compare_key+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <id_sort_compare_key+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jle    114c <id_sort_compare_key+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <id_sort_compare_key+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<id_sort_compare_key>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @id_sort_compare_key(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int64_t get_time() {
  struct timespec time_info;
  clock_gettime(CLOCK_REALTIME, &time_info);
  return (int64_t)time_info.tv_sec * 1000000000 + (int64_t)time_info.tv_nsec;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,%eax,%eax
mov    -0x10(%rbp),%rcx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x10(%rsp),%eax
3b
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i32 @get_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i32 @get_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = mul nsw i32 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = add nsw i32 %8, %11
ret i32 %12
}
void g(void (*x)(int)) {}


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

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

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

LLVM IR (-O2):
define void @g(void (i32)* nocapture %0) {
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_v12_10_sse4() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @av_timegm() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int test();
int main(void) {
  printf("%d\n", test());
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gmx_reset_idle() {
ret void
}
int do_state_77(char c, int *state, char *word, int *length) {
  if (c == '\n') {
    *state = 78;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<do_state_77>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1139 <do_state_77+0x39>
mov    -0x10(%rbp),%rax
movl   $0x4e,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1140 <do_state_77+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_state_77>:
xor    %eax,%eax
cmp    $0xa,%dil
jne    1113 <do_state_77+0x13>
movl   $0x4e,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @do_state_77(i8 signext %0, i32* %1, i8* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32*
store i8 %0, i8* %6
store i32* %1, i32** %7
store i8* %2, i8** %8
store i32* %3, i32** %9
%10 = load i8, i8* %6
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i32*, i32** %7
store i32 78, i32* %14
store i32 1, i32* %5
br label %16
15: ; preds = %4
store i32 0, i32* %5
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @do_state_77(i8 signext %0, i32* nocapture writeonly %1, i8* nocapture readnone %2, i32* nocapture readnone %3) {
%5 = icmp eq i8 %0, 10
br i1 %5, label %6, label %7
6: ; preds = %4
store i32 78, i32* %1
br label %7
7: ; preds = %4, %6
%8 = phi i32 [ 1, %6 ], [ 0, %4 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main() {
  while (1) {
    printf(":) ");
    fflush(stdout);
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
mov    0x2e9e(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [4 x i8] c":) \00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
@.str = [4 x i8] c":) \00"
@stdout = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ cgincstat(char *, int, int);
void cgdecps(int a, int v) { cgincstat("sub", a, v); }


x86 assembly (clang, -O0):
<cgdecps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <cgincstat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdecps>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <cgincstat@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"sub\00"
define void @cgdecps(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @cgincstat(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"sub\00"
define void @cgdecps(i32 %0, i32 %1) {
%3 = tail call i32 @cgincstat(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
int fibonacci(int n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return 1;
  } else {
    return (fibonacci(n - 1) + fibonacci(n - 2));
  }
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fibonacci+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fibonacci+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fibonacci+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fibonacci+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fibonacci(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
/* Type definitions */
struct levelselector_module {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct levelselector_module *);
void LevelSelector__v__stop(struct levelselector_module *module) {
  free(module);
}


x86 assembly (clang, -O0):
<LevelSelector__v__stop>:
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):
<LevelSelector__v__stop>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.levelselector_module = type { i32 }
define void @LevelSelector__v__stop(%struct.levelselector_module* nocapture %0) {
%2 = tail call i32 @free(%struct.levelselector_module* %0)
ret void
}
void gtk_metric_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_metric_type_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int fileno(int /*<<< orphan*/);
scalar_t__ is_open(int);
int /*<<< orphan*/ stdout;
void flush_stdout(void) {
  int stdout_fd;
  stdout_fd = fileno(stdout);
  if (0 <= stdout_fd && is_open(stdout_fd))
    fflush(stdout);
}


x86 assembly (clang, -O0):
<flush_stdout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1030 <fileno@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jg     1174 <flush_stdout+0x44>
mov    -0x4(%rbp),%edi
call   1050 <is_open@plt>
cmp    $0x0,%rax
je     1174 <flush_stdout+0x44>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_stdout>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
call   1030 <fileno@plt>
test   %eax,%eax
js     1157 <flush_stdout+0x27>
mov    %eax,%edi
call   1050 <is_open@plt>
test   %rax,%rax
je     1157 <flush_stdout+0x27>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define void @flush_stdout() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = call i32 @fileno(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i32, i32* %1
%8 = call i64 @is_open(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
br label %13
13: ; preds = %10, %6, %0
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @flush_stdout() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fileno(i32 %1)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %10
4: ; preds = %0
%5 = tail call i64 @is_open(i32 %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i32, i32* @stdout
%9 = tail call i32 @fflush(i32 %8)
br label %10
10: ; preds = %7, %4, %0
ret void
}
/* Variables and functions */
int mkdir(char *, int);
int file_mkdir(char *path) { return mkdir(path, 0777); }


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

x86 assembly (clang, -O2):
<file_mkdir>:
mov    $0x1ff,%esi
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define i32 @file_mkdir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 511)
ret i32 %2
}
void mdp4_dsi_video_pipe_commit(int cndx, int wait) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_dsi_video_pipe_commit(i32 %0, i32 %1) {
ret void
}
int test_imm_25int32_mem(int *val) {
  return ((*val) & (0x25 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_25int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 37
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_25int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 37
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print_stats();
void sighandler_exit(int signum) { print_stats(); }


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

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

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

LLVM IR (-O2):
define void @sighandler_exit(i32 %0) {
%2 = tail call i32 (...) @print_stats()
ret void
}
int pci_xen_hvm_init(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @pci_xen_hvm_init() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @pci_xen_hvm_init() {
ret i32 -1
}
/* Variables and functions */
scalar_t__ strcmp(void *, void *);
int hash_compare_string(void *a, void *b) { return strcmp(a, b) == 0 ? 0 : -1; }


x86 assembly (clang, -O0):
<hash_compare_string>:
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 <strcmp@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_compare_string>:
push   %rax
call   1030 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hash_compare_string(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
ret i32 %10
}

LLVM IR (-O2):
define i32 @hash_compare_string(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ hidpp_get_unaligned_be_u16(int /*<<< orphan*/ *);
uint16_t hidpp_be_u16_to_cpu(uint16_t data) {
  return hidpp_get_unaligned_be_u16((uint8_t *)&data);
}


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

x86 assembly (clang, -O2):
<hidpp_be_u16_to_cpu>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <hidpp_get_unaligned_be_u16@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hidpp_be_u16_to_cpu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @hidpp_get_unaligned_be_u16(i32* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @hidpp_be_u16_to_cpu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @hidpp_get_unaligned_be_u16(i32* %2)
ret i32 %3
}