xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_next(char const **);
const char *get_index(const char *list, uint8_t i) {
  while (i-- > 0) {
    get_next(&list);
  }
  return list;
}


x86 assembly (clang, -O0):
<get_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1141 <get_index+0x31>
lea    -0x8(%rbp),%rdi
call   1030 <get_next@plt>
jmp    111f <get_index+0xf>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_index>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rax
mov    %rdi,(%rsp)
test   %esi,%esi
jle    1144 <get_index+0x34>
mov    %esi,%ebx
add    $0x1,%ebx
mov    %rsp,%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <get_next@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <get_index+0x20>
mov    (%rsp),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @get_index(i8* %0, i32 %1) {
%3 = alloca i8*
store i8* %0, i8** %3
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %12
5: ; preds = %2, %5
%6 = phi i32 [ %7, %5 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = call i32 @get_next(i8** %3)
%9 = icmp ugt i32 %6, 1
br i1 %9, label %5, label %10
10: ; preds = %5
%11 = load i8*, i8** %3
br label %12
12: ; preds = %10, %2
%13 = phi i8* [ %11, %10 ], [ %0, %2 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int __xfree(void *ptr, char *file, int line) { free(ptr); }


x86 assembly (clang, -O0):
<__xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__xfree(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @free(i8* %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegReadWord(int /*<<< orphan*/, int);
uint16_t wiznetGetFragmentOffset(uint8_t socket) {
  return wiznetRegReadWord(socket, (0x0000 + 0x002D));
}


x86 assembly (clang, -O0):
<wiznetGetFragmentOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2d,%esi
call   1030 <wiznetRegReadWord@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiznetGetFragmentOffset>:
mov    $0x2d,%esi
jmp    1030 <wiznetRegReadWord@plt>

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

LLVM IR (-O2):
define i32 @wiznetGetFragmentOffset(i32 %0) {
%2 = tail call i32 @wiznetRegReadWord(i32 %0, i32 45)
ret i32 %2
}
void g_type_name() {}


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

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

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

LLVM IR (-O2):
define void @g_type_name() {
ret void
}
void write_pot_table0(char const *filename) {}


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

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

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

LLVM IR (-O2):
define void @write_pot_table0(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_putmem(void *dest, const void *src, size_t len, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_putmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_putmem(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_putmem(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pA(char *);
int /*<<< orphan*/ write_mem(char const *, char *);
void push_callstack(const char *register_name) {
  write_mem(register_name, "callstack_head");
  pA("callstack_head++;");
}


x86 assembly (clang, -O0):
<push_callstack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <write_mem@plt>
lea    0xecc(%rip),%rdi
call   1030 <pA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_callstack>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <write_mem@plt>
lea    0xedb(%rip),%rdi
pop    %rax
jmp    1030 <pA@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"callstack_head\00"
@.str.1 = [18 x i8] c"callstack_head++;\00"
define void @push_callstack(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write_mem(i8* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pA(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"callstack_head\00"
@.str.1 = [18 x i8] c"callstack_head++;\00"
define void @push_callstack(i8* %0) {
%2 = tail call i32 @write_mem(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pA(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
unsigned long get_XMotionEvent_serial(void *_p) {
  return (unsigned long)((XMotionEvent *)_p)->serial;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XMotionEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int mlt_sample_calculator_to_now(float, int, scalar_t__);
int mlt_sample_calculator(float fps, int frequency, int64_t position) {
  return mlt_sample_calculator_to_now(fps, frequency, position + 1) -
         mlt_sample_calculator_to_now(fps, frequency, position);
}


x86 assembly (clang, -O0):
<mlt_sample_calculator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1030 <mlt_sample_calculator_to_now@plt>
mov    %eax,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <mlt_sample_calculator_to_now@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlt_sample_calculator>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
movss  %xmm0,0xc(%rsp)
add    $0x1,%rsi
call   1030 <mlt_sample_calculator_to_now@plt>
mov    %eax,%ebx
movss  0xc(%rsp),%xmm0
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <mlt_sample_calculator_to_now@plt>
sub    %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mlt_sample_calculator(float %0, i32 %1, i64 %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i64
store float %0, float* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load float, float* %4
%8 = load i32, i32* %5
%9 = load i64, i64* %6
%10 = add nsw i64 %9, 1
%11 = call i32 @mlt_sample_calculator_to_now(float %7, i32 %8, i64 %10)
%12 = load float, float* %4
%13 = load i32, i32* %5
%14 = load i64, i64* %6
%15 = call i32 @mlt_sample_calculator_to_now(float %12, i32 %13, i64 %14)
%16 = sub nsw i32 %11, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @mlt_sample_calculator(float %0, i32 %1, i64 %2) {
%4 = add nsw i64 %2, 1
%5 = tail call i32 @mlt_sample_calculator_to_now(float %0, i32 %1, i64 %4)
%6 = tail call i32 @mlt_sample_calculator_to_now(float %0, i32 %1, i64 %2)
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int mylibA();
int mylibD();
int main() { return mylibA() + mylibD(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <mylibA@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <mylibD@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @mylibA()
%3 = call i32 (...) @mylibD()
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mylibA()
%2 = tail call i32 (...) @mylibD()
%3 = add nsw i32 %2, %1
ret i32 %3
}
int test_imm_75int8_mem(signed char *val) {
  return ((*val) & (0x75 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_75int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 117
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Display_CacheAll();
void UI_Cache_f(void) { Display_CacheAll(); }


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

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

LLVM IR (-O0):
define void @UI_Cache_f() {
%1 = call i32 (...) @Display_CacheAll()
ret void
}

LLVM IR (-O2):
define void @UI_Cache_f() {
%1 = tail call i32 (...) @Display_CacheAll()
ret void
}
long nrand(n)
long n;
{ return (long)(rand01() * (double)n); }


x86 assembly (clang, -O0):
<nrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand01@plt>
cvtsi2sd %eax,%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrand>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand01@plt>
cvtsi2sd %eax,%xmm0
cvtsi2sd %rbx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @nrand(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @rand01()
%4 = sitofp i32 %3 to double
%5 = load i64, i64* %2
%6 = sitofp i64 %5 to double
%7 = fmul double %4, %6
%8 = fptosi double %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @nrand(i64 %0) {
%2 = tail call i32 (...) @rand01()
%3 = sitofp i32 %2 to double
%4 = sitofp i64 %0 to double
%5 = fmul double %4, %3
%6 = fptosi double %5 to i64
ret i64 %6
}
int test_imm_76int16_reg(short val) {
  return ((val) & (-0x76 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_76int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff8a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_76int16_reg>:
test   $0xff8a,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_76int16_reg(i16 signext %0) {
%2 = and i16 %0, -118
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int _calc_gradient_one_pixel(int gx, int gy) {
  int g;
  if (gx == 0) {
    return 0xFF;
  } else {
    g = gy / gx;
  }
  return g;
}


x86 assembly (clang, -O0):
<_calc_gradient_one_pixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1120 <_calc_gradient_one_pixel+0x20>
movl   $0xff,-0x4(%rbp)
jmp    1130 <_calc_gradient_one_pixel+0x30>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_calc_gradient_one_pixel(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i32 %1, %0
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 255, %2 ]
ret i32 %7
}
void gtk_widget_modify_fg() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_modify_fg() {
ret void
}
char *finddef(n) {
  char *p;
  if ((p = lookup(arg(n))) == 0)
    if ((p = lookup("")) == 0)
      diag("Software error");
  return (p);
}


x86 assembly (clang, -O0):
<finddef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <arg@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1050 <lookup@plt>
cltq
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    118f <finddef+0x5f>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1050 <lookup@plt>
cltq
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    118a <finddef+0x5a>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <diag@plt>
jmp    118f <finddef+0x5f>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finddef>:
push   %rbx
xor    %eax,%eax
call   1030 <arg@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1050 <lookup@plt>
test   %eax,%eax
jne    1157 <finddef+0x27>
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1050 <lookup@plt>
test   %eax,%eax
je     115f <finddef+0x2f>
movslq %eax,%rbx
mov    %rbx,%rax
pop    %rbx
ret
lea    0xe9a(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <diag@plt>
jmp    115a <finddef+0x2a>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [15 x i8] c"Software error\00"
define i8* @finddef(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @arg to i32 (i32, ...)*)(i32 %4)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @lookup to i32 (i32, ...)*)(i32 %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %18
10: ; preds = %1
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @lookup to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %3
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @diag to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %10
br label %18
18: ; preds = %17, %1
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [15 x i8] c"Software error\00"
define i8* @finddef(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @arg to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @lookup to i32 (i32, ...)*)(i32 %2)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i32 %3, 0
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @lookup to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @diag to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %7, %12, %1
%15 = phi i8* [ null, %12 ], [ %10, %7 ], [ %5, %1 ]
ret i8* %15
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};
struct _Locale_messages {
  int dummy;
};

/* Variables and functions */
scalar_t__ _Locale_create(char const *, int *);
struct _Locale_messages *_Locale_messages_create(const char *name,
                                                 struct _Locale_name_hint *hint,
                                                 int *__err_code) {
  return (struct _Locale_messages *)_Locale_create(name, __err_code);
}


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

x86 assembly (clang, -O2):
<_Locale_messages_create>:
mov    %rdx,%rsi
jmp    1030 <_Locale_create@plt>

LLVM IR (-O0):
%struct._Locale_messages = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_messages* @_Locale_messages_create(i8* %0, %struct._Locale_name_hint* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca %struct._Locale_name_hint*
%6 = alloca i32*
store i8* %0, i8** %4
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %6
%9 = call i64 @_Locale_create(i8* %7, i32* %8)
%10 = inttoptr i64 %9 to %struct._Locale_messages*
ret %struct._Locale_messages* %10
}

LLVM IR (-O2):
%struct._Locale_messages = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_messages* @_Locale_messages_create(i8* %0, %struct._Locale_name_hint* nocapture readnone %1, i32* %2) {
%4 = tail call i64 @_Locale_create(i8* %0, i32* %2)
%5 = inttoptr i64 %4 to %struct._Locale_messages*
ret %struct._Locale_messages* %5
}
void *uDMAControlBaseGet(void) {
  return ((void *)(*((volatile unsigned long *)(0x400FF008))));
}


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

x86 assembly (clang, -O2):
<uDMAControlBaseGet>:
mov    0x400ff008,%rax
40
ret

LLVM IR (-O0):
define i8* @uDMAControlBaseGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074786312 to i64*)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @uDMAControlBaseGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074786312 to i64*)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_section_name(char *section_name) {
  if (section_name && *section_name)
    printf(" (section %s)", section_name);
}


x86 assembly (clang, -O0):
<print_section_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1147 <print_section_name+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1147 <print_section_name+0x37>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_section_name>:
test   %rdi,%rdi
je     1129 <print_section_name+0x19>
mov    %rdi,%rsi
cmpb   $0x0,(%rdi)
je     1129 <print_section_name+0x19>
lea    0xedc(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [14 x i8] c" (section %s)\00"
define void @print_section_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %5, %1
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c" (section %s)\00"
define void @print_section_name(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int chess_square_left(int square) {
  assert(square >= 0 && square <= 63);
  if (square % 8 != 0)
    return square - 1;
  return -1;
}


x86 assembly (clang, -O0):
<chess_square_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1134 <chess_square_left+0x24>
cmpl   $0x3f,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1163 <chess_square_left+0x53>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    116a <chess_square_left+0x5a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chess_square_left>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40,%ebx
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
and    $0x7,%eax
add    $0xffffffff,%ebx
cmp    $0x1,%eax
sbb    %eax,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @chess_square_left(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 63
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ false, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %3
%14 = srem i32 %13, 8
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %9
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %2
br label %20
19: ; preds = %9
store i32 -1, i32* %2
br label %20
20: ; preds = %19, %16
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @chess_square_left(i32 %0) {
%2 = icmp ult i32 %0, 64
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = and i32 %0, 7
%6 = icmp eq i32 %5, 0
%7 = add nsw i32 %0, -1
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
double grib_op_mul_d(double a, double b) { return a * b; }


x86 assembly (clang, -O0):
<grib_op_mul_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib_op_mul_d>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @grib_op_mul_d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @grib_op_mul_d(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
void testMergeStr(void) {}


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

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

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

LLVM IR (-O2):
define void @testMergeStr() {
ret void
}
int cola(int n, int c) {
  if (n < c)
    return 0;
  int y;
  static int o;
  y = n / c;
  o = n % c;
  return y + cola(y + o, c);
}


x86 assembly (clang, -O0):
<cola>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1136 <cola+0x26>
movl   $0x0,-0x4(%rbp)
jmp    116e <cola+0x5e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,0x2edf(%rip)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
add    0x2ed0(%rip),%edi
mov    -0xc(%rbp),%esi
call   1030 <cola@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cola>:
xor    %ecx,%ecx
cmp    %esi,%edi
jl     111d <cola+0x1d>
mov    %edi,%edx
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edx,%eax
cltd
idiv   %esi
add    %eax,%edx
add    %eax,%ecx
cmp    %esi,%edx
jge    1110 <cola+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
@cola.o = internal global i32 0
define i32 @cola(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %25
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sdiv i32 %12, %13
store i32 %14, i32* %6
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = srem i32 %15, %16
store i32 %17, i32* @cola.o
%18 = load i32, i32* %6
%19 = load i32, i32* %6
%20 = load i32, i32* @cola.o
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %5
%23 = call i32 @cola(i32 %21, i32 %22)
%24 = add nsw i32 %18, %23
store i32 %24, i32* %3
br label %25
25: ; preds = %11, %10
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @cola(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %0, %2 ]
%6 = phi i32 [ %10, %4 ], [ 0, %2 ]
%7 = sdiv i32 %5, %1
%8 = srem i32 %5, %1
%9 = add nsw i32 %8, %7
%10 = add nsw i32 %7, %6
%11 = icmp slt i32 %9, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %13
}
/* Variables and functions */
int jk_is_some_property(char const *, char *);
int jk_is_path_poperty(const char *prp_name) {
  return jk_is_some_property(prp_name, "path");
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"path\00"
define i32 @jk_is_path_poperty(i8* %0) {
%2 = tail call i32 @jk_is_some_property(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int _c0_main();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", _c0_main());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <_c0_main@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <_c0_main@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @_c0_main()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void resampler_delete(void *_r) { free(_r); }


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

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

LLVM IR (-O2):
define void @resampler_delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int Get_Byte();
int Get_Word() {
  int Val;
  Val = Get_Byte();
  return (Val << 8) | Get_Byte();
}


x86 assembly (clang, -O0):
<Get_Word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Get_Byte@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Get_Byte@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_Word>:
push   %rbx
xor    %eax,%eax
call   1030 <Get_Byte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
xor    %eax,%eax
call   1030 <Get_Byte@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Get_Word() {
%1 = alloca i32
%2 = call i32 (...) @Get_Byte()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = shl i32 %3, 8
%5 = call i32 (...) @Get_Byte()
%6 = or i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @Get_Word() {
%1 = tail call i32 (...) @Get_Byte()
%2 = shl i32 %1, 8
%3 = tail call i32 (...) @Get_Byte()
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
double P1y_z(double, double, double, double);
double P1z_y(double sign, double xi, double et, double qq) {
  return P1y_z(sign, xi, et, qq);
}


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

x86 assembly (clang, -O2):
<P1z_y>:
jmp    1030 <P1y_z@plt>

LLVM IR (-O0):
define double @P1z_y(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @P1y_z(double %9, double %10, double %11, double %12)
ret double %13
}

LLVM IR (-O2):
define double @P1z_y(double %0, double %1, double %2, double %3) {
%5 = tail call double @P1y_z(double %0, double %1, double %2, double %3)
ret double %5
}
int isFirstPacket(char flags) {
  flags &= ~0x1;
  return (flags == (0x4 | 0x2) || flags == 0x4);
}


x86 assembly (clang, -O0):
<isFirstPacket>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xfffffffe,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x6,%ecx
mov    %al,-0x2(%rbp)
je     1133 <isFirstPacket+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x4,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFirstPacket>:
and    $0xfc,%dil
xor    %eax,%eax
cmp    $0x4,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isFirstPacket(i8 signext %0) {
%2 = and i8 %0, -4
%3 = icmp eq i8 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}
int base64_enclen(int x) { return (x + 2 - ((x + 2) % 3)) / 3 * 4; }


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

x86 assembly (clang, -O2):
<base64_enclen>:
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_enclen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 2
%7 = srem i32 %6, 3
%8 = sub nsw i32 %4, %7
%9 = sdiv i32 %8, 3
%10 = mul nsw i32 %9, 4
ret i32 %10
}

LLVM IR (-O2):
define i32 @base64_enclen(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
ret i32 %4
}
int do_944() { return 944; }


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

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

LLVM IR (-O0):
define i32 @do_944() {
ret i32 944
}

LLVM IR (-O2):
define i32 @do_944() {
ret i32 944
}
/* Variables and functions */
int RAND_query_egd_bytes(char const *, int /*<<< orphan*/ *, int);
int RAND_status();
int RAND_egd_bytes(const char *path, int bytes) {
  int num, ret = 0;
  num = RAND_query_egd_bytes(path, NULL, bytes);
  if (num < 1)
    goto err;
  if (RAND_status() == 1)
    ret = num;
err:
  return (ret);
}


x86 assembly (clang, -O0):
<RAND_egd_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <RAND_query_egd_bytes@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jge    1158 <RAND_egd_bytes+0x38>
jmp    1173 <RAND_egd_bytes+0x53>
mov    $0x0,%al
call   1030 <RAND_status@plt>
cmp    $0x1,%eax
jne    116e <RAND_egd_bytes+0x4e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1173 <RAND_egd_bytes+0x53>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RAND_egd_bytes>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%edx
xor    %r14d,%r14d
xor    %esi,%esi
call   1040 <RAND_query_egd_bytes@plt>
test   %eax,%eax
jle    1148 <RAND_egd_bytes+0x28>
mov    %eax,%ebx
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <RAND_status@plt>
cmp    $0x1,%eax
cmovne %ebp,%ebx
mov    %ebx,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @RAND_egd_bytes(i8* %0, i32 %1) {
%3 = tail call i32 @RAND_query_egd_bytes(i8* %0, i32* null, i32 %1)
%4 = icmp slt i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 (...) @RAND_status()
%7 = icmp eq i32 %6, 1
%8 = select i1 %7, i32 %3, i32 0
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int foo();
int fooPlusOne() { return foo() + 1; }


x86 assembly (clang, -O0):
<fooPlusOne>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <foo@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fooPlusOne>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fooPlusOne() {
%1 = call i32 (...) @foo()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @fooPlusOne() {
%1 = tail call i32 (...) @foo()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void I2C2_ER_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @I2C2_ER_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @I2C2_ER_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
short int ipv4_check_prefixlen(unsigned short int pfxlen) {
  if (pfxlen > 32)
    return -3;
  return 0;
}


x86 assembly (clang, -O0):
<ipv4_check_prefixlen>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
cmp    $0x20,%eax
jle    1123 <ipv4_check_prefixlen+0x23>
movw   $0xfffd,-0x2(%rbp)
jmp    1129 <ipv4_check_prefixlen+0x29>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv4_check_prefixlen>:
xor    %ecx,%ecx
cmp    $0x21,%di
mov    $0xfffd,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @ipv4_check_prefixlen(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = icmp sgt i32 %5, 32
br i1 %6, label %7, label %8
7: ; preds = %1
store i16 -3, i16* %2
br label %9
8: ; preds = %1
store i16 0, i16* %2
br label %9
9: ; preds = %8, %7
%10 = load i16, i16* %2
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @ipv4_check_prefixlen(i16 zeroext %0) {
%2 = icmp ugt i16 %0, 32
%3 = select i1 %2, i16 -3, i16 0
ret i16 %3
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dminabs(int, double *, int);
int main() {
  double x[] = {1.0, 2.0, -3.0, -4.0, 5.0, -6.0, -7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dminabs(N, x, stride);
  printf("minabs: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
call   1050 <stdlib_strided_dminabs@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dminabs@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e+00, double -6.000000e+00, double -7.000000e+00, double 8.000000e+00]
@.str = [13 x i8] c"minabs: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dminabs(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double -3.000000e+00, double -4.000000e+00, double 5.000000e+00, double -6.000000e+00, double -7.000000e+00, double 8.000000e+00]
@.str = [13 x i8] c"minabs: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dminabs(i32 4, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
void slow_close(int n) {
  int i;
  double *mm;
  for (i = 0; i < 2 * n; i++)
    for (i = 0; i < 2 * n; i++)
      *(mm + i * 2 * n + i) = 0;
}


x86 assembly (clang, -O0):
<slow_close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    117c <slow_close+0x7c>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    1169 <slow_close+0x69>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
imul   -0x4(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <slow_close+0x26>
jmp    116e <slow_close+0x6e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <slow_close+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @slow_close(i32 %0) {
%2 = icmp slt i32 %0, 1
ret void
}
void hwfunctions_membarrier() { asm volatile("mfence" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @hwfunctions_membarrier() {
tail call void asm sideeffect "mfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}