xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, unsigned int);
void KeccakP200_OverwriteBytes(void *state, const unsigned char *data,
                               unsigned int offset, unsigned int length) {
  assert(offset < 25);
  assert(offset + length <= 25);
  memcpy((unsigned char *)state + offset, data, length);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x19,-0x14(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cmp    $0x19,%eax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%eax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebx
mov    %rsi,%r15
mov    %rdi,%r12
xor    %edi,%edi
cmp    $0x19,%edx
setb   %dil
call   1030 <assert@plt>
lea    (%r14,%rbx,1),%eax
xor    %edi,%edi
cmp    $0x1a,%eax
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
add    %rax,%r12
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define void @KeccakP200_OverwriteBytes(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = icmp ult i32 %9, 25
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = add i32 %13, %14
%16 = icmp ule i32 %15, 25
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8*, i8** %5
%20 = load i32, i32* %7
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8*, i8** %6
%24 = load i32, i32* %8
%25 = call i32 @memcpy(i8* %22, i8* %23, i32 %24)
ret void
}

LLVM IR (-O2):
define void @KeccakP200_OverwriteBytes(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp ult i32 %2, 25
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = add i32 %3, %2
%9 = icmp ult i32 %8, 26
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = zext i32 %2 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = tail call i32 @memcpy(i8* %13, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ COND_MI();
int /*<<< orphan*/ EA_AY_PI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_smi_8_pi(void) {
  m68ki_write_8(EA_AY_PI_8(), COND_MI() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_smi_8_pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_PI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_MI@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_smi_8_pi>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_PI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_MI@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_smi_8_pi() {
%1 = call i32 (...) @EA_AY_PI_8()
%2 = call i64 (...) @COND_MI()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_smi_8_pi() {
%1 = tail call i32 (...) @EA_AY_PI_8()
%2 = tail call i64 (...) @COND_MI()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int get_brightness();
int /*<<< orphan*/ set_brightness(int);
void dec_brightness() {
  int brightness = get_brightness();
  set_brightness(brightness <= 2 ? 0 : brightness / 2);
}


x86 assembly (clang, -O0):
<dec_brightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_brightness@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jg     1146 <dec_brightness+0x26>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <dec_brightness+0x34>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <set_brightness@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_brightness>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <get_brightness@plt>
cmp    $0x3,%eax
jl     1138 <dec_brightness+0x18>
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <set_brightness@plt>

LLVM IR (-O0):
define void @dec_brightness() {
%1 = alloca i32
%2 = call i32 (...) @get_brightness()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 2
br i1 %4, label %5, label %6
5: ; preds = %0
br label %9
6: ; preds = %0
%7 = load i32, i32* %1
%8 = sdiv i32 %7, 2
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ 0, %5 ], [ %8, %6 ]
%11 = call i32 @set_brightness(i32 %10)
ret void
}

LLVM IR (-O2):
define void @dec_brightness() {
%1 = tail call i32 (...) @get_brightness()
%2 = icmp slt i32 %1, 3
%3 = sdiv i32 %1, 2
%4 = select i1 %2, i32 0, i32 %3
%5 = tail call i32 @set_brightness(i32 %4)
ret void
}
int rsock_udp_optname_to_int(const char *str, long len, int *valp) {
  switch (len) {
  case 4:
    return -1;
  case 8:
    return -1;
  default:
    if (!str || !valp) {
    }
    return -1;
  }
}


x86 assembly (clang, -O0):
<rsock_udp_optname_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
sub    $0x4,%rax
je     113a <rsock_udp_optname_to_int+0x3a>
jmp    1127 <rsock_udp_optname_to_int+0x27>
mov    -0x28(%rbp),%rax
sub    $0x8,%rax
je     1146 <rsock_udp_optname_to_int+0x46>
jmp    1152 <rsock_udp_optname_to_int+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <rsock_udp_optname_to_int+0x74>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <rsock_udp_optname_to_int+0x74>
cmpq   $0x0,-0x10(%rbp)
je     1168 <rsock_udp_optname_to_int+0x68>
cmpq   $0x0,-0x20(%rbp)
jne    116d <rsock_udp_optname_to_int+0x6d>
jmp    116d <rsock_udp_optname_to_int+0x6d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rsock_udp_optname_to_int(i8* nocapture readnone %0, i64 %1, i32* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void grt_stack_error_grow_failed(void) { abort(); }


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

x86 assembly (clang, -O2):
<grt_stack_error_grow_failed>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @grt_stack_error_grow_failed() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @grt_stack_error_grow_failed() {
%1 = tail call i32 (...) @abort()
unreachable
}
int main(int argc, const char *argv[]) {
  struct my_struct {
    int a;
    float b;
    int c;
    struct {
      int e;
      float f;
      double g;
      struct {
        float i;
      } h;
      int j;
    } d;
  } x, y;
  x.a = 1;
  x.b = 1.3;
  x.c = 12;
  x.d.e = 100;
  x.d.f = 1.45;
  x.d.g = 45.85;
  x.d.h.i = 148963;
  x.d.j = 1578;
  y = x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x38(%rbp)
movss  0xed3(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
movl   $0xc,-0x30(%rbp)
movl   $0x64,-0x28(%rbp)
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  0xe96(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x62a,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
lea    -0x38(%rbp),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.my_struct = type { i32, float, i32, %struct.anon }
%struct.anon = type { i32, float, double, %struct.anon.0, i32 }
%struct.anon.0 = type { float }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.my_struct
%7 = alloca %struct.my_struct
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds %struct.my_struct, %struct.my_struct* %6, i32 0, i32 0
store i32 1, i32* %8
%9 = getelementptr inbounds %struct.my_struct, %struct.my_struct* %6, i32 0, i32 1
store float 0x3FF4CCCCC0000000, float* %9
%10 = getelementptr inbounds %struct.my_struct, %struct.my_struct* %6, i32 0, i32 2
store i32 12, i32* %10
%11 = getelementptr inbounds %struct.my_struct, %struct.my_struct* %6, i32 0, i32 3
%12 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 0
store i32 100, i32* %12
%13 = getelementptr inbounds %struct.my_struct, %struct.my_struct* %6, i32 0, i32 3
%14 = getelementptr inbounds %struct.anon, %struct.anon* %13, i32 0, i32 1
store float 0x3FF7333340000000, float* %14
%15 = getelementptr inbounds %struct.my_struct, %struct.my_struct* %6, i32 0, i32 3
%16 = getelementptr inbounds %struct.anon, %struct.anon* %15, i32 0, i32 2
store double 4.585000e+01, double* %16
%17 = getelementptr inbounds %struct.my_struct, %struct.my_struct* %6, i32 0, i32 3
%18 = getelementptr inbounds %struct.anon, %struct.anon* %17, i32 0, i32 3
%19 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %18, i32 0, i32 0
store float 1.489630e+05, float* %19
%20 = getelementptr inbounds %struct.my_struct, %struct.my_struct* %6, i32 0, i32 3
%21 = getelementptr inbounds %struct.anon, %struct.anon* %20, i32 0, i32 4
store i32 1578, i32* %21
%22 = bitcast %struct.my_struct* %7 to i8*
%23 = bitcast %struct.my_struct* %6 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
void set_16_be(uint8_t *const p, const unsigned int x) {
  p[0] = (x >> 8) & 0xff;
  p[1] = x & 0xff;
}


x86 assembly (clang, -O0):
<set_16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_16_be>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @set_16_be(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 = lshr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @set_16_be(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
/* Type definitions */
struct rnode_iterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rnode_iterator *);
void destroy_rnode_iterator(struct rnode_iterator *it) { free(it); }


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

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

LLVM IR (-O2):
%struct.rnode_iterator = type { i32 }
define void @destroy_rnode_iterator(%struct.rnode_iterator* nocapture %0) {
%2 = tail call i32 @free(%struct.rnode_iterator* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void woof() { puts("woof"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"woof\00"
define void @woof() {
%1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"woof\00"
define void @woof() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ ui32Base;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int _PWMGenValid(int);
void PWMGenDisable(uint32_t ui32Base, uint32_t ui32Gen) {
  ASSERT((ui32Base == 0x40028000) || (ui32Base == 0x40029000));
  ASSERT(_PWMGenValid(ui32Gen));
  (*((volatile uint32_t *)(((ui32Base) + (ui32Gen)) + 0x00000000))) &=
      ~(0x00000001);
}


x86 assembly (clang, -O0):
<PWMGenDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x40028000,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     114d <PWMGenDisable+0x2d>
cmpl   $0x40029000,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    -0x8(%rbp),%edi
call   1030 <_PWMGenValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenDisable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40028000,%eax
sete   %dil
call   1040 <ASSERT@plt>
mov    %ebx,%edi
call   1030 <_PWMGenValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebx,%rax
movslq %ebp,%rcx
andl   $0xfffffffe,(%rax,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @PWMGenDisable(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 eq i32 %5, 1073905664
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1073909760
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = call i32 @_PWMGenValid(i32 %14)
%16 = call i32 @ASSERT(i32 %15)
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = add nsw i32 %17, %18
%20 = add nsw i32 %19, 0
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
%24 = and i32 %23, -2
store volatile i32 %24, i32* %22
ret void
}

LLVM IR (-O2):
define void @PWMGenDisable(i32 %0, i32 %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073905664
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = tail call i32 @_PWMGenValid(i32 %1)
%8 = tail call i32 @ASSERT(i32 %7)
%9 = add nsw i32 %1, %0
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = and i32 %12, -2
store volatile i32 %13, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ elemdb_sql_delete(int);
int /*<<< orphan*/ mapif_delete_elem_ack(int, int /*<<< orphan*/);
int mapif_delete_elem(int fd, int elem_id) {
  mapif_delete_elem_ack(fd, elemdb_sql_delete(elem_id));
  return 0;
}


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

x86 assembly (clang, -O2):
<mapif_delete_elem>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <elemdb_sql_delete@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <mapif_delete_elem_ack@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mapif_delete_elem(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 @elemdb_sql_delete(i32 %6)
%8 = call i32 @mapif_delete_elem_ack(i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @mapif_delete_elem(i32 %0, i32 %1) {
%3 = tail call i32 @elemdb_sql_delete(i32 %1)
%4 = tail call i32 @mapif_delete_elem_ack(i32 %0, i32 %3)
ret i32 0
}
/* Variables and functions */
float gauss(float, double);
float dGauss(float x, double sigma) {
  return -x / (sigma * sigma) * gauss(x, sigma);
}


x86 assembly (clang, -O0):
<dGauss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <gauss@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dGauss>:
push   %rax
movaps 0xee8(%rip),%xmm2
xorps  %xmm0,%xmm2
cvtss2sd %xmm2,%xmm3
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm2,%xmm3
movsd  %xmm3,(%rsp)
call   1030 <gauss@plt>
cvtss2sd %xmm0,%xmm0
mulsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @dGauss(float %0, double %1) {
%3 = alloca float
%4 = alloca double
store float %0, float* %3
store double %1, double* %4
%5 = load float, float* %3
%6 = fneg float %5
%7 = fpext float %6 to double
%8 = load double, double* %4
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = fdiv double %7, %10
%12 = load float, float* %3
%13 = load double, double* %4
%14 = call float @gauss(float %12, double %13)
%15 = fpext float %14 to double
%16 = fmul double %11, %15
%17 = fptrunc double %16 to float
ret float %17
}

LLVM IR (-O2):
define float @dGauss(float %0, double %1) {
%3 = fneg float %0
%4 = fpext float %3 to double
%5 = fmul double %1, %1
%6 = fdiv double %4, %5
%7 = tail call float @gauss(float %0, double %1)
%8 = fpext float %7 to double
%9 = fmul double %6, %8
%10 = fptrunc double %9 to float
ret float %10
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime_r(int /*<<< orphan*/ const *, struct tm *);
struct tm *localtime_r(const time_t *restrict timep, struct tm *restrict tm) {
  return gmtime_r(timep, tm);
}


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

x86 assembly (clang, -O2):
<localtime_r>:
jmp    1030 <gmtime_r@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* noalias %0, %struct.tm* noalias %1) {
%3 = alloca i32*
%4 = alloca %struct.tm*
store i32* %0, i32** %3
store %struct.tm* %1, %struct.tm** %4
%5 = load i32*, i32** %3
%6 = load %struct.tm*, %struct.tm** %4
%7 = call %struct.tm* @gmtime_r(i32* %5, %struct.tm* %6)
ret %struct.tm* %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* noalias %0, %struct.tm* noalias %1) {
%3 = tail call %struct.tm* @gmtime_r(i32* %0, %struct.tm* %1)
ret %struct.tm* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *AbreFicheiro(char *nome, char *mode) {
  FILE *f;
  f = fopen(nome, mode);
  if (f == NULL) {
    fprintf(stderr, "Error: Unable to open file %s\n.", nome);
    exit(1);
  }
  return f;
}


x86 assembly (clang, -O0):
<AbreFicheiro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <AbreFicheiro+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AbreFicheiro>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <AbreFicheiro+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Error: Unable to open file %s\0A.\00"
define i32* @AbreFicheiro(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Error: Unable to open file %s\0A.\00"
define noalias i32* @AbreFicheiro(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ main_FILE(char *, char *);
int /*<<< orphan*/ terror(char *);
int main(int ac, char **av) {
  if (ac != 3) {
    terror("USE: words seqFile.IN words.OUT");
  }
  main_FILE(av[1], av[2]);
  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)
cmpl   $0x3,-0x8(%rbp)
je     114c <main+0x2c>
lea    0xeb9(%rip),%rdi
call   1040 <terror@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <main_FILE@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x3,%edi
je     1135 <main+0x15>
lea    0xed0(%rip),%rdi
call   1040 <terror@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
call   1030 <main_FILE@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"USE: words seqFile.IN words.OUT\00"
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 = load i32, i32* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @terror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @main_FILE(i8* %13, i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"USE: words seqFile.IN words.OUT\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @terror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @main_FILE(i8* %8, i8* %10)
ret i32 0
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int Accept(int listenfd, struct sockaddr_in *clientaddr, socklen_t *addrlen) {
  int connfd;
  if ((connfd = accept(listenfd, (struct sockaddr *)clientaddr, addrlen)) ==
      -1) {
    perror("accept");
    exit(1);
  }
  return connfd;
}


x86 assembly (clang, -O0):
<Accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
jne    1175 <Accept+0x45>
lea    0xe9a(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Accept>:
push   %rax
call   1040 <accept@plt>
cmp    $0xffffffff,%eax
je     113d <Accept+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [7 x i8] c"accept\00"
define i32 @Accept(i32 %0, %struct.sockaddr_in* %1, i32* %2) {
%4 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%5 = tail call i32 @accept(i32 %0, %struct.sockaddr* %4, i32* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ byteswap64(int /*<<< orphan*/);
scalar_t__ little_endianess();
uint64_t ntohll_util(uint64_t input) {
  if (little_endianess()) {
    return byteswap64(input);
  } else {
    return input;
  }
}


x86 assembly (clang, -O0):
<ntohll_util>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <little_endianess@plt>
cmp    $0x0,%rax
je     114c <ntohll_util+0x2c>
mov    -0x8(%rbp),%edi
call   1040 <byteswap64@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <ntohll_util+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohll_util>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <little_endianess@plt>
test   %rax,%rax
je     1137 <ntohll_util+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <byteswap64@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ntohll_util(i32 %0) {
%2 = tail call i64 (...) @little_endianess()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @byteswap64(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
void terminal_init(void) {}


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

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

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

LLVM IR (-O2):
define void @terminal_init() {
ret void
}
/* Variables and functions */
int rename(char const *, char const *);
int d2u_rename(const char *oldname, const char *newname) {
  return rename(oldname, newname);
}


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

x86 assembly (clang, -O2):
<d2u_rename>:
jmp    1030 <rename@plt>

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

LLVM IR (-O2):
define i32 @d2u_rename(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
ret i32 %3
}
__attribute__((always_)) int notifier_from_errno(int err) {
  return 0x8000 | (0x0001 - err);
}


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

x86 assembly (clang, -O2):
<notifier_from_errno>:
mov    $0x1,%eax
sub    %edi,%eax
or     $0x8000,%eax
ret

LLVM IR (-O0):
define i32 @notifier_from_errno(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 1, %3
%5 = or i32 32768, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @notifier_from_errno(i32 %0) {
%2 = sub nsw i32 1, %0
%3 = or i32 %2, 32768
ret i32 %3
}
int outBounds(const char *start, const char *end, char *ptr) {
  if ((ptr >= start) && (ptr < end))
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<outBounds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1138 <outBounds+0x38>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1138 <outBounds+0x38>
movl   $0x0,-0x4(%rbp)
jmp    113f <outBounds+0x3f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<outBounds>:
cmp    %rdi,%rdx
setb   %al
cmp    %rsi,%rdx
setae  %cl
or     %al,%cl
movzbl %cl,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @outBounds(i8* readnone %0, i8* readnone %1, i8* readnone %2) {
%4 = icmp ult i8* %2, %0
%5 = icmp uge i8* %2, %1
%6 = or i1 %4, %5
%7 = sext i1 %6 to i32
ret i32 %7
}
void auth_finish(void) {}


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

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

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

LLVM IR (-O2):
define void @auth_finish() {
ret void
}
unsigned short inw(int port) {
  unsigned short ret;
  __asm__("inw %w1, %w0" : "=a"(ret) : "Nd"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%ax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define zeroext i16 @inw(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i16 asm "inw ${1:w}, ${0:w}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inw(i32 %0) {
%2 = tail call i16 asm "inw ${1:w}, ${0:w}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i16 %2
}
double feetToMillimetres(double feet) { return feet * 304.8; }


x86 assembly (clang, -O0):
<feetToMillimetres>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<feetToMillimetres>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @feetToMillimetres(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.048000e+02
ret double %4
}

LLVM IR (-O2):
define double @feetToMillimetres(double %0) {
%2 = fmul double %0, 3.048000e+02
ret double %2
}
char __ocl_hadd_char(char src1, char src2) {
  char carry = (src1 & 1) & (src2 & 1);
  return (src1 >> 1) + (src2 >> 1) + carry;
}


x86 assembly (clang, -O0):
<__ocl_hadd_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x1,%eax
movsbl -0x2(%rbp),%ecx
and    $0x1,%ecx
and    %ecx,%eax
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x1,%eax
movsbl -0x2(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
movsbl -0x3(%rbp),%ecx
add    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_hadd_char>:
mov    %edi,%ecx
and    %sil,%cl
and    $0x1,%cl
sar    %dil
sar    %sil
lea    (%rsi,%rdi,1),%eax
add    %cl,%al
ret

LLVM IR (-O0):
define signext i8 @__ocl_hadd_char(i8 signext %0, i8 signext %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 = sext i8 %6 to i32
%8 = and i32 %7, 1
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = and i32 %10, 1
%12 = and i32 %8, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %5
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = ashr i32 %15, 1
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = ashr i32 %18, 1
%20 = add nsw i32 %16, %19
%21 = load i8, i8* %5
%22 = sext i8 %21 to i32
%23 = add nsw i32 %20, %22
%24 = trunc i32 %23 to i8
ret i8 %24
}

LLVM IR (-O2):
define signext i8 @__ocl_hadd_char(i8 signext %0, i8 signext %1) {
%3 = and i8 %0, 1
%4 = and i8 %3, %1
%5 = ashr i8 %0, 1
%6 = ashr i8 %1, 1
%7 = add nsw i8 %6, %5
%8 = add nsw i8 %7, %4
ret i8 %8
}
void lockdep_set_selftest_task(struct task_struct *task) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @lockdep_set_selftest_task(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int StatMomentDouble(double *, int, int, int);
double StatVarnDouble(double a[], int n, int s) {
  return StatMomentDouble(a, n, s, 2) / n;
}


x86 assembly (clang, -O0):
<StatVarnDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x2,%ecx
call   1030 <StatMomentDouble@plt>
cltd
idivl  -0xc(%rbp)
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StatVarnDouble>:
push   %rbx
mov    %esi,%ebx
mov    $0x2,%ecx
call   1030 <StatMomentDouble@plt>
cltd
idiv   %ebx
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @StatVarnDouble(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @StatMomentDouble(double* %7, i32 %8, i32 %9, i32 2)
%11 = load i32, i32* %5
%12 = sdiv i32 %10, %11
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @StatVarnDouble(double* %0, i32 %1, i32 %2) {
%4 = tail call i32 @StatMomentDouble(double* %0, i32 %1, i32 %2, i32 2)
%5 = sdiv i32 %4, %1
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printString(char headerMessage[], char value[]) {
  printf("%s", headerMessage);
  printf("%s", value);
}


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

x86 assembly (clang, -O2):
<printString>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xedf(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printString(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int Base64_EncodeSize(int DataSize) { return ((DataSize + 2) / 3) << 2; }


x86 assembly (clang, -O0):
<Base64_EncodeSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Base64_EncodeSize>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
shl    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @Base64_EncodeSize(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl i32 %3, 2
ret i32 %4
}
__attribute__((always_)) int builtin_strcmp(const char *cs, const char *ct) {
  unsigned char c1, c2;
  while (1) {
    c1 = *cs++;
    c2 = *ct++;
    if (c1 != c2)
      return c1 < c2 ? -1 : 1;
    if (!c1)
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<builtin_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movzbl -0x19(%rbp),%eax
movzbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
je     1163 <builtin_strcmp+0x63>
movzbl -0x19(%rbp),%edx
movzbl -0x1a(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    117e <builtin_strcmp+0x7e>
cmpb   $0x0,-0x19(%rbp)
jne    1172 <builtin_strcmp+0x72>
jmp    1177 <builtin_strcmp+0x77>
jmp    110c <builtin_strcmp+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_strcmp>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
cmp    (%rsi,%rax,1),%cl
jne    1124 <builtin_strcmp+0x24>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <builtin_strcmp+0x10>
xor    %eax,%eax
ret
setae  %al
movzbl %al,%eax
add    %eax,%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @builtin_strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %12, %2
%4 = phi i8* [ %1, %2 ], [ %13, %12 ]
%5 = phi i8* [ %0, %2 ], [ %14, %12 ]
%6 = load i8, i8* %5
%7 = load i8, i8* %4
%8 = icmp eq i8 %6, %7
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = icmp ult i8 %6, %7
%11 = select i1 %10, i32 -1, i32 1
br label %16
12: ; preds = %3
%13 = getelementptr inbounds i8, i8* %4, i64 1
%14 = getelementptr inbounds i8, i8* %5, i64 1
%15 = icmp eq i8 %6, 0
br i1 %15, label %16, label %3
16: ; preds = %12, %9
%17 = phi i32 [ %11, %9 ], [ 0, %12 ]
ret i32 %17
}
void stats_motor_enable(void *ctx, char on) {}


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

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

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

LLVM IR (-O2):
define void @stats_motor_enable(i8* nocapture %0, i8 signext %1) {
ret void
}
int axp_set_pekdelay(int pek) {
  int ret = 0;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @axp_set_pekdelay(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clean_stdin();
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
int choix_old() {
  int c;
  c = 0;
  printf("choix : ");
  if (scanf("%d", &c) == 1)
    ;
  else
    c = 0;
  clean_stdin();
  return c;
}


x86 assembly (clang, -O0):
<choix_old>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1169 <choix_old+0x39>
jmp    1170 <choix_old+0x40>
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <clean_stdin@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choix_old>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1163 <choix_old+0x33>
movl   $0x0,0x4(%rsp)
xor    %eax,%eax
call   1040 <clean_stdin@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"choix : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @choix_old() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 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 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %0
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %5
%8 = call i32 (...) @clean_stdin()
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"choix : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @choix_old() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 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 = icmp eq i32 %4, 1
br i1 %5, label %7, label %6
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %0, %6
%8 = call i32 (...) @clean_stdin()
%9 = load i32, i32* %1
ret i32 %9
}