xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int rand_between(unsigned min, unsigned max) {
  srand(time(NULL));
  return rand() % (max - min) + min;
}


x86 assembly (clang, -O0):
<rand_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_between>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
sub    %ebp,%ebx
xor    %edx,%edx
div    %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_between(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @time(i32* null)
%6 = call i32 @srand(i32 %5)
%7 = call i32 (...) @rand()
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub i32 %8, %9
%11 = urem i32 %7, %10
%12 = load i32, i32* %3
%13 = add i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @rand_between(i32 %0, i32 %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = sub i32 %1, %0
%7 = urem i32 %5, %6
%8 = add i32 %7, %0
ret i32 %8
}
/* Type definitions */
struct ketama_ring {
  int dummy;
};
struct ketama_node {
  int dummy;
};

/* Variables and functions */
struct ketama_node *ketama_node_iget(struct ketama_ring *, char *,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
struct ketama_node *ketama_node_get(struct ketama_ring *ring, char *key) {
  return ketama_node_iget(ring, key, strlen(key));
}


x86 assembly (clang, -O0):
<ketama_node_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <ketama_node_iget@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ketama_node_get>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ketama_node_iget@plt>

LLVM IR (-O0):
%struct.ketama_node = type { i32 }
%struct.ketama_ring = type { i32 }
define %struct.ketama_node* @ketama_node_get(%struct.ketama_ring* %0, i8* %1) {
%3 = alloca %struct.ketama_ring*
%4 = alloca i8*
store %struct.ketama_ring* %0, %struct.ketama_ring** %3
store i8* %1, i8** %4
%5 = load %struct.ketama_ring*, %struct.ketama_ring** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call %struct.ketama_node* @ketama_node_iget(%struct.ketama_ring* %5, i8* %6, i32 %8)
ret %struct.ketama_node* %9
}

LLVM IR (-O2):
%struct.ketama_node = type { i32 }
%struct.ketama_ring = type { i32 }
define %struct.ketama_node* @ketama_node_get(%struct.ketama_ring* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call %struct.ketama_node* @ketama_node_iget(%struct.ketama_ring* %0, i8* %1, i32 %3)
ret %struct.ketama_node* %4
}
double copysign(double x, double y) {
  *(1 + (int *)&x) =
      (*(1 + (int *)&x) & 0x7fffffff) | (*(1 + (int *)&y) & 0x80000000);
  return x;
}


x86 assembly (clang, -O0):
<copysign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffffff,%eax
mov    -0xc(%rbp),%ecx
and    $0x80000000,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysign>:
movq   %xmm0,%rax
movmskpd %xmm1,%ecx
shl    $0x3f,%rcx
movabs $0x7fffffffffffffff,%rdx
ff ff 7f
and    %rax,%rdx
or     %rcx,%rdx
movq   %rdx,%xmm0
ret

LLVM IR (-O0):
define double @copysign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = bitcast double* %3 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = and i32 %7, 2147483647
%9 = bitcast double* %4 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = and i32 %11, -2147483648
%13 = or i32 %8, %12
%14 = bitcast double* %3 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %13, i32* %15
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @copysign(double %0, double %1) {
%3 = bitcast double %0 to i64
%4 = bitcast double %1 to i64
%5 = and i64 %4, -9223372036854775808
%6 = and i64 %3, 9223372036854775807
%7 = or i64 %6, %5
%8 = bitcast i64 %7 to double
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ error(int, char *);
int getc(int /*<<< orphan*/ *);
void skip_to_nl(FILE *fp) {
  for (;;) {
    int c;
    c = getc(fp);
    if (c == EOF)
      error(1, "Premature EOF on input stream\n");
    if (c == '\n')
      return;
  }
}


x86 assembly (clang, -O0):
<skip_to_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%eax
jne    115b <skip_to_nl+0x3b>
mov    $0x1,%edi
lea    0xeaa(%rip),%rsi
call   1030 <error@plt>
cmpl   $0xa,-0xc(%rbp)
jne    116b <skip_to_nl+0x4b>
add    $0x10,%rsp
pop    %rbp
ret
jmp    112c <skip_to_nl+0xc>

x86 assembly (clang, -O2):
<skip_to_nl>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb7(%rip),%r15
lea    0xec8(%rip),%r14
jmp    1145 <skip_to_nl+0x25>
nopw   0x0(%rax,%rax,1)
cmp    $0xa,%ebp
je     1163 <skip_to_nl+0x43>
mov    %rbx,%rdi
call   1040 <getc@plt>
mov    %eax,%ebp
cmp    (%r15),%eax
jne    1140 <skip_to_nl+0x20>
mov    $0x1,%edi
mov    %r14,%rsi
call   1030 <error@plt>
jmp    1140 <skip_to_nl+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [31 x i8] c"Premature EOF on input stream\0A\00"
define void @skip_to_nl(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %16, %1
%5 = load i32*, i32** %2
%6 = call i32 @getc(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = call i32 @error(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %4
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 10
br i1 %14, label %15, label %16
15: ; preds = %12
ret void
16: ; preds = %12
br label %4
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [31 x i8] c"Premature EOF on input stream\0A\00"
define void @skip_to_nl(i32* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @error(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = icmp eq i32 %3, 10
br i1 %9, label %10, label %2
10: ; preds = %8
ret void
}
void ff_hevc_put_hevc_bi_epel_v4_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_v4_12_sse4() {
ret void
}
void glIsSync(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glIsSync() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sched_switch();
void kernel_start(void) { sched_switch(); }


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

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

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

LLVM IR (-O2):
define void @kernel_start() {
%1 = tail call i32 (...) @sched_switch()
ret void
}
int leapyear(int year) {
  if (year % 100 == 0) {
    return year % 400 == 0;
  } else {
    return year % 4 == 0;
  }
}


x86 assembly (clang, -O0):
<leapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1139 <leapyear+0x39>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <leapyear+0x52>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapyear>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
ror    $0x2,%eax
cmp    $0x28f5c28,%eax
jbe    111a <leapyear+0x1a>
and    $0x3,%edi
jmp    1139 <leapyear+0x39>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x27,%rax
add    %ecx,%eax
imul   $0x190,%eax,%eax
sub    %eax,%edi
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @leapyear(i32 %0) {
%2 = srem i32 %0, 100
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = srem i32 %0, 400
br label %8
6: ; preds = %1
%7 = and i32 %0, 3
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
void PKCS7_ENVELOPE_new(void) {}


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

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

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

LLVM IR (-O2):
define void @PKCS7_ENVELOPE_new() {
ret void
}
/* Variables and functions */
scalar_t__ M_PI_2;
long double sinl(scalar_t__);
long double cosl(long double x) { return sinl(x + M_PI_2); }


x86 assembly (clang, -O0):
<cosl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
faddp  %st,%st(1)
fnstcw -0x22(%rbp)
movzwl -0x22(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x24(%rbp)
fldcw  -0x24(%rbp)
fistpll -0x18(%rbp)
fldcw  -0x22(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <sinl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosl>:
fldt   0x8(%rsp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rsp)
fildll -0x10(%rsp)
faddp  %st,%st(1)
fnstcw -0x14(%rsp)
movzwl -0x14(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0x12(%rsp)
fldcw  -0x12(%rsp)
fistpll -0x8(%rsp)
fldcw  -0x14(%rsp)
mov    -0x8(%rsp),%rdi
jmp    1030 <sinl@plt>

LLVM IR (-O0):
@M_PI_2 = global i64 0
define x86_fp80 @cosl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = load i64, i64* @M_PI_2
%5 = sitofp i64 %4 to x86_fp80
%6 = fadd x86_fp80 %3, %5
%7 = fptosi x86_fp80 %6 to i64
%8 = call x86_fp80 @sinl(i64 %7)
ret x86_fp80 %8
}

LLVM IR (-O2):
@M_PI_2 = global i64 0
define x86_fp80 @cosl(x86_fp80 %0) {
%2 = load i64, i64* @M_PI_2
%3 = sitofp i64 %2 to x86_fp80
%4 = fadd x86_fp80 %3, %0
%5 = fptosi x86_fp80 %4 to i64
%6 = tail call x86_fp80 @sinl(i64 %5)
ret x86_fp80 %6
}
void g_date_get_month() {}


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

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

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

LLVM IR (-O2):
define void @g_date_get_month() {
ret void
}
int rightIntX(int currentX, int currentDir) {
  if (currentDir == 0)
    return currentX + 1;
  else if (currentDir == 2)
    return currentX - 1;
  else
    return currentX;
}


x86 assembly (clang, -O0):
<rightIntX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1122 <rightIntX+0x22>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <rightIntX+0x40>
cmpl   $0x2,-0xc(%rbp)
jne    113a <rightIntX+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <rightIntX+0x40>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightIntX>:
mov    %edi,%eax
cmp    $0x2,%esi
je     110f <rightIntX+0xf>
test   %esi,%esi
jne    1112 <rightIntX+0x12>
add    $0x1,%eax
ret
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @rightIntX(i32 %0, i32 %1) {
switch i32 %1, label %7 [
i32 0, label %3
i32 2, label %5
]
3: ; preds = %2
%4 = add nsw i32 %0, 1
br label %7
5: ; preds = %2
%6 = add nsw i32 %0, -1
br label %7
7: ; preds = %2, %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ], [ %0, %2 ]
ret i32 %8
}
/* Variables and functions */
int nnint(double);
void fixit(int *a, double *b, int n) {
  int i;
  for (i = 0; i < n; i++) {
    a[i] = nnint(b[i]);
  }
}


x86 assembly (clang, -O0):
<fixit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1163 <fixit+0x53>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <nnint@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <fixit+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixit>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1148 <fixit+0x38>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%rbx,8),%xmm0
call   1030 <nnint@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <fixit+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @fixit(i32* nocapture writeonly %0, double* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds double, double* %1, i64 %8
%10 = load double, double* %9
%11 = tail call i32 @nnint(double %10)
%12 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %11, i32* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Type definitions */
struct cl_rhash_table {
  int dummy;
};

/* Variables and functions */
bool cl_rhash_table_entry_exists(const struct cl_rhash_table *tbl, void **ent) {
  return *ent;
}


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

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

LLVM IR (-O0):
%struct.cl_rhash_table = type { i32 }
define i32 @cl_rhash_table_entry_exists(%struct.cl_rhash_table* %0, i8** %1) {
%3 = alloca %struct.cl_rhash_table*
%4 = alloca i8**
store %struct.cl_rhash_table* %0, %struct.cl_rhash_table** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = load i8*, i8** %5
%7 = ptrtoint i8* %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.cl_rhash_table = type { i32 }
define i32 @cl_rhash_table_entry_exists(%struct.cl_rhash_table* nocapture readnone %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int soma(int, int);
int subtracao(int, int);
int main() {
  int one_parameter = 5;
  int second_paramater = 7;
  int resultado_soma = 0;
  resultado_soma = soma(one_parameter, second_paramater);
  int resultado_subtracao = 0;
  resultado_subtracao = subtracao(second_paramater, one_parameter);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <soma@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <subtracao@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x7,%esi
call   1040 <soma@plt>
mov    $0x7,%edi
mov    $0x5,%esi
call   1030 <subtracao@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @soma(i32 5, i32 7)
%2 = tail call i32 @subtracao(i32 7, i32 5)
ret i32 0
}
__attribute__((visibility("hidden"))) int gd_get_ep_nmb(int ep_fd) {
  return ep_fd - 3;
}


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

x86 assembly (clang, -O2):
<gd_get_ep_nmb>:
lea    -0x3(%rdi),%eax
ret

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

LLVM IR (-O2):
define hidden i32 @gd_get_ep_nmb(i32 %0) {
%2 = add nsw i32 %0, -3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ i2c1_read(unsigned char *, int);
int /*<<< orphan*/ i2c1_write(unsigned char *, int);
unsigned char i2c1_readreg(unsigned char reg) {
  unsigned char value;
  i2c1_write(&reg, 1);
  i2c1_read(&value, 1);
  return value;
}


x86 assembly (clang, -O0):
<i2c1_readreg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <i2c1_write@plt>
lea    -0x2(%rbp),%rdi
mov    $0x1,%esi
call   1040 <i2c1_read@plt>
movzbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c1_readreg>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <i2c1_write@plt>
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
call   1040 <i2c1_read@plt>
mov    0x6(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @i2c1_readreg(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = call i32 @i2c1_write(i8* %2, i32 1)
%5 = call i32 @i2c1_read(i8* %3, i32 1)
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @i2c1_readreg(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = call i32 @i2c1_write(i8* %2, i32 1)
%5 = call i32 @i2c1_read(i8* %3, i32 1)
%6 = load i8, i8* %3
ret i8 %6
}
/* Type definitions */
struct auditsec_info {
  int dummy;
};

/* Variables and functions */
long syscall(int, struct auditsec_info *);
long auditsec_question(struct auditsec_info *user_as_i) {
  return syscall(300, user_as_i);
}


x86 assembly (clang, -O0):
<auditsec_question>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x12c,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auditsec_question>:
mov    %rdi,%rsi
mov    $0x12c,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.auditsec_info = type { i32 }
define i64 @auditsec_question(%struct.auditsec_info* %0) {
%2 = alloca %struct.auditsec_info*
store %struct.auditsec_info* %0, %struct.auditsec_info** %2
%3 = load %struct.auditsec_info*, %struct.auditsec_info** %2
%4 = call i64 @syscall(i32 300, %struct.auditsec_info* %3)
ret i64 %4
}

LLVM IR (-O2):
%struct.auditsec_info = type { i32 }
define i64 @auditsec_question(%struct.auditsec_info* %0) {
%2 = tail call i64 @syscall(i32 300, %struct.auditsec_info* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ ABMON_3;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_abmon_3() { return nl_langinfo(ABMON_3); }


x86 assembly (clang, -O0):
<langinfo_abmon_3>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_abmon_3>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@ABMON_3 = global i32 0
define i8* @langinfo_abmon_3() {
%1 = load i32, i32* @ABMON_3
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@ABMON_3 = global i32 0
define i8* @langinfo_abmon_3() {
%1 = load i32, i32* @ABMON_3
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ offset2val(int);
void makevals(uint8_t *vals, uint64_t offset, uint64_t size) {
  int i;
  for (i = 0; i < size; i++) {
    vals[i] = offset2val(offset + i);
  }
}


x86 assembly (clang, -O0):
<makevals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    115b <makevals+0x4b>
mov    -0xc(%rbp),%edi
add    -0x14(%rbp),%edi
call   1030 <offset2val@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <makevals+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makevals>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1146 <makevals+0x36>
mov    %rdi,%r14
mov    %edx,%r15d
mov    %esi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
lea    (%r12,%rbx,1),%edi
call   1030 <offset2val@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <makevals+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @makevals(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = trunc i64 %8 to i32
%10 = add i32 %9, %1
%11 = tail call i32 @offset2val(i32 %10)
%12 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %11, i32* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
__attribute__((always_)) int
register_mem_sect_under_node(struct memory_block *mem_blk, int nid) {
  return 0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __bswap_64(int /*<<< orphan*/);
size_t fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
size_t FR_fread_b64(uint64_t *dest, FILE *file) {
  size_t result = fread(dest, 8, 1, file);
  *dest = __bswap_64(*dest);
  return result;
}


x86 assembly (clang, -O0):
<FR_fread_b64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <__bswap_64@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FR_fread_b64>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %rax,%r14
mov    (%rbx),%edi
call   1040 <__bswap_64@plt>
mov    %eax,(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @FR_fread_b64(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 = load i32*, i32** %4
%8 = call i64 @fread(i32* %6, i32 8, i32 1, i32* %7)
store i64 %8, i64* %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 @__bswap_64(i32 %10)
%12 = load i32*, i32** %3
store i32 %11, i32* %12
%13 = load i64, i64* %5
ret i64 %13
}

LLVM IR (-O2):
define i64 @FR_fread_b64(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fread(i32* %0, i32 8, i32 1, i32* %1)
%4 = load i32, i32* %0
%5 = tail call i32 @__bswap_64(i32 %4)
store i32 %5, i32* %0
ret i64 %3
}
/* Variables and functions */
char *strchr(char const *, char);
int /*<<< orphan*/ strncmp(char *, char *, int);
int get_ses_fru_fault_state(const char *buf) {
  char *fault;
  fault = strchr(buf, 'o');
  if (!fault)
    return -1;
  return !strncmp(fault, "on", 2);
}


x86 assembly (clang, -O0):
<get_ses_fru_fault_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x6f,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1155 <get_ses_fru_fault_state+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <get_ses_fru_fault_state+0x5a>
mov    -0x18(%rbp),%rdi
lea    0xea0(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ses_fru_fault_state>:
push   %rax
mov    $0x6f,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     114f <get_ses_fru_fault_state+0x2f>
lea    0xec9(%rip),%rsi
mov    %rax,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"on\00"
define i32 @get_ses_fru_fault_state(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 111)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 -1, i32* %2
br label %16
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
store i32 %15, i32* %2
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"on\00"
define i32 @get_ses_fru_fault_state(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 111)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strncmp(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void m60_initSet8(uint16_t addr) { (void)addr; }


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

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

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

LLVM IR (-O2):
define void @m60_initSet8(i32 %0) {
ret void
}
int cp_hash_compare_float(void *a1, void *a2) {
  float f1 = *(float *)a1;
  float f2 = *(float *)a2;
  if (f1 > f2)
    return 1;
  if (f1 < f2)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<cp_hash_compare_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
ucomiss -0x20(%rbp),%xmm0
jbe    1141 <cp_hash_compare_float+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1167 <cp_hash_compare_float+0x67>
movss  -0x1c(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1160 <cp_hash_compare_float+0x60>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <cp_hash_compare_float+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp_hash_compare_float>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cp_hash_compare_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = fcmp olt float %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
int comma_1() {
  int a = 9, b = 7;
  int d = (a = a * 2, b = 7 * a++);
  return d;
}


x86 assembly (clang, -O0):
<comma_1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x9,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
imul   $0x7,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @comma_1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 9, i32* %1
store i32 7, i32* %2
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, 2
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = mul nsw i32 7, %6
store i32 %8, i32* %2
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @comma_1() {
ret i32 126
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int hi_set_nonblocking(int sd) {
  int flags;
  flags = fcntl(sd, F_GETFL, 0);
  if (flags < 0) {
    return flags;
  }
  return fcntl(sd, F_SETFL, flags | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<hi_set_nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1146 <hi_set_nonblocking+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <hi_set_nonblocking+0x56>
mov    -0x8(%rbp),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    0x2e8c(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hi_set_nonblocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
js     1143 <hi_set_nonblocking+0x33>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%edx
or     %eax,%edx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <fcntl@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @hi_set_nonblocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %7, %3
%9 = tail call i32 @fcntl(i32 %0, i32 %6, i32 %8)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ %3, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ DrawBMP223(unsigned long, unsigned long, unsigned long,
                              unsigned long, unsigned long);
void drawbmp(unsigned long xd, unsigned long yd, unsigned long wd,
             unsigned long hd, unsigned long c) {
  DrawBMP223(xd, yd, wd, hd, c);
}


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

x86 assembly (clang, -O2):
<drawbmp>:
jmp    1030 <DrawBMP223@plt>

LLVM IR (-O0):
define void @drawbmp(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = call i32 @DrawBMP223(i64 %11, i64 %12, i64 %13, i64 %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @drawbmp(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i32 @DrawBMP223(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret void
}
void gdk_threads_init() {}


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

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

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

LLVM IR (-O2):
define void @gdk_threads_init() {
ret void
}
int fixedPointPercentage(int r) {
  if (r != 0)
    return 1000000 / r;
  else
    return 0;
}


x86 assembly (clang, -O0):
<fixedPointPercentage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1122 <fixedPointPercentage+0x22>
mov    $0xf4240,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1129 <fixedPointPercentage+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixedPointPercentage>:
test   %edi,%edi
je     110e <fixedPointPercentage+0xe>
mov    $0xf4240,%eax
xor    %edx,%edx
idiv   %edi
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fixedPointPercentage(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = sdiv i32 1000000, %0
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
int getSign(int value) { return value >= 0 ? 1 : -1; }


x86 assembly (clang, -O0):
<getSign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovge %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getSign(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = select i1 %2, i32 1, i32 -1
ret i32 %3
}
void _M2_DynamicStrings_finish(__attribute__((unused)) int argc,
                               __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_DynamicStrings_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int helloworld(char *str) {
  int i, r;
  i = 0;
  r = i + 2;
  printf("%s", str);
  return r;
}


x86 assembly (clang, -O0):
<helloworld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helloworld>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @helloworld(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ CodecRegWrite(unsigned int, int, int);
void AIC31ADCInit(unsigned int baseAddr) {
  CodecRegWrite(baseAddr, (15), 0x00);
  CodecRegWrite(baseAddr, (16), 0x00);
  CodecRegWrite(baseAddr, (17), 0xFF);
  CodecRegWrite(baseAddr, (18), 0xFF);
  CodecRegWrite(baseAddr, (19), 0x04);
  CodecRegWrite(baseAddr, (22), 0x04);
}


x86 assembly (clang, -O0):
<AIC31ADCInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xf,%esi
xor    %edx,%edx
call   1030 <CodecRegWrite@plt>
mov    -0x4(%rbp),%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1030 <CodecRegWrite@plt>
mov    -0x4(%rbp),%edi
mov    $0x11,%esi
mov    $0xff,%edx
call   1030 <CodecRegWrite@plt>
mov    -0x4(%rbp),%edi
mov    $0x12,%esi
mov    $0xff,%edx
call   1030 <CodecRegWrite@plt>
mov    -0x4(%rbp),%edi
mov    $0x13,%esi
mov    $0x4,%edx
call   1030 <CodecRegWrite@plt>
mov    -0x4(%rbp),%edi
mov    $0x16,%esi
mov    $0x4,%edx
call   1030 <CodecRegWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AIC31ADCInit>:
push   %rbx
mov    %edi,%ebx
mov    $0xf,%esi
xor    %edx,%edx
call   1030 <CodecRegWrite@plt>
mov    %ebx,%edi
mov    $0x10,%esi
xor    %edx,%edx
call   1030 <CodecRegWrite@plt>
mov    %ebx,%edi
mov    $0x11,%esi
mov    $0xff,%edx
call   1030 <CodecRegWrite@plt>
mov    %ebx,%edi
mov    $0x12,%esi
mov    $0xff,%edx
call   1030 <CodecRegWrite@plt>
mov    %ebx,%edi
mov    $0x13,%esi
mov    $0x4,%edx
call   1030 <CodecRegWrite@plt>
mov    %ebx,%edi
mov    $0x16,%esi
mov    $0x4,%edx
pop    %rbx
jmp    1030 <CodecRegWrite@plt>

LLVM IR (-O0):
define void @AIC31ADCInit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @CodecRegWrite(i32 %3, i32 15, i32 0)
%5 = load i32, i32* %2
%6 = call i32 @CodecRegWrite(i32 %5, i32 16, i32 0)
%7 = load i32, i32* %2
%8 = call i32 @CodecRegWrite(i32 %7, i32 17, i32 255)
%9 = load i32, i32* %2
%10 = call i32 @CodecRegWrite(i32 %9, i32 18, i32 255)
%11 = load i32, i32* %2
%12 = call i32 @CodecRegWrite(i32 %11, i32 19, i32 4)
%13 = load i32, i32* %2
%14 = call i32 @CodecRegWrite(i32 %13, i32 22, i32 4)
ret void
}

LLVM IR (-O2):
define void @AIC31ADCInit(i32 %0) {
%2 = tail call i32 @CodecRegWrite(i32 %0, i32 15, i32 0)
%3 = tail call i32 @CodecRegWrite(i32 %0, i32 16, i32 0)
%4 = tail call i32 @CodecRegWrite(i32 %0, i32 17, i32 255)
%5 = tail call i32 @CodecRegWrite(i32 %0, i32 18, i32 255)
%6 = tail call i32 @CodecRegWrite(i32 %0, i32 19, i32 4)
%7 = tail call i32 @CodecRegWrite(i32 %0, i32 22, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("123123123123!\n");
  printf("Hello, World!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <printf@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>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"123123123123!\0A\00"
@.str.1 = [15 x i8] c"Hello, World!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"123123123123!\00"
@str.2 = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}