xunge/DecIR huggingface dataset:
unsigned short _swapw(volatile unsigned short v) {
  return ((v << 8) | (v >> 8));
}


x86 assembly (clang, -O0):
<_swapw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%eax
shl    $0x8,%eax
mov    -0x2(%rbp),%cx
movzwl %cx,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swapw>:
mov    %di,-0x2(%rsp)
movzwl -0x2(%rsp),%ecx
movzwl -0x2(%rsp),%eax
shrd   $0x8,%cx,%ax
ret

LLVM IR (-O0):
define zeroext i16 @_swapw(i16 zeroext %0) {
%2 = alloca i16
store volatile i16 %0, i16* %2
%3 = load volatile i16, i16* %2
%4 = zext i16 %3 to i32
%5 = shl i32 %4, 8
%6 = load volatile i16, i16* %2
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @_swapw(i16 zeroext %0) {
%2 = alloca i16
store volatile i16 %0, i16* %2
%3 = load volatile i16, i16* %2
%4 = load volatile i16, i16* %2
%5 = tail call i16 @llvm.fshl.i16(i16 %3, i16 %4, i16 8)
ret i16 %5
}
int compare(const void *a, const void *b) { return *(int *)a - *(int *)b; }


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

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

LLVM IR (-O0):
define i32 @compare(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, char *, unsigned int, char *, char *);
void assert_fail(char *exp, char *file, unsigned int line, char *func) {
  kprintf("%s:%d: %s: Assertion \'%s\' failed.\n", file, line, func, exp);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xec3(%rip),%rdi
call   1030 <kprintf@plt>
jmp    1142 <assert_fail+0x32>

x86 assembly (clang, -O2):
<assert_fail>:
push   %rax
mov    %rdi,%r8
lea    0xee5(%rip),%rdi
call   1030 <kprintf@plt>
jmp    1120 <assert_fail+0x10>

LLVM IR (-O0):
@.str = [35 x i8] c"%s:%d: %s: Assertion '%s' failed.\0A\00"
define void @assert_fail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i32, i32* %7
%11 = load i8*, i8** %8
%12 = load i8*, i8** %5
%13 = call i32 @kprintf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i8* %11, i8* %12)
br label %14
14: ; preds = %4, %14
br label %14
}

LLVM IR (-O2):
@.str = [35 x i8] c"%s:%d: %s: Assertion '%s' failed.\0A\00"
define void @assert_fail(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @kprintf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3, i8* %0)
br label %6
6: ; preds = %4, %6
br label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t inthash_hash(uint32_t value) { return value; }


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

x86 assembly (clang, -O2):
<inthash_hash>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @inthash_hash(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int mini(int, int);
int min(int a, int b, int c) { return mini(a, mini(b, c)); }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <mini@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <mini@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <mini@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <mini@plt>

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mini(i32 %1, i32 %2)
%5 = tail call i32 @mini(i32 %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
float gegl_floorf(float);
float gegl_fmodf(float x, float y) { return x - y * gegl_floorf(x / y); }


x86 assembly (clang, -O0):
<gegl_fmodf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1030 <gegl_floorf@plt>
movss  -0x10(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gegl_fmodf>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
divss  %xmm1,%xmm0
call   1030 <gegl_floorf@plt>
mulss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @gegl_fmodf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fdiv float %7, %8
%10 = call float @gegl_floorf(float %9)
%11 = fneg float %6
%12 = call float @llvm.fmuladd.f32(float %11, float %10, float %5)
ret float %12
}

LLVM IR (-O2):
define float @gegl_fmodf(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = tail call float @gegl_floorf(float %3)
%5 = fneg float %1
%6 = tail call float @llvm.fmuladd.f32(float %5, float %4, float %0)
ret float %6
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int rotl64(int, int);
int rotr64(int, int);
int shiftl64(int, int);
int shiftr64(int, int);
uint64_t bmw_large_s0(uint64_t x) {
  uint64_t r;
  r = shiftr64(x, 1) ^ shiftl64(x, 3) ^ rotl64(x, 4) ^ rotr64(x, 64 - 37);
  return r;
}


x86 assembly (clang, -O0):
<bmw_large_s0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1060 <shiftr64@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
call   1040 <shiftl64@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1030 <rotl64@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1b,%esi
call   1050 <rotr64@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmw_large_s0>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x1,%esi
call   1060 <shiftr64@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0x3,%esi
call   1040 <shiftl64@plt>
mov    %eax,%ebp
xor    %r14d,%ebp
mov    %ebx,%edi
mov    $0x4,%esi
call   1030 <rotl64@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0x1b,%esi
call   1050 <rotr64@plt>
xor    %r14d,%eax
xor    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bmw_large_s0(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @shiftr64(i32 %4, i32 1)
%6 = load i32, i32* %2
%7 = call i32 @shiftl64(i32 %6, i32 3)
%8 = xor i32 %5, %7
%9 = load i32, i32* %2
%10 = call i32 @rotl64(i32 %9, i32 4)
%11 = xor i32 %8, %10
%12 = load i32, i32* %2
%13 = call i32 @rotr64(i32 %12, i32 27)
%14 = xor i32 %11, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @bmw_large_s0(i32 %0) {
%2 = tail call i32 @shiftr64(i32 %0, i32 1)
%3 = tail call i32 @shiftl64(i32 %0, i32 3)
%4 = xor i32 %3, %2
%5 = tail call i32 @rotl64(i32 %0, i32 4)
%6 = xor i32 %4, %5
%7 = tail call i32 @rotr64(i32 %0, i32 27)
%8 = xor i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ a();
void *work(void *arg) {
  for (int i = 0; i <= 2; i++) {
    a();
  }
  return NULL;
}


x86 assembly (clang, -O0):
<work>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     1142 <work+0x32>
mov    $0x0,%al
call   1030 <a@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <work+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @work(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 2
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 (...) @a()
br label %9
9: ; preds = %7
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @work(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @a()
%3 = tail call i32 (...) @a()
%4 = tail call i32 (...) @a()
ret i8* null
}
int getSection(int i) {
  int ret = ((i - 1) / 1000) + 1;
  return (ret);
}


x86 assembly (clang, -O0):
<getSection>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSection>:
add    $0xffffffff,%edi
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
sar    $0x26,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getSection(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = sdiv i32 %5, 1000
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @getSection(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 1000
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int e_shoff;
  unsigned int e_shentsize;
};
typedef void Elf64_Shdr;
typedef TYPE_1__ Elf64_Ehdr;

/* Variables and functions */
const Elf64_Shdr *elf_section(const Elf64_Ehdr *elf, unsigned index) {
  return (const void *)elf + elf->e_shoff + elf->e_shentsize * index;
}


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

x86 assembly (clang, -O2):
<elf_section>:
movslq (%rdi),%rax
add    %rdi,%rax
imul   0x4(%rdi),%esi
add    %rsi,%rax
ret

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

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
define i8* @elf_section(%struct.TYPE_3__* %0, i32 %1) {
%3 = bitcast %struct.TYPE_3__* %0 to i8*
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = getelementptr i8, i8* %3, i64 %6
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%9 = load i32, i32* %8
%10 = mul i32 %9, %1
%11 = zext i32 %10 to i64
%12 = getelementptr i8, i8* %7, i64 %11
ret i8* %12
}
void vla_allocate_unsigned(unsigned int x) { int vla[x]; }


x86 assembly (clang, -O0):
<vla_allocate_unsigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vla_allocate_unsigned(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @vla_allocate_unsigned(i32 %0) {
ret void
}
int x509_certificate_chain_validate(struct x509_certificate *trusted,
                                    struct x509_certificate *chain,
                                    int *reason) {
  return -1;
}


x86 assembly (clang, -O0):
<x509_certificate_chain_validate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.x509_certificate = type opaque
define i32 @x509_certificate_chain_validate(%struct.x509_certificate* %0, %struct.x509_certificate* %1, i32* %2) {
%4 = alloca %struct.x509_certificate*
%5 = alloca %struct.x509_certificate*
%6 = alloca i32*
store %struct.x509_certificate* %0, %struct.x509_certificate** %4
store %struct.x509_certificate* %1, %struct.x509_certificate** %5
store i32* %2, i32** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.x509_certificate = type opaque
define i32 @x509_certificate_chain_validate(%struct.x509_certificate* nocapture readnone %0, %struct.x509_certificate* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_screen();
int /*<<< orphan*/ setup_screen();
int /*<<< orphan*/ simple_timer();
int main() {
  setup_screen();
  simple_timer();
  cleanup_screen();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <setup_screen@plt>
mov    $0x0,%al
call   1050 <simple_timer@plt>
mov    $0x0,%al
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <setup_screen@plt>
xor    %eax,%eax
call   1050 <simple_timer@plt>
xor    %eax,%eax
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup_screen()
%3 = call i32 (...) @simple_timer()
%4 = call i32 (...) @cleanup_screen()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup_screen()
%2 = tail call i32 (...) @simple_timer()
%3 = tail call i32 (...) @cleanup_screen()
ret i32 0
}
int f8(int y[4], int i) { return y[i]; }


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

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

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

LLVM IR (-O2):
define i32 @f8(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
long double __ieee754_coshl(long double x) {
  fputs("__ieee754_coshl not implemented\n", stderr);
  __set_errno(ENOSYS);
  return 0.0;
}


x86 assembly (clang, -O0):
<__ieee754_coshl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ieee754_coshl>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"__ieee754_coshl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_coshl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
@.str = [33 x i8] c"__ieee754_coshl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__ieee754_coshl(x86_fp80 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret x86_fp80 0xK00000000000000000000
}
/* Variables and functions */
int functiona(int, int);
int functionh(int a, int c) {
  int d = functiona(a, c);
  return d;
}


x86 assembly (clang, -O0):
<functionh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <functiona@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<functionh>:
jmp    1030 <functiona@plt>

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

LLVM IR (-O2):
define i32 @functionh(i32 %0, i32 %1) {
%3 = tail call i32 @functiona(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ getptr(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *ptr = NULL;
  getptr(ptr);
  ptr[0] = 'a';
  ptr[1] = '\0';
  printf("%s", ptr);
  free(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <getptr@plt>
mov    -0x10(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <getptr@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @getptr(i8* %3)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 97, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 0, i8* %8
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 @free(i8* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @getptr(i8* null)
unreachable
}
int SetSocketLinger(const int fd __attribute__((__unused__)),
                    const int l_onoff __attribute__((__unused__)),
                    const int l_linger __attribute__((__unused__))) {
  ;
  ;
  ;
  return (-1);
}


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

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

LLVM IR (-O0):
define i32 @SetSocketLinger(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
ret i32 -1
}

LLVM IR (-O2):
define i32 @SetSocketLinger(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main(void) {
  int *p;
  {
    int x = 5;
    p = &x;
  }
  int y = 0;
  { int y = 5; }
  y;
  p = malloc(sizeof(int));
  *p = 5;
  free(p);
  int *q;
  {
    int x;
    q = &x;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x5,-0x1c(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    -0x2c(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %3
store i32* %3, i32** %2
store i32 0, i32* %4
store i32 5, i32* %5
%8 = load i32, i32* %4
%9 = call i32* @malloc(i32 4)
store i32* %9, i32** %2
%10 = load i32*, i32** %2
store i32 5, i32* %10
%11 = load i32*, i32** %2
%12 = call i32 @free(i32* %11)
store i32* %7, i32** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
store i32 5, i32* %1
%2 = tail call i32 @free(i32* %1)
ret i32 0
}
const char *sprintfstype(magic)
int magic;
{
  static char buf[32];
  sprintf(buf, "%#x", magic);
  return buf;
}


x86 assembly (clang, -O0):
<sprintfstype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2f06(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprintfstype>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@sprintfstype.buf = internal global [32 x i8] zeroinitializer
@.str = [4 x i8] c"%#x\00"
define i8* @sprintfstype(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @sprintfstype.buf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @sprintfstype.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@sprintfstype.buf = internal global [32 x i8] zeroinitializer
@.str = [4 x i8] c"%#x\00"
define i8* @sprintfstype(i32 %0) {
%2 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @sprintfstype.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @sprintfstype.buf, i64 0, i64 0)
}
void glutPopWindow(void) {}


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

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

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

LLVM IR (-O2):
define void @glutPopWindow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_get_line();
int main() {
  test_get_line();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_get_line()
ret i32 0
}
unsigned int bl2_long4_cvt(long val) {
  int val4;
  unsigned int res;
  res = ((val & 255) * 256) + ((val >> 8) & 255);
  res = (res << 16) + (((val >> 16) & 255) * 256) + ((val >> 24) & 255);
  return res;
}


x86 assembly (clang, -O0):
<bl2_long4_cvt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
sar    $0x8,%rcx
and    $0xff,%rcx
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x10,%eax
mov    %eax,%eax
mov    -0x8(%rbp),%rcx
sar    $0x10,%rcx
and    $0xff,%rcx
shl    $0x8,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
sar    $0x18,%rcx
and    $0xff,%rcx
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bl2_long4_cvt(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = and i64 %5, 255
%7 = mul nsw i64 %6, 256
%8 = load i64, i64* %2
%9 = ashr i64 %8, 8
%10 = and i64 %9, 255
%11 = add nsw i64 %7, %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = shl i32 %13, 16
%15 = zext i32 %14 to i64
%16 = load i64, i64* %2
%17 = ashr i64 %16, 16
%18 = and i64 %17, 255
%19 = mul nsw i64 %18, 256
%20 = add nsw i64 %15, %19
%21 = load i64, i64* %2
%22 = ashr i64 %21, 24
%23 = and i64 %22, 255
%24 = add nsw i64 %20, %23
%25 = trunc i64 %24 to i32
store i32 %25, i32* %4
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @bl2_long4_cvt(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
ret i32 %3
}
/* Type definitions */
struct wpa_ctrl {
  int dummy;
};

/* Variables and functions */
int wpa_ctrl_command(struct wpa_ctrl *, char *);
int wpa_cli_cmd_pmksa(struct wpa_ctrl *ctrl, int argc, const char *argv[]) {
  return wpa_ctrl_command(ctrl, "PMKSA");
}


x86 assembly (clang, -O0):
<wpa_cli_cmd_pmksa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <wpa_ctrl_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_cli_cmd_pmksa>:
lea    0xee9(%rip),%rsi
jmp    1030 <wpa_ctrl_command@plt>

LLVM IR (-O0):
%struct.wpa_ctrl = type { i32 }
@.str = [6 x i8] c"PMKSA\00"
define i32 @wpa_cli_cmd_pmksa(%struct.wpa_ctrl* %0, i32 %1, i8** %2) {
%4 = alloca %struct.wpa_ctrl*
%5 = alloca i32
%6 = alloca i8**
store %struct.wpa_ctrl* %0, %struct.wpa_ctrl** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.wpa_ctrl*, %struct.wpa_ctrl** %4
%8 = call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
@.str = [6 x i8] c"PMKSA\00"
define i32 @wpa_cli_cmd_pmksa(%struct.wpa_ctrl* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
int getSign(long a, long b) {
  if ((a < 0 && b > 0) || (a > 0 && b < 0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<getSign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1122 <getSign+0x22>
cmpq   $0x0,-0x18(%rbp)
jg     1138 <getSign+0x38>
cmpq   $0x0,-0x10(%rbp)
jle    1144 <getSign+0x44>
cmpq   $0x0,-0x18(%rbp)
jge    1144 <getSign+0x44>
movl   $0x1,-0x4(%rbp)
jmp    114b <getSign+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSign>:
test   %rsi,%rsi
setg   %al
sets   %sil
test   %rdi,%rdi
sets   %dl
setg   %cl
and    %al,%dl
and    %sil,%cl
or     %dl,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @getSign(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, 0
%4 = icmp sgt i64 %1, 0
%5 = and i1 %3, %4
%6 = icmp sgt i64 %0, 0
%7 = icmp slt i64 %1, 0
%8 = and i1 %6, %7
%9 = or i1 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
void UARTModemControlSet(unsigned int baseAdd, unsigned int modeFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x10)))) |=
      (modeFlag &
       ((0x00000008u) | (0x00000004u) | (0x00000002u) | (0x00000001u)));
}


x86 assembly (clang, -O0):
<UARTModemControlSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
and    $0xf,%edx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemControlSet>:
and    $0xf,%esi
add    $0x10,%edi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTModemControlSet(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 = and i32 %5, 15
%7 = load i32, i32* %3
%8 = add i32 %7, 16
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = or i32 %11, %6
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @UARTModemControlSet(i32 %0, i32 %1) {
%3 = and i32 %1, 15
%4 = add i32 %0, 16
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, %3
store volatile i32 %8, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long double);
__attribute__((no)) g(long double d) { printf("%.1Lf\n", d); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%.1Lf\0A\00"
define i32 @g(x86_fp80 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), x86_fp80 %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef size_t uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(const uint64_t *array, uint16_t size) {
  uint16_t i;
  for (i = size; i > 0;)
    printf("%016llx", array[--i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    115d <print_array+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rax,%rcx,4),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1128 <print_array+0x18>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1158 <print_array+0x38>
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xec9(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    -0x4(%r14,%rbx,4),%esi
add    $0xffffffffffffffff,%rbx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %rbx,%rbx
jne    1140 <print_array+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%016llx\00"
define void @print_array(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %1, %2 ]
%6 = add i64 %5, -1
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = icmp eq i64 %6, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int int_reader() {
  int value;
  puts("Enter integer:");
  scanf("%d", &value);
  return value;
}


x86 assembly (clang, -O0):
<int_reader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_reader>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter integer:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @int_reader() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter integer:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @int_reader() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 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
ret i32 %5
}
void av_color_space_from_name() {}


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

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

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

LLVM IR (-O2):
define void @av_color_space_from_name() {
ret void
}
int main() {
  int data1 = 10;
  int result = 20;
  asm("movl %1, %%eax\n\t"
      "addl %%eax, %0"
      : "=r"(result)
      : "r"(data1), "0"(result)
      : "%eax");
  printf("The result is %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    %edx,%eax
add    %eax,%ecx
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 asm "movl $1, %eax\0A\09addl %eax, $0", "=r,r,0,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
%1 = tail call i32 asm "movl $1, %eax\0A\09addl %eax, $0", "=r,r,0,~{eax},~{dirflag},~{fpsr},~{flags}"(i32 10, i32 20)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void timer_init() {
  unsigned int val = (unsigned int)(*((volatile unsigned char *)(0xFFD80004)));
  ((*((volatile unsigned char *)(0xFFD80004))) = (val & (~(1 << 2))));
  ((*((volatile unsigned long *)((0xFFD80008 + (2 * 12))))) = (0xFFFFFFFF));
  ((*((volatile unsigned long *)((0xFFD8000C + (2 * 12))))) = (0xFFFFFFFF));
  ((*((volatile unsigned short *)((0xFFD80010 + (2 * 12))))) = (0x00000000));
}


x86 assembly (clang, -O0):
<timer_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffd80004,%eax
mov    (%rax),%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffffb,%eax
mov    %al,%cl
mov    $0xffd80004,%eax
mov    %cl,(%rax)
mov    $0xffd80020,%eax
mov    $0xffffffff,%ecx
mov    %rcx,(%rax)
mov    $0xffd80024,%eax
mov    $0xffffffff,%ecx
mov    %rcx,(%rax)
mov    $0xffd80028,%eax
movw   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_init>:
mov    $0xffd80004,%eax
andb   $0xfb,(%rax)
lea    0x27fffb(%rax),%rcx
mov    %rcx,0x1c(%rax)
mov    %rcx,0x20(%rax)
movw   $0x0,0x24(%rax)
ret

LLVM IR (-O0):
define void @timer_init() {
%1 = alloca i32
%2 = load volatile i8, i8* inttoptr (i64 4292345860 to i8*)
%3 = zext i8 %2 to i32
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = and i32 %4, -5
%6 = trunc i32 %5 to i8
store volatile i8 %6, i8* inttoptr (i64 4292345860 to i8*)
store volatile i64 4294967295, i64* inttoptr (i64 4292345888 to i64*)
store volatile i64 4294967295, i64* inttoptr (i64 4292345892 to i64*)
store volatile i16 0, i16* inttoptr (i64 4292345896 to i16*)
ret void
}

LLVM IR (-O2):
define void @timer_init() {
%1 = load volatile i8, i8* inttoptr (i64 4292345860 to i8*)
%2 = and i8 %1, -5
store volatile i8 %2, i8* inttoptr (i64 4292345860 to i8*)
store volatile i64 4294967295, i64* inttoptr (i64 4292345888 to i64*)
store volatile i64 4294967295, i64* inttoptr (i64 4292345892 to i64*)
store volatile i16 0, i16* inttoptr (i64 4292345896 to i16*)
ret void
}
int divideByTen(int x) {
  int tenValue = 10;
  return x / tenValue;
}


x86 assembly (clang, -O0):
<divideByTen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<divideByTen>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @divideByTen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 10, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = sdiv i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @divideByTen(i32 %0) {
%2 = sdiv i32 %0, 10
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ uart_write_char(int /*<<< orphan*/);
void uart_write_str(const char *s) {
  while (*s) {
    uart_write_char(*s++);
  }
}


x86 assembly (clang, -O0):
<uart_write_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <uart_write_str+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <uart_write_char@plt>
jmp    111c <uart_write_str+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_write_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart_write_str+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart_write_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart_write_str+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_write_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @uart_write_char(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int sandbox_after(int arg) {
  (void)arg;
  return (1);
}


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

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

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

LLVM IR (-O2):
define i32 @sandbox_after(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ RemoveTmpFiles();
int /*<<< orphan*/ exit(int);
void interrupt() {
  RemoveTmpFiles();
  exit(3);
}


x86 assembly (clang, -O0):
<interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <RemoveTmpFiles@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<interrupt>:
push   %rax
xor    %eax,%eax
call   1030 <RemoveTmpFiles@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @interrupt() {
%1 = call i32 (...) @RemoveTmpFiles()
%2 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
define void @interrupt() {
%1 = tail call i32 (...) @RemoveTmpFiles()
%2 = tail call i32 @exit(i32 3)
unreachable
}
int fun710() { return 710; }


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

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

LLVM IR (-O0):
define i32 @fun710() {
ret i32 710
}

LLVM IR (-O2):
define i32 @fun710() {
ret i32 710
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long time;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
void set_XKeyEvent_time(void *_p, unsigned long _v) {
  ((XKeyEvent *)_p)->time = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XKeyEvent_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rt_InitInfAndNaN(unsigned int);
void Prep_fft_initialize(void) { rt_InitInfAndNaN(8U); }


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

x86 assembly (clang, -O2):
<Prep_fft_initialize>:
mov    $0x8,%edi
jmp    1030 <rt_InitInfAndNaN@plt>

LLVM IR (-O0):
define void @Prep_fft_initialize() {
%1 = call i32 @rt_InitInfAndNaN(i32 8)
ret void
}

LLVM IR (-O2):
define void @Prep_fft_initialize() {
%1 = tail call i32 @rt_InitInfAndNaN(i32 8)
ret void
}