xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dumb_read_line(char *, char *, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
int strlen(char *);
void dumb_read_misc_line(char *s, char *prompt) {
  dumb_read_line(s, prompt, 0, 0, 0, 0);
  s[strlen(s) - 1] = '\0';
}


x86 assembly (clang, -O0):
<dumb_read_misc_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1040 <dumb_read_line@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumb_read_misc_line>:
push   %rbx
mov    %rdi,%rbx
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <dumb_read_line@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @dumb_read_misc_line(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @dumb_read_line(i8* %5, i8* %6, i32 0, i32 0, i32 0, i32 0)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %8, i64 %12
store i8 0, i8* %13
ret void
}

LLVM IR (-O2):
define void @dumb_read_misc_line(i8* %0, i8* %1) {
%3 = tail call i32 @dumb_read_line(i8* %0, i8* %1, i32 0, i32 0, i32 0, i32 0)
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret void
}
/* Type definitions */
typedef int u_char;

/* Variables and functions */
int /*<<< orphan*/ memcmp(char const *, char const *, int);
int etherIsZero(u_char *mac) {
  u_char zero[6] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
  return (!memcmp((const char *)mac, (const char *)zero, 6));
}


x86 assembly (clang, -O0):
<etherIsZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x6,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<etherIsZero>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x6,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @etherIsZero(i32* %0) {
%2 = alloca i32*
%3 = alloca [6 x i32]
store i32* %0, i32** %2
%4 = bitcast [6 x i32]* %3 to i8*
%5 = load i32*, i32** %2
%6 = bitcast i32* %5 to i8*
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%8 = bitcast i32* %7 to i8*
%9 = call i32 @memcmp(i8* %6, i8* %8, i32 6)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @etherIsZero(i32* %0) {
%2 = alloca [6 x i32]
%3 = bitcast [6 x i32]* %2 to i8*
%4 = bitcast i32* %0 to i8*
%5 = call i32 @memcmp(i8* %4, i8* %3, i32 6)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void set_gdt(const struct gdt_ptr *ptr) {
  __asm__ volatile("lgdt (%0)" : : "a"(ptr));
}


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

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

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

LLVM IR (-O2):
%struct.gdt_ptr = type opaque
define void @set_gdt(%struct.gdt_ptr* %0) {
tail call void asm sideeffect "lgdt ($0)", "{ax},~{dirflag},~{fpsr},~{flags}"(%struct.gdt_ptr* %0)
ret void
}
double ls_cost_nm8_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<ls_cost_nm8_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm8_twice>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ls_cost_nm8_twice(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @ls_cost_nm8_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
void RSA_free(void) {}


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

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

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

LLVM IR (-O2):
define void @RSA_free() {
ret void
}
/* Type definitions */
typedef int chtype;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int A_ATTRIBUTES;
int A_BOLD;
int /*<<< orphan*/ wattrset(int /*<<< orphan*/ *, int);
void setcolor(WINDOW *win, chtype color) {
  chtype attr = color & (A_ATTRIBUTES);
  attr &= ~A_BOLD;
  wattrset(win, attr);
}


x86 assembly (clang, -O0):
<setcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eb7(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <wattrset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setcolor>:
mov    0x2ec9(%rip),%rax
and    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
not    %eax
and    %eax,%esi
jmp    1030 <wattrset@plt>

LLVM IR (-O0):
@A_ATTRIBUTES = global i32 0
@A_BOLD = global i32 0
define void @setcolor(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* @A_ATTRIBUTES
%8 = and i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* @A_BOLD
%10 = xor i32 %9, -1
%11 = load i32, i32* %5
%12 = and i32 %11, %10
store i32 %12, i32* %5
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = call i32 @wattrset(i32* %13, i32 %14)
ret void
}

LLVM IR (-O2):
@A_ATTRIBUTES = global i32 0
@A_BOLD = global i32 0
define void @setcolor(i32* %0, i32 %1) {
%3 = load i32, i32* @A_ATTRIBUTES
%4 = and i32 %3, %1
%5 = load i32, i32* @A_BOLD
%6 = xor i32 %5, -1
%7 = and i32 %4, %6
%8 = tail call i32 @wattrset(i32* %0, i32 %7)
ret void
}
int fun588() { return 588; }


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

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

LLVM IR (-O0):
define i32 @fun588() {
ret i32 588
}

LLVM IR (-O2):
define i32 @fun588() {
ret i32 588
}
int test_imm_1Auint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x1A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Auint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1703936
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
main(void) {
  char cadena[80] = "Hola";
  printf("El tamaño de cadena es %d\n", strlen(cadena));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1050 <memset@plt>
movb   $0x48,-0x50(%rbp)
movb   $0x6f,-0x4f(%rbp)
movb   $0x6c,-0x4e(%rbp)
movb   $0x61,-0x4d(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x616c6f48,(%rsp)
mov    %rsp,%rdi
call   1030 <strlen@plt>
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"El tama\C3\B1o de cadena es %d\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = bitcast [80 x i8]* %1 to i8*
%3 = bitcast i8* %2 to [80 x i8]*
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i32 0, i32 0
store i8 72, i8* %4
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i32 0, i32 1
store i8 111, i8* %5
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i32 0, i32 2
store i8 108, i8* %6
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i32 0, i32 3
store i8 97, i8* %7
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"El tama\C3\B1o de cadena es %d\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
store i8 72, i8* %2
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 1
store i8 111, i8* %3
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 2
store i8 108, i8* %4
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 3
store i8 97, i8* %5
%6 = call i32 @strlen(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
unsigned char answer_10(unsigned char *arg0) { return (*arg0 >> 6); }


x86 assembly (clang, -O0):
<answer_10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
sar    $0x6,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<answer_10>:
mov    (%rdi),%al
shr    $0x6,%al
ret

LLVM IR (-O0):
define zeroext i8 @answer_10(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = ashr i32 %5, 6
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @answer_10(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = lshr i8 %2, 6
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ es9(float *, int);
int main() {
  float array[] = {35.4, 46.7, 77.55, 11.1, 9.04, 0.75};
  es9(array, sizeof(array) / sizeof(array[0]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1030 <es9@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <es9@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [6 x float] [float 0x4041B33340000000, float 0x40475999A0000000, float 0x4053633340000000, float 0x4026333340000000, float 0x4022147AE0000000, float 7.500000e-01]
define i32 @main() {
%1 = alloca [6 x float]
%2 = bitcast [6 x float]* %1 to i8*
%3 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 0
%4 = call i32 @es9(float* %3, i32 6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [6 x float] [float 0x4041B33340000000, float 0x40475999A0000000, float 0x4053633340000000, float 0x4026333340000000, float 0x4022147AE0000000, float 7.500000e-01]
define i32 @main() {
%1 = alloca [6 x float]
%2 = bitcast [6 x float]* %1 to i8*
%3 = getelementptr inbounds [6 x float], [6 x float]* %1, i64 0, i64 0
%4 = call i32 @es9(float* %3, i32 6)
ret i32 0
}
/* Variables and functions */
double scs_sin_rd(double);
double sin_rd(double x) { return scs_sin_rd(x); }


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

x86 assembly (clang, -O2):
<sin_rd>:
jmp    1030 <scs_sin_rd@plt>

LLVM IR (-O0):
define double @sin_rd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @scs_sin_rd(double %3)
ret double %4
}

LLVM IR (-O2):
define double @sin_rd(double %0) {
%2 = tail call double @scs_sin_rd(double %0)
ret double %2
}
struct s3c2410_sdi *s3c2410_get_base_sdi(void) {
  return (struct s3c2410_sdi *)0x5A000000;
}


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

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

LLVM IR (-O0):
%struct.s3c2410_sdi = type opaque
define %struct.s3c2410_sdi* @s3c2410_get_base_sdi() {
ret %struct.s3c2410_sdi* inttoptr (i64 1509949440 to %struct.s3c2410_sdi*)
}

LLVM IR (-O2):
%struct.s3c2410_sdi = type opaque
define %struct.s3c2410_sdi* @s3c2410_get_base_sdi() {
ret %struct.s3c2410_sdi* inttoptr (i64 1509949440 to %struct.s3c2410_sdi*)
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ xcb_get_input_focus(int /*<<< orphan*/ *);
int /*<<< orphan*/ xcb_get_input_focus_reply(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/,
                                             int /*<<< orphan*/ *);
void xcb_aux_sync(xcb_connection_t *c) {
  free(xcb_get_input_focus_reply(c, xcb_get_input_focus(c), NULL));
}


x86 assembly (clang, -O0):
<xcb_aux_sync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <xcb_get_input_focus@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <xcb_get_input_focus_reply@plt>
mov    %eax,%edi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_aux_sync>:
push   %rbx
mov    %rdi,%rbx
call   1050 <xcb_get_input_focus@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <xcb_get_input_focus_reply@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @xcb_aux_sync(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @xcb_get_input_focus(i32* %4)
%6 = call i32 @xcb_get_input_focus_reply(i32* %3, i32 %5, i32* null)
%7 = call i32 @free(i32 %6)
ret void
}

LLVM IR (-O2):
define void @xcb_aux_sync(i32* %0) {
%2 = tail call i32 @xcb_get_input_focus(i32* %0)
%3 = tail call i32 @xcb_get_input_focus_reply(i32* %0, i32 %2, i32* null)
%4 = tail call i32 @free(i32 %3)
ret void
}
int test_imm_ECuint16_reg(unsigned short val) {
  return ((val) & (-0xEC << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_ECuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -236
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int *foo5(int **a, int *b) { return __sync_lock_test_and_set(a, b); }


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

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

LLVM IR (-O0):
define i32* @foo5(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 = bitcast i32** %5 to i64*
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = atomicrmw xchg i64* %6, i64 %8 seq_cst
%10 = inttoptr i64 %9 to i32*
ret i32* %10
}

LLVM IR (-O2):
define i32* @foo5(i32** nocapture %0, i32* %1) {
%3 = bitcast i32** %0 to i64*
%4 = ptrtoint i32* %1 to i64
%5 = atomicrmw xchg i64* %3, i64 %4 seq_cst
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}
void poke32(unsigned int addr, unsigned int val) {
  *((volatile unsigned int *)addr) = val;
}


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

x86 assembly (clang, -O2):
<poke32>:
mov    %edi,%eax
mov    %esi,(%rax)
ret

LLVM IR (-O0):
define void @poke32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @poke32(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 %1, i32* %4
ret void
}
/* Variables and functions */
scalar_t__ rs_ends_with(char const *, char *);
scalar_t__ strcmp(char const *, char *);
int accept_file(const char *filename) {
  return strcmp(filename, "-") == 0 || rs_ends_with(filename, ".csv");
}


x86 assembly (clang, -O0):
<accept_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1168 <accept_file+0x48>
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1040 <rs_ends_with@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1151 <accept_file+0x31>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <rs_ends_with@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [5 x i8] c".csv\00"
define i32 @accept_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @rs_ends_with(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@.str.1 = [5 x i8] c".csv\00"
define i32 @accept_file(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @rs_ends_with(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int ls_costN_nm8_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_costN_nm8_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_costN_nm8_n_out() {
ret i32 2
}
int baudrate_to_ubir(int baudrate) { return baudrate / 100 - 1; }


x86 assembly (clang, -O0):
<baudrate_to_ubir>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baudrate_to_ubir>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
sar    $0x25,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @baudrate_to_ubir(i32 %0) {
%2 = sdiv i32 %0, 100
%3 = add nsw i32 %2, -1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
FILE *log_open(const char *filename) {
  FILE *log_fp = fopen(filename, "a");
  if (log_fp == NULL) {
    fprintf(stderr, "can not open log file %s", filename);
  }
  return log_fp;
}


x86 assembly (clang, -O0):
<log_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1164 <log_open+0x44>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_open>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1153 <log_open+0x33>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@stderr = global i32 0
@.str.1 = [25 x i8] c"can not open log file %s\00"
define i32* @log_open(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %1
%13 = load i32*, i32** %3
ret i32* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@stderr = global i32 0
@.str.1 = [25 x i8] c"can not open log file %s\00"
define noalias i32* @log_open(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %4, %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ end();
void end_radial_dist(void) {
  end();
  end();
  end();
}


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

x86 assembly (clang, -O2):
<end_radial_dist>:
push   %rax
xor    %eax,%eax
call   1030 <end@plt>
xor    %eax,%eax
call   1030 <end@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <end@plt>

LLVM IR (-O0):
define void @end_radial_dist() {
%1 = call i32 (...) @end()
%2 = call i32 (...) @end()
%3 = call i32 (...) @end()
ret void
}

LLVM IR (-O2):
define void @end_radial_dist() {
%1 = tail call i32 (...) @end()
%2 = tail call i32 (...) @end()
%3 = tail call i32 (...) @end()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void yyerror() { error("parse error"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"parse error\00"
define void @yyerror() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ch_flush();
int ch_getflags();
int /*<<< orphan*/ clr_hilite();
int /*<<< orphan*/ clr_linenum();
void clear_buffers(void) {
  if (!(ch_getflags() & 001))
    return;
  ch_flush();
  clr_linenum();
  clr_hilite();
}


x86 assembly (clang, -O0):
<clear_buffers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ch_getflags@plt>
and    $0x1,%eax
cmp    $0x0,%eax
jne    115c <clear_buffers+0x1c>
jmp    1171 <clear_buffers+0x31>
mov    $0x0,%al
call   1050 <ch_flush@plt>
mov    $0x0,%al
call   1060 <clr_linenum@plt>
mov    $0x0,%al
call   1030 <clr_hilite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buffers>:
push   %rax
xor    %eax,%eax
call   1040 <ch_getflags@plt>
test   $0x1,%al
jne    114e <clear_buffers+0xe>
pop    %rax
ret
xor    %eax,%eax
call   1050 <ch_flush@plt>
xor    %eax,%eax
call   1060 <clr_linenum@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <clr_hilite@plt>

LLVM IR (-O0):
define void @clear_buffers() {
%1 = call i32 (...) @ch_getflags()
%2 = and i32 %1, 1
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
br label %9
5: ; preds = %0
%6 = call i32 (...) @ch_flush()
%7 = call i32 (...) @clr_linenum()
%8 = call i32 (...) @clr_hilite()
br label %9
9: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
define void @clear_buffers() {
%1 = tail call i32 (...) @ch_getflags()
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call i32 (...) @ch_flush()
%6 = tail call i32 (...) @clr_linenum()
%7 = tail call i32 (...) @clr_hilite()
br label %8
8: ; preds = %0, %4
ret void
}
float num_lerp(float a, float b, float t) { return a + (b - a) * t; }


x86 assembly (clang, -O0):
<num_lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_lerp>:
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @num_lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %4
%10 = fsub float %8, %9
%11 = load float, float* %6
%12 = call float @llvm.fmuladd.f32(float %10, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @num_lerp(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %4, float %2, float %0)
ret float %5
}
int main() {
  param_lister1_aux(__builtin_types_compatible_p(typeof(1), int) * 1 +
                        __builtin_types_compatible_p(typeof(1), long long) * 2 +
                        __builtin_types_compatible_p(typeof(1), double) * 3 +
                        __builtin_types_compatible_p(typeof(1), long double) *
                            4,
                    1);
  param_lister4_aux(
      __builtin_types_compatible_p(typeof(1), int) * 1 +
          __builtin_types_compatible_p(typeof(1), long long) * 2 +
          __builtin_types_compatible_p(typeof(1), double) * 3 +
          __builtin_types_compatible_p(typeof(1), long double) * 4,
      1,
      __builtin_types_compatible_p(typeof(2.0), int) * 1 +
          __builtin_types_compatible_p(typeof(2.0), long long) * 2 +
          __builtin_types_compatible_p(typeof(2.0), double) * 3 +
          __builtin_types_compatible_p(typeof(2.0), long double) * 4,
      2.0,
      __builtin_types_compatible_p(typeof(3), int) * 1 +
          __builtin_types_compatible_p(typeof(3), long long) * 2 +
          __builtin_types_compatible_p(typeof(3), double) * 3 +
          __builtin_types_compatible_p(typeof(3), long double) * 4,
      3,
      __builtin_types_compatible_p(typeof(6.0), int) * 1 +
          __builtin_types_compatible_p(typeof(6.0), long long) * 2 +
          __builtin_types_compatible_p(typeof(6.0), double) * 3 +
          __builtin_types_compatible_p(typeof(6.0), long double) * 4,
      6.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <param_lister1_aux@plt>
mov    $0x1,%ecx
mov    $0x3,%r9d
movsd  0xeb0(%rip),%xmm0
movsd  0xeb0(%rip),%xmm1
mov    %ecx,%edi
mov    %ecx,%esi
mov    %r9d,%edx
mov    %r9d,%r8d
mov    $0x2,%al
call   1040 <param_lister4_aux@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <param_lister1_aux@plt>
movsd  0xec6(%rip),%xmm0
movsd  0xec6(%rip),%xmm1
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
mov    $0x3,%r8d
mov    $0x3,%r9d
mov    $0x2,%al
call   1040 <param_lister4_aux@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32, i32, ...) bitcast (i32 (...)* @param_lister1_aux to i32 (i32, i32, ...)*)(i32 1, i32 1)
%3 = call i32 (i32, i32, i32, double, i32, i32, i32, double, ...) bitcast (i32 (...)* @param_lister4_aux to i32 (i32, i32, i32, double, i32, i32, i32, double, ...)*)(i32 1, i32 1, i32 3, double 2.000000e+00, i32 1, i32 3, i32 3, double 6.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @param_lister1_aux to i32 (i32, i32, ...)*)(i32 1, i32 1)
%2 = tail call i32 (i32, i32, i32, double, i32, i32, i32, double, ...) bitcast (i32 (...)* @param_lister4_aux to i32 (i32, i32, i32, double, i32, i32, i32, double, ...)*)(i32 1, i32 1, i32 3, double 2.000000e+00, i32 1, i32 3, i32 3, double 6.000000e+00)
ret i32 0
}
void __attribute__((constructor)) __pt_init(void) {}


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__pt_init, i8* null }]
define void @__pt_init() {
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer
define void @__pt_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int gen_ABRT() {
  kill(getpid(), SIGABRT);
  return 0;
}


x86 assembly (clang, -O0):
<gen_ABRT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_ABRT>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGABRT = global i32 0
define i32 @gen_ABRT() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGABRT
%3 = call i32 @kill(i32 %1, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define i32 @gen_ABRT() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGABRT
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret i32 0
}
void fun(int to, int from) { to = from; }


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

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

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

LLVM IR (-O2):
define void @fun(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ timer_disable_interrupt();
void timer_dettach_interrupt(void) { timer_disable_interrupt(); }


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

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

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

LLVM IR (-O2):
define void @timer_dettach_interrupt() {
%1 = tail call i32 (...) @timer_disable_interrupt()
ret void
}
void angine_long_press(int x, int y) {}


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

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

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

LLVM IR (-O2):
define void @angine_long_press(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void CloseUart(int devFilePtr) { close(devFilePtr); }


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

x86 assembly (clang, -O2):
<CloseUart>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @CloseUart(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int chflags(const char *file, unsigned long int flags) {
  if (file == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<chflags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1145 <chflags+0x35>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <chflags+0x4a>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chflags>:
push   %rax
test   %rdi,%rdi
jne    111f <chflags+0xf>
mov    0x2ebb(%rip),%rax
jmp    1126 <chflags+0x16>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @chflags(i8* readnone %0, i64 %1) {
%3 = icmp eq i8* %0, null
%4 = load i32, i32* @EINVAL
%5 = load i32, i32* @ENOSYS
%6 = select i1 %3, i32 %4, i32 %5
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
void OS2Init(void) {}


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

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

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

LLVM IR (-O2):
define void @OS2Init() {
ret void
}
long CDRplay(unsigned char *sector) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @CDRplay(i8* nocapture readnone %0) {
ret i64 0
}
int foo(int a) { return a - 5; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, -5
ret i32 %2
}
/* Variables and functions */
int any_odd_one(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", any_odd_one(0));
  printf("%d\n", any_odd_one(1));
  printf("%d\n", any_odd_one(2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <any_odd_one@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <any_odd_one@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <any_odd_one@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <any_odd_one@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <any_odd_one@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <any_odd_one@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @any_odd_one(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @any_odd_one(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @any_odd_one(i32 2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void StateMsg(const char *msg, const char *name) {
  (void)msg;
  (void)name;
}


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

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

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

LLVM IR (-O2):
define void @StateMsg(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ xnomem();
void *xcalloc(size_t number, size_t size) {
  void *ptr;
  if (!(ptr = calloc(number, size)))
    xnomem();
  return (ptr);
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1152 <xcalloc+0x32>
mov    $0x0,%al
call   1040 <xnomem@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xcalloc+0x15>
xor    %eax,%eax
call   1040 <xnomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @xnomem()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
extern unsigned high_word(unsigned long long a) { return a >> 32; }


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

x86 assembly (clang, -O2):
<high_word>:
mov    %rdi,%rax
shr    $0x20,%rax
ret

LLVM IR (-O0):
define i32 @high_word(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @high_word(i64 %0) {
%2 = lshr i64 %0, 32
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Quitall();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void *Quitproc() {
  printf("\n\nSERVER SHUTDOWN\n");
  Quitall();
  exit(0);
}


x86 assembly (clang, -O0):
<Quitproc>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <Quitall@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<Quitproc>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <Quitall@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\0A\0ASERVER SHUTDOWN\0A\00"
define i8* @Quitproc() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @Quitall()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [18 x i8] c"\0A\0ASERVER SHUTDOWN\00"
define noalias i8* @Quitproc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @Quitall()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
int /*<<< orphan*/ chrecv(int, int *, int, int);
int /*<<< orphan*/ chsend(int, int *, int, int);
__attribute__((no)) void worker(int in, int out) {
  int val;
  while (1) {
    chrecv(in, &val, sizeof(val), -1);
    chsend(out, &val, sizeof(val), -1);
  }
}


x86 assembly (clang, -O0):
<worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
mov    $0xffffffff,%ecx
call   1030 <chrecv@plt>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
mov    $0xffffffff,%ecx
call   1040 <chsend@plt>
jmp    112e <worker+0xe>

x86 assembly (clang, -O2):
<worker>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
mov    $0xffffffff,%ecx
call   1030 <chrecv@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
mov    $0xffffffff,%ecx
call   1040 <chsend@plt>
jmp    1140 <worker+0x20>

LLVM IR (-O0):
define void @worker(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
6: ; preds = %2, %6
%7 = load i32, i32* %3
%8 = call i32 @chrecv(i32 %7, i32* %5, i32 4, i32 -1)
%9 = load i32, i32* %4
%10 = call i32 @chsend(i32 %9, i32* %5, i32 4, i32 -1)
br label %6
}

LLVM IR (-O2):
define void @worker(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %5, %2
%6 = call i32 @chrecv(i32 %0, i32* %3, i32 4, i32 -1)
%7 = call i32 @chsend(i32 %1, i32* %3, i32 4, i32 -1)
br label %5
}
void isr_2_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @isr_2_Interrupt() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XPointerMovedEvent;

/* Variables and functions */
unsigned long get_XPointerMovedEvent_window(void *_p) {
  return (unsigned long)((XPointerMovedEvent *)_p)->window;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XPointerMovedEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
struct tempfile {
  int dummy;
};

/* Variables and functions */
struct tempfile *mks_tempfile_tsm(char const *, int, int);
struct tempfile *mks_tempfile_ts(const char *filename_template, int suffixlen) {
  return mks_tempfile_tsm(filename_template, suffixlen, 0600);
}


x86 assembly (clang, -O0):
<mks_tempfile_ts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x180,%edx
call   1030 <mks_tempfile_tsm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mks_tempfile_ts>:
mov    $0x180,%edx
jmp    1030 <mks_tempfile_tsm@plt>

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

LLVM IR (-O2):
%struct.tempfile = type { i32 }
define %struct.tempfile* @mks_tempfile_ts(i8* %0, i32 %1) {
%3 = tail call %struct.tempfile* @mks_tempfile_tsm(i8* %0, i32 %1, i32 384)
ret %struct.tempfile* %3
}