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

/* Variables and functions */
int /*<<< orphan*/ crc_accumulate(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ crc_init(int /*<<< orphan*/ *);
uint16_t crc_calculate(const uint8_t *pBuffer, uint16_t length) {
  uint16_t crcTmp;
  crc_init(&crcTmp);
  while (length--) {
    crc_accumulate(*pBuffer++, &crcTmp);
  }
  return crcTmp;
}


x86 assembly (clang, -O0):
<crc_calculate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <crc_init@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     116b <crc_calculate+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <crc_accumulate@plt>
jmp    1138 <crc_calculate+0x18>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_calculate>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r15
lea    0x4(%rsp),%rdi
call   1040 <crc_init@plt>
test   %ebp,%ebp
je     1164 <crc_calculate+0x44>
mov    %ebp,%ebp
xor    %ebx,%ebx
lea    0x4(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r15,%rbx,4),%edi
mov    %r14,%rsi
call   1030 <crc_accumulate@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1150 <crc_calculate+0x30>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @crc_calculate(i32* nocapture %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @crc_init(i32* %3)
%6 = icmp eq i32 %1, 0
br i1 %6, label %15, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ %1, %2 ]
%9 = phi i32* [ %11, %7 ], [ %0, %2 ]
%10 = add nsw i32 %8, -1
%11 = getelementptr inbounds i32, i32* %9, i64 1
%12 = load i32, i32* %9
%13 = call i32 @crc_accumulate(i32 %12, i32* %3)
%14 = icmp eq i32 %10, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %2
%16 = load i32, i32* %3
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ bwlzh_compress_gen(unsigned int *, int const,
                                      unsigned char *, int *,
                                      int /*<<< orphan*/, int);
void bwlzh_compress_no_lz77_verbose(unsigned int *vals, const int nvals,
                                    unsigned char *output, int *output_len) {
  bwlzh_compress_gen(vals, nvals, output, output_len, 0, 1);
}


x86 assembly (clang, -O0):
<bwlzh_compress_no_lz77_verbose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <bwlzh_compress_gen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwlzh_compress_no_lz77_verbose>:
xor    %r8d,%r8d
mov    $0x1,%r9d
jmp    1030 <bwlzh_compress_gen@plt>

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

LLVM IR (-O2):
define void @bwlzh_compress_no_lz77_verbose(i32* %0, i32 %1, i8* %2, i32* %3) {
%5 = tail call i32 @bwlzh_compress_gen(i32* %0, i32 %1, i8* %2, i32* %3, i32 0, i32 1)
ret void
}
/* Variables and functions */
double rc_adc_volt(int);
float rc_battery_voltage() {
  float v = (rc_adc_volt(6) * 11.0) + -0.10;
  if (v < 0.3)
    v = 0.0;
  return v;
}


x86 assembly (clang, -O0):
<rc_battery_voltage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6,%edi
call   1030 <rc_adc_volt@plt>
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeac(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1166 <rc_battery_voltage+0x56>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_battery_voltage>:
push   %rax
mov    $0x6,%edi
call   1030 <rc_adc_volt@plt>
mulsd  0xedd(%rip),%xmm0
addsd  0xedd(%rip),%xmm0
cvtsd2ss %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  0xed2(%rip),%xmm2
ucomisd %xmm0,%xmm2
xorps  %xmm0,%xmm0
ja     114a <rc_battery_voltage+0x3a>
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rc_battery_voltage() {
%1 = alloca float
%2 = call double @rc_adc_volt(i32 6)
%3 = call double @llvm.fmuladd.f64(double %2, double 1.100000e+01, double -1.000000e-01)
%4 = fptrunc double %3 to float
store float %4, float* %1
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fcmp olt double %6, 3.000000e-01
br i1 %7, label %8, label %9
8: ; preds = %0
store float 0.000000e+00, float* %1
br label %9
9: ; preds = %8, %0
%10 = load float, float* %1
ret float %10
}

LLVM IR (-O2):
define float @rc_battery_voltage() {
%1 = tail call double @rc_adc_volt(i32 6)
%2 = tail call double @llvm.fmuladd.f64(double %1, double 1.100000e+01, double -1.000000e-01)
%3 = fptrunc double %2 to float
%4 = fpext float %3 to double
%5 = fcmp olt double %4, 3.000000e-01
%6 = select i1 %5, float 0.000000e+00, float %3
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ leds_clear(int);
int /*<<< orphan*/ leds_deinit();
int /*<<< orphan*/ leds_init();
int main() {
  leds_init();
  leds_clear(60);
  leds_deinit();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <leds_init@plt>
mov    $0x3c,%edi
call   1030 <leds_clear@plt>
mov    $0x0,%al
call   1040 <leds_deinit@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <leds_init@plt>
mov    $0x3c,%edi
call   1030 <leds_clear@plt>
xor    %eax,%eax
call   1040 <leds_deinit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @leds_init()
%2 = call i32 @leds_clear(i32 60)
%3 = call i32 (...) @leds_deinit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @leds_init()
%2 = tail call i32 @leds_clear(i32 60)
%3 = tail call i32 (...) @leds_deinit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ game_animscreen();
int /*<<< orphan*/ game_initscreen();
int /*<<< orphan*/ prepare_em_level();
void InitGameEngine_EM() {
  prepare_em_level();
  game_initscreen();
  game_animscreen();
}


x86 assembly (clang, -O0):
<InitGameEngine_EM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <prepare_em_level@plt>
mov    $0x0,%al
call   1040 <game_initscreen@plt>
mov    $0x0,%al
call   1050 <game_animscreen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitGameEngine_EM>:
push   %rax
xor    %eax,%eax
call   1030 <prepare_em_level@plt>
xor    %eax,%eax
call   1040 <game_initscreen@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <game_animscreen@plt>

LLVM IR (-O0):
define void @InitGameEngine_EM() {
%1 = call i32 (...) @prepare_em_level()
%2 = call i32 (...) @game_initscreen()
%3 = call i32 (...) @game_animscreen()
ret void
}

LLVM IR (-O2):
define void @InitGameEngine_EM() {
%1 = tail call i32 (...) @prepare_em_level()
%2 = tail call i32 (...) @game_initscreen()
%3 = tail call i32 (...) @game_animscreen()
ret void
}
/* Variables and functions */
int yas_set_enable_wrap(int, int);
int yas_set_enable(int enable) { return yas_set_enable_wrap(enable, 1); }


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

x86 assembly (clang, -O2):
<yas_set_enable>:
mov    $0x1,%esi
jmp    1030 <yas_set_enable_wrap@plt>

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

LLVM IR (-O2):
define i32 @yas_set_enable(i32 %0) {
%2 = tail call i32 @yas_set_enable_wrap(i32 %0, i32 1)
ret i32 %2
}
int xaui_direct_reset(struct cphy *phy, int wait) { return 0; }


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

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

LLVM IR (-O0):
%struct.cphy = type opaque
define i32 @xaui_direct_reset(%struct.cphy* %0, i32 %1) {
%3 = alloca %struct.cphy*
%4 = alloca i32
store %struct.cphy* %0, %struct.cphy** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.cphy = type opaque
define i32 @xaui_direct_reset(%struct.cphy* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ rr__write(int /*<<< orphan*/);
void rr_rel(int32_t relid) {
  rr__write(0);
  rr__write(relid);
}


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

x86 assembly (clang, -O2):
<rr_rel>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <rr__write@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <rr__write@plt>

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

LLVM IR (-O2):
define void @rr_rel(i32 %0) {
%2 = tail call i32 @rr__write(i32 0)
%3 = tail call i32 @rr__write(i32 %0)
ret void
}
/* Variables and functions */
unsigned int leastPrimeFactor(unsigned int, unsigned int);
void allPrimeFactorsOfN(unsigned remainder, unsigned *factors) {
  unsigned lastFactor = 2;
  while (remainder >= 2) {
    lastFactor = leastPrimeFactor(remainder, lastFactor);
    remainder /= lastFactor;
    ++factors[lastFactor];
  }
}


x86 assembly (clang, -O0):
<allPrimeFactorsOfN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
cmpl   $0x2,-0x4(%rbp)
jb     1160 <allPrimeFactorsOfN+0x50>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <leastPrimeFactor@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x4(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
jmp    1126 <allPrimeFactorsOfN+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allPrimeFactorsOfN>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jb     114c <allPrimeFactorsOfN+0x3c>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x2,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%edi
call   1030 <leastPrimeFactor@plt>
mov    %eax,%esi
mov    %ebp,%eax
xor    %edx,%edx
div    %esi
mov    %esi,%ecx
addl   $0x1,(%rbx,%rcx,4)
mov    %eax,%ebp
cmp    $0x1,%eax
ja     1130 <allPrimeFactorsOfN+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @allPrimeFactorsOfN(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 2, i32* %5
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %3
%8 = icmp uge i32 %7, 2
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = call i32 @leastPrimeFactor(i32 %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = load i32, i32* %3
%15 = udiv i32 %14, %13
store i32 %15, i32* %3
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = add i32 %20, 1
store i32 %21, i32* %19
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @allPrimeFactorsOfN(i32 %0, i32* nocapture %1) {
%3 = icmp ugt i32 %0, 1
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 2, %2 ]
%6 = phi i32 [ %8, %4 ], [ %0, %2 ]
%7 = tail call i32 @leastPrimeFactor(i32 %6, i32 %5)
%8 = udiv i32 %6, %7
%9 = zext i32 %7 to i64
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
%12 = add i32 %11, 1
store i32 %12, i32* %10
%13 = icmp ugt i32 %8, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int move_cursor(int col, int row) {
  move(row, col);
  return 0;
  return -1;
}


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

x86 assembly (clang, -O2):
<move_cursor>:
push   %rax
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
call   1030 <move@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @move_cursor(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 = load i32, i32* %3
%7 = call i32 @move(i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @move_cursor(i32 %0, i32 %1) {
%3 = tail call i32 @move(i32 %1, i32 %0)
ret i32 0
}
struct cl_node *cl_node_black(struct cl_node *n) {
  return (struct cl_node *)((long)n & ~1);
}


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

x86 assembly (clang, -O2):
<cl_node_black>:
mov    %rdi,%rax
and    $0xfffffffffffffffe,%rax
ret

LLVM IR (-O0):
%struct.cl_node = type opaque
define %struct.cl_node* @cl_node_black(%struct.cl_node* %0) {
%2 = alloca %struct.cl_node*
store %struct.cl_node* %0, %struct.cl_node** %2
%3 = load %struct.cl_node*, %struct.cl_node** %2
%4 = ptrtoint %struct.cl_node* %3 to i64
%5 = and i64 %4, -2
%6 = inttoptr i64 %5 to %struct.cl_node*
ret %struct.cl_node* %6
}

LLVM IR (-O2):
%struct.cl_node = type opaque
define %struct.cl_node* @cl_node_black(%struct.cl_node* %0) {
%2 = ptrtoint %struct.cl_node* %0 to i64
%3 = and i64 %2, -2
%4 = inttoptr i64 %3 to %struct.cl_node*
ret %struct.cl_node* %4
}
/* Variables and functions */
int EPOLLIN;
int EPOLLOUT;
int cio_events_to_epoll(int cio) {
  int epoll = 0;
  if (cio & 1)
    epoll |= EPOLLIN;
  if (cio & 2)
    epoll |= EPOLLOUT;
  return epoll;
}


x86 assembly (clang, -O0):
<cio_events_to_epoll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112c <cio_events_to_epoll+0x2c>
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     114a <cio_events_to_epoll+0x4a>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cio_events_to_epoll>:
mov    %edi,%eax
and    $0x1,%eax
neg    %eax
mov    0x2eda(%rip),%rcx
and    (%rcx),%eax
shl    $0x1e,%edi
sar    $0x1f,%edi
mov    0x2ebb(%rip),%rcx
and    (%rcx),%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
@EPOLLIN = global i32 0
@EPOLLOUT = global i32 0
define i32 @cio_events_to_epoll(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @EPOLLIN
%5 = select i1 %3, i32 0, i32 %4
%6 = and i32 %0, 2
%7 = icmp eq i32 %6, 0
%8 = load i32, i32* @EPOLLOUT
%9 = select i1 %7, i32 0, i32 %8
%10 = or i32 %9, %5
ret i32 %10
}
/* Type definitions */
struct suffix_mult {
  int dummy;
};

/* Variables and functions */
long xatoll_sfx(char const *, struct suffix_mult const *);
__attribute__((always_)) long xatol_sfx(const char *str,
                                        const struct suffix_mult *sfx) {
  return xatoll_sfx(str, sfx);
}


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

x86 assembly (clang, -O2):
<xatol_sfx>:
jmp    1030 <xatoll_sfx@plt>

LLVM IR (-O0):
%struct.suffix_mult = type { i32 }
define i64 @xatol_sfx(i8* %0, %struct.suffix_mult* %1) {
%3 = alloca i8*
%4 = alloca %struct.suffix_mult*
store i8* %0, i8** %3
store %struct.suffix_mult* %1, %struct.suffix_mult** %4
%5 = load i8*, i8** %3
%6 = load %struct.suffix_mult*, %struct.suffix_mult** %4
%7 = call i64 @xatoll_sfx(i8* %5, %struct.suffix_mult* %6)
ret i64 %7
}

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i64 @xatol_sfx(i8* %0, %struct.suffix_mult* %1) {
%3 = tail call i64 @xatoll_sfx(i8* %0, %struct.suffix_mult* %1)
ret i64 %3
}
void aes_log(const unsigned char s[], const char *l) {}


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

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

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

LLVM IR (-O2):
define void @aes_log(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void SXNETID_free(void) {}


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

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

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

LLVM IR (-O2):
define void @SXNETID_free() {
ret void
}
unsigned char circular_shift(unsigned char value, unsigned char shift) {
  return (value + shift < 256) ? value + shift : value + shift - 256;
}


x86 assembly (clang, -O0):
<circular_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
cmp    $0x100,%eax
jge    1137 <circular_shift+0x37>
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1149 <circular_shift+0x49>
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
sub    $0x100,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<circular_shift>:
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define zeroext i8 @circular_shift(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = add nsw i32 %6, %8
%10 = icmp slt i32 %9, 256
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = add nsw i32 %13, %15
br label %24
17: ; preds = %2
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = add nsw i32 %19, %21
%23 = sub nsw i32 %22, 256
br label %24
24: ; preds = %17, %11
%25 = phi i32 [ %16, %11 ], [ %23, %17 ]
%26 = trunc i32 %25 to i8
ret i8 %26
}

LLVM IR (-O2):
define zeroext i8 @circular_shift(i8 zeroext %0, i8 zeroext %1) {
%3 = add i8 %1, %0
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ fail(int /*<<< orphan*/);
void *malloc(unsigned int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void *allocate(unsigned int size) {
  void *ptr;
  ptr = malloc(size);
  if (!ptr)
    fail(strerror(ENOMEM));
  return ptr;
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1167 <allocate+0x37>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1030 <fail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1153 <allocate+0x23>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1030 <fail@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
define i8* @allocate(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @ENOMEM
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @fail(i32 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define noalias i8* @allocate(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @ENOMEM
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @fail(i32 %6)
br label %8
8: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
char *memchr(char const *, int /*<<< orphan*/, size_t);
size_t strnlen(const char *s, size_t n) {
  const char *p = memchr(s, 0, n);
  return p ? (size_t)(p - s) : n;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <strnlen+0x42>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    115a <strnlen+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i32 0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %4, i64 %1, i64 %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ usage(int);
void __argmatch_die(void) { usage(1); }


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

x86 assembly (clang, -O2):
<__argmatch_die>:
mov    $0x1,%edi
jmp    1030 <usage@plt>

LLVM IR (-O0):
define void @__argmatch_die() {
%1 = call i32 @usage(i32 1)
ret void
}

LLVM IR (-O2):
define void @__argmatch_die() {
%1 = tail call i32 @usage(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compilerAssert();
void chpl_incRefCountsForDomainsInArrayEltTypes5(void) {
  compilerAssert();
  return;
}


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

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

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

LLVM IR (-O2):
define void @chpl_incRefCountsForDomainsInArrayEltTypes5() {
%1 = tail call i32 (...) @compilerAssert()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_mask(char *);
void sig_int(int signo) { pr_mask("in sig_int: "); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"in sig_int: \00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pr_mask(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"in sig_int: \00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @pr_mask(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
void gtk_tree_view_unset_rows_drag_dest() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_unset_rows_drag_dest() {
ret void
}
/* Variables and functions */
int get_speed_ref(int, int);
int roadmap_line_speed_get_avg(int);
int roadmap_line_speed_get_avg_speed(int line, int against_dir) {
  int speed_ref = get_speed_ref(line, against_dir);
  if (speed_ref == 0xFFFF)
    return 0;
  return roadmap_line_speed_get_avg(speed_ref);
}


x86 assembly (clang, -O0):
<roadmap_line_speed_get_avg_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <get_speed_ref@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffff,-0x10(%rbp)
jne    1155 <roadmap_line_speed_get_avg_speed+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1160 <roadmap_line_speed_get_avg_speed+0x40>
mov    -0x10(%rbp),%edi
call   1030 <roadmap_line_speed_get_avg@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_line_speed_get_avg_speed>:
push   %rax
call   1040 <get_speed_ref@plt>
cmp    $0xffff,%eax
jne    1131 <roadmap_line_speed_get_avg_speed+0x11>
xor    %eax,%eax
pop    %rcx
ret
mov    %eax,%edi
pop    %rax
jmp    1030 <roadmap_line_speed_get_avg@plt>

LLVM IR (-O0):
define i32 @roadmap_line_speed_get_avg_speed(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 = call i32 @get_speed_ref(i32 %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 65535
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %16
13: ; preds = %2
%14 = load i32, i32* %6
%15 = call i32 @roadmap_line_speed_get_avg(i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @roadmap_line_speed_get_avg_speed(i32 %0, i32 %1) {
%3 = tail call i32 @get_speed_ref(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 65535
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @roadmap_line_speed_get_avg(i32 %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t getIncrement() {
  static uint64_t i = 0;
  i = (i + 1) & ~(1 << (24));
  return i;
}


x86 assembly (clang, -O0):
<getIncrement>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
and    $0xfeffffff,%eax
mov    %eax,0x2f0c(%rip)
mov    0x2f06(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIncrement>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
and    $0xfeffffff,%eax
mov    %eax,0x2f10(%rip)
ret

LLVM IR (-O0):
@getIncrement.i = internal global i32 0
define i32 @getIncrement() {
%1 = load i32, i32* @getIncrement.i
%2 = add nsw i32 %1, 1
%3 = and i32 %2, -16777217
store i32 %3, i32* @getIncrement.i
%4 = load i32, i32* @getIncrement.i
ret i32 %4
}

LLVM IR (-O2):
@getIncrement.i = internal unnamed_addr global i32 0
define i32 @getIncrement() {
%1 = load i32, i32* @getIncrement.i
%2 = add nsw i32 %1, 1
%3 = and i32 %2, -16777217
store i32 %3, i32* @getIncrement.i
ret i32 %3
}
int test_addOK(int x, int y) {
  long long lsum = (long long)x + y;
  return lsum == (int)lsum;
}


x86 assembly (clang, -O0):
<test_addOK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq %ecx,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_addOK>:
movslq %edi,%rax
movslq %esi,%rcx
add    %rax,%rcx
sub    $0xffffffff80000000,%rcx
xor    %eax,%eax
shr    $0x20,%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @test_addOK(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = add nsw i64 %7, %9
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
%14 = sext i32 %13 to i64
%15 = icmp eq i64 %11, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_addOK(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = add nsw i64 %3, 2147483648
%6 = add nsw i64 %5, %4
%7 = icmp ult i64 %6, 4294967296
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t clamp(int32_t value, int32_t min_val, int32_t max_val) {
  return (value < min_val) ? min_val : ((value > max_val) ? max_val : value);
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    112b <clamp+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1156 <clamp+0x56>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1146 <clamp+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    114e <clamp+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @clamp(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
void __attribute__((section("SECT"))) t11(void) {}


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

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

LLVM IR (-O0):
define void @t11() section "SECT" {
ret void
}

LLVM IR (-O2):
define void @t11() section "SECT" {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t bvbound_header_var(uint32_t h) { return (int32_t)(h >> 1); }


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

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

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

LLVM IR (-O2):
define i32 @bvbound_header_var(i32 %0) {
%2 = ashr i32 %0, 1
ret i32 %2
}
/* Type definitions */
struct game_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct game_state *);
void game_finalize(struct game_state *state) { free(state); }


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

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

LLVM IR (-O2):
%struct.game_state = type { i32 }
define void @game_finalize(%struct.game_state* nocapture %0) {
%2 = tail call i32 @free(%struct.game_state* %0)
ret void
}
/* Variables and functions */
scalar_t__ is_screensaver_active();
int /*<<< orphan*/ screensaver_off();
void key3_event() {
  if (is_screensaver_active()) {
    screensaver_off();
    return;
  }
  screensaver_off();
}


x86 assembly (clang, -O0):
<key3_event>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <is_screensaver_active@plt>
cmp    $0x0,%rax
je     1141 <key3_event+0x21>
mov    $0x0,%al
call   1040 <screensaver_off@plt>
jmp    1148 <key3_event+0x28>
mov    $0x0,%al
call   1040 <screensaver_off@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @key3_event() {
%1 = call i64 (...) @is_screensaver_active()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @screensaver_off()
br label %7
5: ; preds = %0
%6 = call i32 (...) @screensaver_off()
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
define void @key3_event() {
%1 = tail call i64 (...) @is_screensaver_active()
%2 = tail call i32 (...) @screensaver_off()
ret void
}
int compare_int(const void *int1, const void *int2) {
  if (*(const int *)int1 > *(const int *)int2)
    return 1;
  else if (*(const int *)int1 < *(const int *)int2)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <compare_int+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <compare_int+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <compare_int+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <compare_int+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
bool empty_string(const char *s) { return !s || !*s; }


x86 assembly (clang, -O0):
<empty_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1127 <empty_string+0x27>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_string>:
test   %rdi,%rdi
je     110e <empty_string+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @empty_string(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 %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = xor i1 %8, true
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ true, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @empty_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
char *mjd2fd(dj)
double dj;
{ return (jd2fd(dj + 2400000.5)); }


x86 assembly (clang, -O0):
<mjd2fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <jd2fd@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mjd2fd>:
push   %rax
addsd  0xee7(%rip),%xmm0
mov    $0x1,%al
call   1030 <jd2fd@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @mjd2fd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 0x41424F8040000000
%5 = call i32 (double, ...) bitcast (i32 (...)* @jd2fd to i32 (double, ...)*)(double %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @mjd2fd(double %0) {
%2 = fadd double %0, 0x41424F8040000000
%3 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2fd to i32 (double, ...)*)(double %2)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("^ & << ta tb");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"^ & << ta tb\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"^ & << ta tb\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
float __infer_nondet_float() {
  float ret;
  return ret;
}


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

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

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

LLVM IR (-O2):
define float @__infer_nondet_float() {
ret float undef
}
/* Variables and functions */
unsigned long inl_local(unsigned short);
unsigned long x_inl(unsigned short port) {
  unsigned long val;
  val = inl_local(port);
  return val;
}


x86 assembly (clang, -O0):
<x_inl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <inl_local@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_inl>:
jmp    1030 <inl_local@plt>

LLVM IR (-O0):
define i64 @x_inl(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i64
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i64 @inl_local(i16 zeroext %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @x_inl(i16 zeroext %0) {
%2 = tail call i64 @inl_local(i16 zeroext %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
struct tm *get_time() {
  time_t rtime;
  struct tm *ltime;
  time(&rtime);
  ltime = localtime(&rtime);
  return ltime;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @get_time() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
ret %struct.tm* %5
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @get_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
ret %struct.tm* %4
}
int khugepaged_enter_vma_merge(struct vm_area_struct *vma,
                               unsigned long vm_flags) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.vm_area_struct = type opaque
define i32 @khugepaged_enter_vma_merge(%struct.vm_area_struct* %0, i64 %1) {
%3 = alloca %struct.vm_area_struct*
%4 = alloca i64
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
define i32 @khugepaged_enter_vma_merge(%struct.vm_area_struct* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Interpolate_3(int /*<<< orphan*/, int, int /*<<< orphan*/,
                                 int, int /*<<< orphan*/, int, int);
void Interp2(uint32_t *pc, uint32_t c1, uint32_t c2, uint32_t c3) {
  *pc = Interpolate_3(c1, 2, c2, 1, c3, 1, 2);
}


x86 assembly (clang, -O0):
<Interp2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%r8d
mov    $0x2,%esi
mov    $0x1,%r9d
mov    %r9d,%ecx
movl   $0x2,(%rsp)
call   1030 <Interpolate_3@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp2>:
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%r8d
mov    %rdi,%rbx
movl   $0x2,(%rsp)
mov    %esi,%edi
mov    $0x2,%esi
mov    $0x1,%ecx
mov    $0x1,%r9d
call   1030 <Interpolate_3@plt>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Interp2(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @Interpolate_3(i32 %1, i32 2, i32 %2, i32 1, i32 %3, i32 1, i32 2)
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
char *getenv(char const *);
int /*<<< orphan*/ setenv(char const *, char *, int);
int /*<<< orphan*/ unsetenv(char const *);
int check_set_evar(char const *evar, char const *pvar) {
  char *val = 0;
  val = getenv(evar);
  if (val) {
    setenv(pvar, val, 1);
    unsetenv(evar);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_set_evar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1187 <check_set_evar+0x57>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    -0x10(%rbp),%rdi
call   1050 <unsetenv@plt>
movl   $0x1,-0x4(%rbp)
jmp    118e <check_set_evar+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_set_evar>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     1163 <check_set_evar+0x33>
mov    $0x1,%ebp
mov    %r14,%rdi
mov    %rax,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    %rbx,%rdi
call   1050 <unsetenv@plt>
jmp    1165 <check_set_evar+0x35>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @check_set_evar(i8* nocapture %0, i8* %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @setenv(i8* %1, i8* %3, i32 1)
%7 = tail call i32 @unsetenv(i8* %0)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %9
}