xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long CountLeadingZeroes(unsigned long);
unsigned long Log2Ceil(unsigned long x) {
  return 32 - CountLeadingZeroes(x - 1);
}


x86 assembly (clang, -O0):
<Log2Ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <CountLeadingZeroes@plt>
mov    %rax,%rcx
mov    $0x20,%eax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log2Ceil>:
push   %rax
add    $0xffffffffffffffff,%rdi
call   1030 <CountLeadingZeroes@plt>
mov    $0x20,%ecx
sub    %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @Log2Ceil(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 1
%5 = call i64 @CountLeadingZeroes(i64 %4)
%6 = sub i64 32, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @Log2Ceil(i64 %0) {
%2 = add i64 %0, -1
%3 = tail call i64 @CountLeadingZeroes(i64 %2)
%4 = sub i64 32, %3
ret i64 %4
}
char *windex(char *s, char c) {
  while (*s != '\0' && *s != c)
    s++;
  if (*s == c)
    return (s);
  else
    return (0L);
}


x86 assembly (clang, -O0):
<windex>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     1136 <windex+0x36>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1146 <windex+0x46>
jmp    1157 <windex+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <windex+0xe>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1177 <windex+0x77>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <windex+0x7f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<windex>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     1121 <windex+0x21>
cmp    %sil,%cl
jne    1110 <windex+0x10>
xor    %eax,%eax
cmp    %sil,%cl
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @windex(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %1
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
%11 = select i1 %7, i8* %4, i8* null
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ sleep(int);
int main(int argc, char const *argv[]) {
  init();
  while (1) {
    sleep(1);
  }
  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)
mov    $0x0,%al
call   1030 <init@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
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 (...) @init()
br label %7
7: ; preds = %2, %7
%8 = call i32 @sleep(i32 1)
br label %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
br label %4
4: ; preds = %2, %4
%5 = tail call i32 @sleep(i32 1)
br label %4
}
void dummy(void) { (void)1; }


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

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

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

LLVM IR (-O2):
define void @dummy() {
ret void
}
int test_imm_17int64_lowword_reg(long long val) {
  return ((val) & (0x17 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_17int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x17,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_17int64_lowword_reg>:
test   $0x17,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_17int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 23
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float dcn_bw_floor(const float arg) { return ((int)(arg)); }


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

x86 assembly (clang, -O2):
<dcn_bw_floor>:
cvttps2dq %xmm0,%xmm0
cvtdq2ps %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @dcn_bw_floor(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = sitofp i32 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @dcn_bw_floor(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
ret float %3
}
void gtk_accel_group_disconnect() {}


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

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

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

LLVM IR (-O2):
define void @gtk_accel_group_disconnect() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void reg_write(void *mem_virt, uint32_t offset, uint32_t value) {
  *(volatile uint32_t *)(mem_virt + offset) = value;
}


x86 assembly (clang, -O0):
<reg_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_write>:
movslq %esi,%rax
mov    %edx,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @reg_write(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr i8, i8* %8, i64 %10
%12 = bitcast i8* %11 to i32*
store volatile i32 %7, i32* %12
ret void
}

LLVM IR (-O2):
define void @reg_write(i8* %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr i8, i8* %0, i64 %4
%6 = bitcast i8* %5 to i32*
store volatile i32 %2, i32* %6
ret void
}
/* Variables and functions */
char *c_malloc(int);
int /*<<< orphan*/ init(char *);
char *malloc(int);
int main() {
  char *p;
  init(p);
  p = malloc(42);
  p = c_malloc(42);
  p[0] = '\n';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
call   1040 <init@plt>
mov    $0x2a,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x2a,%edi
call   1030 <c_malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0xa,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <init@plt>
mov    $0x2a,%edi
call   1030 <c_malloc@plt>
movb   $0xa,(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @init(i8* %2)
%4 = call i8* @malloc(i32 42)
store i8* %4, i8** %1
%5 = call i8* @c_malloc(i32 42)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 10, i8* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @init(i8* undef)
%2 = tail call i8* @c_malloc(i32 42)
store i8 10, i8* %2
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xvisibility;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xvisibility_send_event(void *_p) {
  return (int)((XEvent *)_p)->xvisibility.send_event;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xvisibility_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void gtk_rc_get_default_files() {}


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

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

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

LLVM IR (-O2):
define void @gtk_rc_get_default_files() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ keyboard_clear();
void keyboard_init(void) { keyboard_clear(); }


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

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

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

LLVM IR (-O2):
define void @keyboard_init() {
%1 = tail call i32 (...) @keyboard_clear()
ret void
}
void mystrcat(char *s, char *t) {
  while (*s != '\0') {
    s++;
  }
  while ((*s++ = *t++) != '\0') {
  }
}


x86 assembly (clang, -O0):
<mystrcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112d <mystrcat+0x2d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <mystrcat+0xc>
jmp    1132 <mystrcat+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1165 <mystrcat+0x65>
jmp    1132 <mystrcat+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcat>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <mystrcat>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <mystrcat+0x10>
ret

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

LLVM IR (-O2):
define void @mystrcat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
int *ivector(long nl, long nh) {
  int *v;
  v = (int *)malloc((size_t)((nh - nl + 2) * sizeof(int)));
  if (!v)
    nrerror("allocation failure in ivector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x2,%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1160 <ivector+0x40>
lea    0xea5(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x8(,%rsi,4),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <ivector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x2,%r14
sub    %r14,%rbx
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 2
%10 = mul i64 %9, 4
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %5
%13 = load i32*, i32** %5
%14 = icmp ne i32* %13, null
br i1 %14, label %17, label %15
15: ; preds = %2
%16 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
%18 = load i32*, i32** %5
%19 = load i64, i64* %3
%20 = sub i64 0, %19
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = getelementptr inbounds i32, i32* %21, i64 1
ret i32* %22
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in ivector()\00"
define i32* @ivector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i32*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = getelementptr inbounds i32, i32* %13, i64 1
ret i32* %14
}
int funcao2(int x, int y) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @funcao2(i32 %0, i32 %1) {
ret i32 0
}
int __sigbits(int __signo) { return __signo > 32 ? 0 : (1 << (__signo - 1)); }


x86 assembly (clang, -O0):
<__sigbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jle    111b <__sigbits+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <__sigbits+0x2b>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sigbits>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
cmp    $0x21,%edi
cmovl  %edx,%eax
ret

LLVM IR (-O0):
define i32 @__sigbits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 32
br i1 %4, label %5, label %6
5: ; preds = %1
br label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
br label %10
10: ; preds = %6, %5
%11 = phi i32 [ 0, %5 ], [ %9, %6 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @__sigbits(i32 %0) {
%2 = icmp sgt i32 %0, 32
%3 = add nsw i32 %0, -1
%4 = shl nuw i32 1, %3
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((constructor)) void foo2() {
  printf("Hello World from a constructor foo2\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Hello World from a constructor foo2\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @foo2, i8* null }]
define void @foo2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @foo2, i8* null }]
@str = [36 x i8] c"Hello World from a constructor foo2\00"
define void @foo2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void haircut(void) { printf("I have my hair cut.\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"I have my hair cut.\0A\00"
define void @haircut() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"I have my hair cut.\00"
define void @haircut() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_library_to_python_path();
void add_python_library_path(void) { add_library_to_python_path(); }


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

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

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

LLVM IR (-O2):
define void @add_python_library_path() {
%1 = tail call i32 (...) @add_library_to_python_path()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_mapping_table_prefix(FILE *outfp) {
  fprintf(outfp, "struct pmu_events_map pmu_events_map[] = {\n");
}


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

x86 assembly (clang, -O2):
<print_mapping_table_prefix>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x2b,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"struct pmu_events_map pmu_events_map[] = {\0A\00"
define void @print_mapping_table_prefix(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"struct pmu_events_map pmu_events_map[] = {\0A\00"
define void @print_mapping_table_prefix(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 43, i64 1, i32* %0)
ret void
}
unsigned int fb_ConsoleReadXY(int col, int row, int colorflag) { return 0; }


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

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

LLVM IR (-O0):
define i32 @fb_ConsoleReadXY(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @fb_ConsoleReadXY(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
void sigexit(void) { _exit(0); }


x86 assembly (clang, -O0):
<sigexit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O0):
define void @sigexit() {
%1 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigexit() {
%1 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ AltitudeFilterSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void AltitudeFilterSettingsRequestUpdate() {
  UAVObjRequestUpdate(AltitudeFilterSettingsHandle());
}


x86 assembly (clang, -O0):
<AltitudeFilterSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AltitudeFilterSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AltitudeFilterSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <AltitudeFilterSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @AltitudeFilterSettingsRequestUpdate() {
%1 = call i32 (...) @AltitudeFilterSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AltitudeFilterSettingsRequestUpdate() {
%1 = tail call i32 (...) @AltitudeFilterSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int adjustmode(int /*<<< orphan*/, int);
delgmode(int f, int n) { return (adjustmode(0, 1)); }


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

x86 assembly (clang, -O2):
<delgmode>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <adjustmode@plt>

LLVM IR (-O0):
define i32 @delgmode(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @adjustmode(i32 0, i32 1)
ret i32 %5
}

LLVM IR (-O2):
define i32 @delgmode(i32 %0, i32 %1) {
%3 = tail call i32 @adjustmode(i32 0, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int count, sum;
  count = 0;
  sum = 0;
  while (count++ < 20) {
    sum = sum + count;
  }
  printf("sum = %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x14,%eax
jge    1156 <main+0x46>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <main+0x24>
mov    -0x18(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"sum = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 210)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t getProtoHeaderLength() { return 1; }


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

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

LLVM IR (-O0):
define i32 @getProtoHeaderLength() {
ret i32 1
}

LLVM IR (-O2):
define i32 @getProtoHeaderLength() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ is_decimal(char);
int decimal_len(char *s) {
  int i;
  for (i = 0; i < 0x100; i++) {
    if (!is_decimal(s[i]))
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<decimal_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jge    1162 <decimal_len+0x52>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <is_decimal@plt>
cmp    $0x0,%eax
jne    114f <decimal_len+0x3f>
jmp    1162 <decimal_len+0x52>
jmp    1154 <decimal_len+0x44>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <decimal_len+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <is_decimal@plt>
test   %eax,%eax
je     1140 <decimal_len+0x30>
add    $0x1,%rbx
cmp    $0x100,%rbx
jne    1120 <decimal_len+0x10>
mov    $0x100,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @decimal_len(i8* nocapture %0) {
br label %2
2: ; preds = %1, %8
%3 = phi i64 [ 0, %1 ], [ %9, %8 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i32 @is_decimal(i8 signext %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = add nuw nsw i64 %3, 1
%10 = icmp eq i64 %9, 256
br i1 %10, label %13, label %2
11: ; preds = %2
%12 = trunc i64 %3 to i32
br label %13
13: ; preds = %8, %11
%14 = phi i32 [ %12, %11 ], [ 256, %8 ]
ret i32 %14
}
/* Variables and functions */
unsigned long long R(unsigned long long, int);
unsigned long long Sigma0(unsigned long long x) {
  return R(x, 28) ^ R(x, 34) ^ R(x, 39);
}


x86 assembly (clang, -O0):
<Sigma0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1c,%esi
call   1030 <R@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x22,%esi
call   1030 <R@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x27,%esi
call   1030 <R@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
xor    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sigma0>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    $0x1c,%esi
call   1030 <R@plt>
mov    %rax,%r14
mov    %r15,%rdi
mov    $0x22,%esi
call   1030 <R@plt>
mov    %rax,%rbx
xor    %r14,%rbx
mov    %r15,%rdi
mov    $0x27,%esi
call   1030 <R@plt>
xor    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @Sigma0(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @R(i64 %3, i32 28)
%5 = load i64, i64* %2
%6 = call i64 @R(i64 %5, i32 34)
%7 = xor i64 %4, %6
%8 = load i64, i64* %2
%9 = call i64 @R(i64 %8, i32 39)
%10 = xor i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @Sigma0(i64 %0) {
%2 = tail call i64 @R(i64 %0, i32 28)
%3 = tail call i64 @R(i64 %0, i32 34)
%4 = xor i64 %3, %2
%5 = tail call i64 @R(i64 %0, i32 39)
%6 = xor i64 %4, %5
ret i64 %6
}
int sext18(int x) { return (x << 14) >> 14; }


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

x86 assembly (clang, -O2):
<sext18>:
mov    %edi,%eax
shl    $0xe,%eax
sar    $0xe,%eax
ret

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

LLVM IR (-O2):
define i32 @sext18(i32 %0) {
%2 = shl i32 %0, 14
%3 = ashr exact i32 %2, 14
ret i32 %3
}
/* Variables and functions */
int Read_int(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n;
  n = Read_int("Enter an int\n");
  printf("Input value is %d\n", n);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Enter an int\0A\00"
@.str.1 = [19 x i8] c"Input value is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @Read_int(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Enter an int\0A\00"
@.str.1 = [19 x i8] c"Input value is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @Read_int(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ sqrt(double);
float sqrtf(float s) { return (float)sqrt((double)s); }


x86 assembly (clang, -O0):
<sqrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sqrtf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @sqrt(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @sqrtf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @sqrt(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *compal(char *px, char *py) {
  if (strcmp(px, py) > 0)
    return py;
  else
    return px;
}


x86 assembly (clang, -O0):
<compal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jle    1144 <compal+0x34>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <compal+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compal>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strcmp@plt>
test   %rax,%rax
cmovg  %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @compal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i8*, i8** %5
store i8* %11, i8** %3
br label %14
12: ; preds = %2
%13 = load i8*, i8** %4
store i8* %13, i8** %3
br label %14
14: ; preds = %12, %10
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @compal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp sgt i64 %3, 0
%5 = select i1 %4, i8* %1, i8* %0
ret i8* %5
}
c_rawreader__(fd, bb, n) int *fd, *n;
char bb[];
{
  int i, nn;
  nn = (*n);
  i = read(*fd, bb, nn);
  if (i == nn)
    return (0);
  else
    return (i);
}


x86 assembly (clang, -O0):
<c_rawreader__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%edx
mov    $0x0,%al
call   1030 <read@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jne    115c <c_rawreader__+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1162 <c_rawreader__+0x52>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_rawreader__>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdx),%ebx
mov    (%rdi),%edi
xor    %ebp,%ebp
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <read@plt>
cmp    %ebx,%eax
cmove  %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @c_rawreader__(i32* nocapture %0, i8* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = load i32, i32* %0
%6 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 %5, i8* %1, i32 %4)
%7 = icmp eq i32 %6, %4
%8 = select i1 %7, i32 0, i32 %6
ret i32 %8
}
void pop_back_imp() {}


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

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

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

LLVM IR (-O2):
define void @pop_back_imp() {
ret void
}
/* Type definitions */
struct cpufreq_affected_cpus {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cpufreq_put_affected_cpus(struct cpufreq_affected_cpus *);
void cpufreq_put_related_cpus(struct cpufreq_affected_cpus *any) {
  cpufreq_put_affected_cpus(any);
}


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

x86 assembly (clang, -O2):
<cpufreq_put_related_cpus>:
jmp    1030 <cpufreq_put_affected_cpus@plt>

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

LLVM IR (-O2):
%struct.cpufreq_affected_cpus = type { i32 }
define void @cpufreq_put_related_cpus(%struct.cpufreq_affected_cpus* %0) {
%2 = tail call i32 @cpufreq_put_affected_cpus(%struct.cpufreq_affected_cpus* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t normalize(int value, int max) {
  return (((value) < (max) ? (value) : (max)) * 255 + max / 2) / max;
}


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <normalize+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <normalize+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   $0xff,%eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
cmp    %esi,%edi
cmovge %esi,%edi
mov    %edi,%ecx
shl    $0x8,%ecx
sub    %edi,%ecx
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
add    %ecx,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @normalize(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = mul nsw i32 %4, 255
%6 = sdiv i32 %1, 2
%7 = add nsw i32 %5, %6
%8 = sdiv i32 %7, %1
ret i32 %8
}
void main(void) {
  int x = 255;
  while (x) {
    x--;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0xff,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1123 <main+0x23>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <main+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 255, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* %1
%7 = add nsw i32 %6, -1
store i32 %7, i32* %1
br label %2
8: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
void gtk_tree_view_column_set_sort_indicator() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_set_sort_indicator() {
ret void
}
int test_imm_33uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x33 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_33uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 51
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *Listen(int);
int /*<<< orphan*/ SendData(int, char *);
char *GetService(int connection, char *text) {
  SendData(connection, text);
  return (Listen(connection));
}


x86 assembly (clang, -O0):
<GetService>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <SendData@plt>
mov    -0x4(%rbp),%edi
call   1030 <Listen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetService>:
push   %rbx
mov    %edi,%ebx
call   1040 <SendData@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <Listen@plt>

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

LLVM IR (-O2):
define i8* @GetService(i32 %0, i8* %1) {
%3 = tail call i32 @SendData(i32 %0, i8* %1)
%4 = tail call i8* @Listen(i32 %0)
ret i8* %4
}
float sgrad1(int hash, float x) {
  int h = hash & 15;
  float grad = 1.0f + (h & 7);
  if (h & 8)
    grad = -grad;
  return (grad * x);
}


x86 assembly (clang, -O0):
<sgrad1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7,%eax
cvtsi2ss %eax,%xmm1
movss  0xed9(%rip),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1156 <sgrad1+0x56>
movss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgrad1>:
mov    %edi,%eax
and    $0x7,%eax
cvtsi2ss %eax,%xmm1
addss  0xeef(%rip),%xmm1
test   $0x8,%dil
je     111e <sgrad1+0x1e>
xorps  0xef2(%rip),%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sgrad1(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%7 = load i32, i32* %3
%8 = and i32 %7, 15
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = and i32 %9, 7
%11 = sitofp i32 %10 to float
%12 = fadd float 1.000000e+00, %11
store float %12, float* %6
%13 = load i32, i32* %5
%14 = and i32 %13, 8
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load float, float* %6
%18 = fneg float %17
store float %18, float* %6
br label %19
19: ; preds = %16, %2
%20 = load float, float* %6
%21 = load float, float* %4
%22 = fmul float %20, %21
ret float %22
}

LLVM IR (-O2):
define float @sgrad1(i32 %0, float %1) {
%3 = and i32 %0, 7
%4 = sitofp i32 %3 to float
%5 = fadd float %4, 1.000000e+00
%6 = and i32 %0, 8
%7 = icmp eq i32 %6, 0
%8 = fneg float %5
%9 = select i1 %7, float %5, float %8
%10 = fmul float %9, %1
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printf("Convert .BNK instruments to OPL registers\n"
         "Usage: <BNK file> <TXT file> <Conversion mode>\n"
         "where:\n"
         "\t1 - (default) Converts to VGMCK MML for YM3812\n"
         "\t2 - Converts to VGMCK MML for YMF262\n"
         "\t3 - Converts to SiON MML for OPL\n"
         "\t4 - Converts to SiON MML for OPN\n"
         "\t5 - Converts to SiON MML for OPM\n"
         "\t6 - Converts to SiON MML for OPX\n"
         "\t7 - Converts to SiON MML for MA3\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [353 x i8] c"Convert .BNK instruments to OPL registers\0AUsage: <BNK file> <TXT file> <Conversion mode>\0Awhere:\0A\091 - (default) Converts to VGMCK MML for YM3812\0A\092 - Converts to VGMCK MML for YMF262\0A\093 - Converts to SiON MML for OPL\0A\094 - Converts to SiON MML for OPN\0A\095 - Converts to SiON MML for OPM\0A\096 - Converts to SiON MML for OPX\0A\097 - Converts to SiON MML for MA3\0A\00"
@EXIT_SUCCESS = global i32 0
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([353 x i8], [353 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [352 x i8] c"Convert .BNK instruments to OPL registers\0AUsage: <BNK file> <TXT file> <Conversion mode>\0Awhere:\0A\091 - (default) Converts to VGMCK MML for YM3812\0A\092 - Converts to VGMCK MML for YMF262\0A\093 - Converts to SiON MML for OPL\0A\094 - Converts to SiON MML for OPN\0A\095 - Converts to SiON MML for OPM\0A\096 - Converts to SiON MML for OPX\0A\097 - Converts to SiON MML for MA3\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([352 x i8], [352 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
void lf2(void) {}


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

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

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

LLVM IR (-O2):
define void @lf2() {
ret void
}