xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
int func_1(void) {
  int l_2 = 0L;
  step_hash(1);
  return l_2;
}


x86 assembly (clang, -O0):
<func_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <step_hash@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_1>:
push   %rax
mov    $0x1,%edi
call   1030 <step_hash@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @func_1() {
%1 = tail call i32 @step_hash(i32 1)
ret i32 0
}
/* Variables and functions */
int __isupper_impl(int);
int isupper(int c) { return __isupper_impl(c); }


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

x86 assembly (clang, -O2):
<isupper>:
jmp    1030 <__isupper_impl@plt>

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

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = tail call i32 @__isupper_impl(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glPopMatrix();
void ViewPerspective(void) {
  glMatrixMode(GL_PROJECTION);
  glPopMatrix();
  glMatrixMode(GL_MODELVIEW);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<ViewPerspective>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ViewPerspective>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1040 <glPopMatrix@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glPopMatrix@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @ViewPerspective() {
%1 = load i32, i32* @GL_PROJECTION
%2 = call i32 @glMatrixMode(i32 %1)
%3 = call i32 (...) @glPopMatrix()
%4 = load i32, i32* @GL_MODELVIEW
%5 = call i32 @glMatrixMode(i32 %4)
%6 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @ViewPerspective() {
%1 = load i32, i32* @GL_PROJECTION
%2 = tail call i32 @glMatrixMode(i32 %1)
%3 = tail call i32 (...) @glPopMatrix()
%4 = load i32, i32* @GL_MODELVIEW
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printStr(char const *);
int /*<<< orphan*/ stdout;
void printStrNewline(const char *str) {
  printStr(str);
  fprintf(stdout, "\n");
}


x86 assembly (clang, -O0):
<printStrNewline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printStr@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStrNewline>:
push   %rax
call   1030 <printStr@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @printStrNewline(i8* %0) {
%2 = tail call i32 @printStr(i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void logRunnerStarted() {}


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

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

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

LLVM IR (-O2):
define void @logRunnerStarted() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ too_complex();
void stack_overflow() { too_complex(); }


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

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

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

LLVM IR (-O2):
define void @stack_overflow() {
%1 = tail call i32 (...) @too_complex()
ret void
}
/* Variables and functions */
int tcp_connect(char const *);
int /*<<< orphan*/ time_recv(int);
void test_concur(const char *host) {
  int connfd;
  while (1) {
    connfd = tcp_connect(host);
    time_recv(connfd);
  }
}


x86 assembly (clang, -O0):
<test_concur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <tcp_connect@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <time_recv@plt>
jmp    112c <test_concur+0xc>

x86 assembly (clang, -O2):
<test_concur>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <tcp_connect@plt>
mov    %eax,%edi
call   1030 <time_recv@plt>
jmp    1130 <test_concur+0x10>

LLVM IR (-O0):
define void @test_concur(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %1, %4
%5 = load i8*, i8** %2
%6 = call i32 @tcp_connect(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @time_recv(i32 %7)
br label %4
}

LLVM IR (-O2):
define void @test_concur(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @tcp_connect(i8* %0)
%4 = tail call i32 @time_recv(i32 %3)
br label %2
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int dummy;
};

/* Variables and functions */
int gettimeofday(struct timeval *, struct timezone *);
int tsk_gettimeofday(struct timeval *tv, struct timezone *tz) {
  return gettimeofday(tv, tz);
}


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

x86 assembly (clang, -O2):
<tsk_gettimeofday>:
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @tsk_gettimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timezone*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = load %struct.timezone*, %struct.timezone** %4
%7 = call i32 @gettimeofday(%struct.timeval* %5, %struct.timezone* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
define i32 @tsk_gettimeofday(%struct.timeval* nocapture %0, %struct.timezone* nocapture %1) {
%3 = tail call i32 @gettimeofday(%struct.timeval* %0, %struct.timezone* %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(size_t);
char *memcpy(char *, char const *, size_t);
size_t strnlen(char const *, size_t);
char *strndup(const char *s, size_t n) {
  char *ns;
  n = strnlen(s, n);
  if ((ns = (char *)malloc(n + 1))) {
    ns[n] = '\0';
    return memcpy(ns, s, n);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strndup>:
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 <strnlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1192 <strndup+0x62>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    %rax,-0x8(%rbp)
jmp    119a <strndup+0x6a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1166 <strndup+0x36>
mov    %rax,%rbx
movb   $0x0,(%rax,%r15,1)
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    1168 <strndup+0x38>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i64 @strnlen(i8* %7, i64 %8)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = add i64 %10, 1
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %6
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %23
15: ; preds = %2
%16 = load i8*, i8** %6
%17 = load i64, i64* %5
%18 = getelementptr inbounds i8, i8* %16, i64 %17
store i8 0, i8* %18
%19 = load i8*, i8** %6
%20 = load i8*, i8** %4
%21 = load i64, i64* %5
%22 = call i8* @memcpy(i8* %19, i8* %20, i64 %21)
store i8* %22, i8** %3
br label %24
23: ; preds = %2
store i8* null, i8** %3
br label %24
24: ; preds = %23, %15
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @strndup(i8* nocapture %0, i64 %1) {
%3 = tail call i64 @strnlen(i8* %0, i64 %1)
%4 = add i64 %3, 1
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = getelementptr inbounds i8, i8* %6, i64 %3
store i8 0, i8* %9
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %6, i8* align 1 %0, i64 %3, i1 false)
br label %10
10: ; preds = %2, %8
%11 = phi i8* [ %6, %8 ], [ null, %2 ]
ret i8* %11
}
unsigned kol_mouse_btn() { asm volatile("int $0x40" ::"a"(37), "b"(2)); }


x86 assembly (clang, -O0):
<kol_mouse_btn>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x25,%eax
mov    $0x2,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_mouse_btn>:
push   %rbx
mov    $0x25,%eax
mov    $0x2,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_mouse_btn() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *ft_itoa(int);
int /*<<< orphan*/ ft_putstr(char *);
void ft_putnbr(int n) {
  char *str;
  str = ft_itoa(n);
  ft_putstr(str);
  free(str);
}


x86 assembly (clang, -O0):
<ft_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ft_itoa@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <ft_putstr@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %rbx
call   1040 <ft_itoa@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <ft_putstr@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ft_putnbr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @ft_itoa(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @ft_putstr(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @ft_putnbr(i32 %0) {
%2 = tail call i8* @ft_itoa(i32 %0)
%3 = tail call i32 @ft_putstr(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
int PDC_sanity_check(int adapter) { return (adapter); }


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

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

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

LLVM IR (-O2):
define i32 @PDC_sanity_check(i32 returned %0) {
ret i32 %0
}
float log(r)
float r;
{ return 4.5; }


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

x86 assembly (clang, -O2):
<log>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @log(double %0) {
%2 = alloca float
%3 = fptrunc double %0 to float
store float %3, float* %2
ret float 4.500000e+00
}

LLVM IR (-O2):
define float @log(double %0) {
ret float 4.500000e+00
}
/* Type definitions */
struct core_instr {
  int dummy;
};

/* Variables and functions */
int INSTR_OP(struct core_instr *);
int instr_is_void(struct core_instr *i) { return INSTR_OP(i) < 4; }


x86 assembly (clang, -O0):
<instr_is_void>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <INSTR_OP@plt>
cmp    $0x4,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<instr_is_void>:
push   %rax
call   1030 <INSTR_OP@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.core_instr = type { i32 }
define i32 @instr_is_void(%struct.core_instr* %0) {
%2 = alloca %struct.core_instr*
store %struct.core_instr* %0, %struct.core_instr** %2
%3 = load %struct.core_instr*, %struct.core_instr** %2
%4 = call i32 @INSTR_OP(%struct.core_instr* %3)
%5 = icmp slt i32 %4, 4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.core_instr = type { i32 }
define i32 @instr_is_void(%struct.core_instr* %0) {
%2 = tail call i32 @INSTR_OP(%struct.core_instr* %0)
%3 = icmp slt i32 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t GET_B(const uint32_t value) { return ((uint32_t)value & 0xff); }


x86 assembly (clang, -O0):
<GET_B>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_B>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @GET_B(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XMappingEvent;

/* Variables and functions */
void set_XMappingEvent_type(void *_p, int _v) {
  ((XMappingEvent *)_p)->type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XMappingEvent_type>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XMappingEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void MagicBreakpoint() { asm volatile("xchg %bx, %bx"); }


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

x86 assembly (clang, -O2):
<MagicBreakpoint>:
xchg   %bx,%bx
ret

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

LLVM IR (-O2):
define void @MagicBreakpoint() {
tail call void asm sideeffect "xchg %bx, %bx", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int max(int x, int y) { return (x < y) ? y : x; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @max(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* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void dump_int(int i) { fprintf(stdout, ">>%d<<\n", i); }


x86 assembly (clang, -O0):
<dump_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_int>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c">>%d<<\0A\00"
define void @dump_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c">>%d<<\0A\00"
define void @dump_int(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hzflg2(char *, int, char *, int);
int strlen(char *);
void hzf_log2(char *strg1, char *strg2) {
  int leng1, leng2;
  leng1 = strlen(strg1);
  leng2 = strlen(strg2);
  hzflg2(strg1, leng1, strg2, leng2);
}


x86 assembly (clang, -O0):
<hzf_log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%ecx
call   1040 <hzflg2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hzf_log2>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <hzflg2@plt>

LLVM IR (-O0):
define void @hzf_log2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = call i32 @hzflg2(i8* %11, i32 %12, i8* %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @hzf_log2(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @hzflg2(i8* %0, i32 %3, i8* %1, i32 %4)
ret void
}
int main() {
  int myArray[500][2] = {};
  int incrementer = 0;
  while (incrementer < 501) {
    myArray[incrementer][0] = incrementer;
    myArray[incrementer][1] = incrementer * 2;
    incrementer++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xfb0(%rbp),%rdi
xor    %esi,%esi
mov    $0xfa0,%edx
call   1030 <memset@plt>
movl   $0x0,-0xfb4(%rbp)
cmpl   $0x1f5,-0xfb4(%rbp)
jge    118e <main+0x7e>
mov    -0xfb4(%rbp),%ecx
movslq -0xfb4(%rbp),%rax
mov    %ecx,-0xfb0(%rbp,%rax,8)
mov    -0xfb4(%rbp),%ecx
shl    $0x1,%ecx
movslq -0xfb4(%rbp),%rax
mov    %ecx,-0xfac(%rbp,%rax,8)
mov    -0xfb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfb4(%rbp)
jmp    113f <main+0x2f>
xor    %eax,%eax
add    $0xfc0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [500 x [2 x i32]]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [500 x [2 x i32]]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 501
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [500 x [2 x i32]], [500 x [2 x i32]]* %2, i64 0, i64 %11
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
store i32 %9, i32* %13
%14 = load i32, i32* %3
%15 = mul nsw i32 %14, 2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [500 x [2 x i32]], [500 x [2 x i32]]* %2, i64 0, i64 %17
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %18, i64 0, i64 1
store i32 %15, i32* %19
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %5
22: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void fun(B) {}


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

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

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

LLVM IR (-O2):
define void @fun(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *);
int /*<<< orphan*/ edit_results();
int /*<<< orphan*/ gpg_check();
int /*<<< orphan*/ load_results_gpg();
int /*<<< orphan*/ lock_set();
int /*<<< orphan*/ setup_signals_and_atexit();
void mdp_edit(void) {
  debug("mdp_edit()");
  gpg_check();
  lock_set();
  setup_signals_and_atexit();
  load_results_gpg();
  edit_results();
}


x86 assembly (clang, -O0):
<mdp_edit>:
push   %rbp
mov    %rsp,%rbp
lea    0xe95(%rip),%rdi
call   1040 <debug@plt>
mov    $0x0,%al
call   1060 <gpg_check@plt>
mov    $0x0,%al
call   1050 <lock_set@plt>
mov    $0x0,%al
call   1080 <setup_signals_and_atexit@plt>
mov    $0x0,%al
call   1070 <load_results_gpg@plt>
mov    $0x0,%al
call   1030 <edit_results@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdp_edit>:
push   %rax
lea    0xe98(%rip),%rdi
call   1040 <debug@plt>
xor    %eax,%eax
call   1060 <gpg_check@plt>
xor    %eax,%eax
call   1050 <lock_set@plt>
xor    %eax,%eax
call   1080 <setup_signals_and_atexit@plt>
xor    %eax,%eax
call   1070 <load_results_gpg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <edit_results@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"mdp_edit()\00"
define void @mdp_edit() {
%1 = call i32 @debug(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @gpg_check()
%3 = call i32 (...) @lock_set()
%4 = call i32 (...) @setup_signals_and_atexit()
%5 = call i32 (...) @load_results_gpg()
%6 = call i32 (...) @edit_results()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"mdp_edit()\00"
define void @mdp_edit() {
%1 = tail call i32 @debug(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @gpg_check()
%3 = tail call i32 (...) @lock_set()
%4 = tail call i32 (...) @setup_signals_and_atexit()
%5 = tail call i32 (...) @load_results_gpg()
%6 = tail call i32 (...) @edit_results()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ scanf(char *, double *);
int /*<<< orphan*/ separa(double);
int /*<<< orphan*/ system(char *);
main() {
  double x;
  scanf("%lf", &x);
  separa(x);
  system("pause");
  getch();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1060 <separa@plt>
lea    0xe94(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
call   1060 <separa@plt>
lea    0xea3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = call i32 @separa(double %4)
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = call i32 @separa(double %4)
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @getch()
ret i32 0
}
/* Variables and functions */
double strtod(char const *, int /*<<< orphan*/ *);
double get_double(const char *v) { return strtod(v, NULL); }


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

x86 assembly (clang, -O2):
<get_double>:
xor    %esi,%esi
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define double @get_double(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @strtod(i8* %3, i32* null)
ret double %4
}

LLVM IR (-O2):
define double @get_double(i8* nocapture %0) {
%2 = tail call double @strtod(i8* nocapture %0, i32* null)
ret double %2
}
int test_imm_3Euint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x3E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Euint64_highword_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, 32
%6 = and i64 %5, 62
%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_3Euint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 266287972352
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ llrint(double);
long long llrintf(float x) { return (long long)llrint((double)x); }


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

x86 assembly (clang, -O2):
<llrintf>:
cvtss2sd %xmm0,%xmm0
jmp    1030 <llrint@plt>

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

LLVM IR (-O2):
define i64 @llrintf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @llrint(double %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sub(int, int);
int main() {
  int a = 5;
  int b = 3;
  int ret;
  ret = sub(a, b);
  printf("ret is %d\n", ret);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"ret is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @sub(i32 5, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ e_sty();
int /*<<< orphan*/ e_writeback();
int /*<<< orphan*/ e_zpx();
void e_sty_zpx() {
  e_zpx();
  e_sty();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_sty_zpx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <e_zpx@plt>
mov    $0x0,%al
call   1050 <e_sty@plt>
mov    $0x0,%al
call   1030 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_sty_zpx>:
push   %rax
xor    %eax,%eax
call   1040 <e_zpx@plt>
xor    %eax,%eax
call   1050 <e_sty@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_writeback@plt>

LLVM IR (-O0):
define void @e_sty_zpx() {
%1 = call i32 (...) @e_zpx()
%2 = call i32 (...) @e_sty()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_sty_zpx() {
%1 = tail call i32 (...) @e_zpx()
%2 = tail call i32 (...) @e_sty()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int creat(char *, int);
int /*<<< orphan*/ errno;
scalar_t__ mktemp(char *);
int mkstemp(char *_template) {
  if (mktemp(_template))
    return creat(_template, 0666);
  else {
    errno = ENOENT;
    return -1;
  }
}


x86 assembly (clang, -O0):
<mkstemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <mktemp@plt>
cmp    $0x0,%rax
je     1155 <mkstemp+0x35>
mov    -0x10(%rbp),%rdi
mov    $0x1b6,%esi
call   1030 <creat@plt>
mov    %eax,-0x4(%rbp)
jmp    116e <mkstemp+0x4e>
mov    0x2e74(%rip),%rax
mov    (%rax),%ecx
mov    0x2e7b(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkstemp>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mktemp@plt>
test   %rax,%rax
je     113c <mkstemp+0x1c>
mov    %rbx,%rdi
mov    $0x1b6,%esi
pop    %rbx
jmp    1030 <creat@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    0x2e94(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @mkstemp(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @mktemp(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @creat(i8* %8, i32 438)
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* @ENOENT
store i32 %11, i32* @errno
store i32 -1, i32* %2
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @mkstemp(i8* %0) {
%2 = tail call i64 @mktemp(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @creat(i8* %0, i32 438)
br label %8
6: ; preds = %1
%7 = load i32, i32* @ENOENT
store i32 %7, i32* @errno
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ -1, %6 ]
ret i32 %9
}
int main() {
start:
  goto start;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
int intel_msic_get_battery_pack_temp(int *val) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @intel_msic_get_battery_pack_temp(i32* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ key;

/* Variables and functions */
int /*<<< orphan*/ rgph_u32x4_murmur32v_data(int /*<<< orphan*/ const *, size_t,
                                             uintptr_t, int /*<<< orphan*/ *);
void rgph_u32x4_murmur32v_u16a(const uint16_t *key, size_t len, uintptr_t seed,
                               uint32_t *h) {
  const uint8_t *arg = ((const uint8_t *)(const char *)(key));
  rgph_u32x4_murmur32v_data(arg, len * sizeof(key[0]), seed, h);
}


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

x86 assembly (clang, -O2):
<rgph_u32x4_murmur32v_u16a>:
shl    $0x2,%rsi
jmp    1030 <rgph_u32x4_murmur32v_data@plt>

LLVM IR (-O0):
define void @rgph_u32x4_murmur32v_u16a(i32* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32*
store i32* %0, i32** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = load i32*, i32** %5
%11 = bitcast i32* %10 to i8*
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %9
%13 = load i32*, i32** %9
%14 = load i64, i64* %6
%15 = mul i64 %14, 4
%16 = load i64, i64* %7
%17 = load i32*, i32** %8
%18 = call i32 @rgph_u32x4_murmur32v_data(i32* %13, i64 %15, i64 %16, i32* %17)
ret void
}

LLVM IR (-O2):
define void @rgph_u32x4_murmur32v_u16a(i32* %0, i64 %1, i64 %2, i32* %3) {
%5 = shl i64 %1, 2
%6 = tail call i32 @rgph_u32x4_murmur32v_data(i32* %0, i64 %5, i64 %2, i32* %3)
ret void
}
/* Type definitions */
struct tini_base {
  int dummy;
};

/* Variables and functions */
int tini_parse_core(char const *, struct tini_base **, int /*<<< orphan*/ *);
int tini_parse(const char *tini_file, struct tini_base **base0) {
  *base0 = NULL;
  return tini_parse_core(tini_file, base0, NULL);
}


x86 assembly (clang, -O0):
<tini_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <tini_parse_core@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tini_parse>:
movq   $0x0,(%rsi)
xor    %edx,%edx
jmp    1030 <tini_parse_core@plt>

LLVM IR (-O0):
%struct.tini_base = type { i32 }
define i32 @tini_parse(i8* %0, %struct.tini_base** %1) {
%3 = alloca i8*
%4 = alloca %struct.tini_base**
store i8* %0, i8** %3
store %struct.tini_base** %1, %struct.tini_base*** %4
%5 = load %struct.tini_base**, %struct.tini_base*** %4
store %struct.tini_base* null, %struct.tini_base** %5
%6 = load i8*, i8** %3
%7 = load %struct.tini_base**, %struct.tini_base*** %4
%8 = call i32 @tini_parse_core(i8* %6, %struct.tini_base** %7, i32* null)
ret i32 %8
}

LLVM IR (-O2):
%struct.tini_base = type { i32 }
define i32 @tini_parse(i8* %0, %struct.tini_base** %1) {
store %struct.tini_base* null, %struct.tini_base** %1
%3 = tail call i32 @tini_parse_core(i8* %0, %struct.tini_base** %1, i32* null)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __const_udelay(unsigned long);
void __ndelay(unsigned long nsecs) { __const_udelay(nsecs * 0x00000005); }


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

x86 assembly (clang, -O2):
<__ndelay>:
lea    (%rdi,%rdi,4),%rdi
jmp    1030 <__const_udelay@plt>

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

LLVM IR (-O2):
define void @__ndelay(i64 %0) {
%2 = mul i64 %0, 5
%3 = tail call i32 @__const_udelay(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ yyparse();
void main(void) {
  if (yyparse())
    printf("Parse failed\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <yyparse@plt>
cmp    $0x0,%rax
je     1141 <main+0x21>
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <yyparse@plt>
test   %rax,%rax
je     113a <main+0x1a>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Parse failed\0A\00"
define void @main() {
%1 = call i64 (...) @yyparse()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Parse failed\00"
define void @main() {
%1 = tail call i64 (...) @yyparse()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
double frac(double v) { return v - ((long)v); }


x86 assembly (clang, -O0):
<frac>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvttsd2si -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<frac>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @frac(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
%6 = sitofp i64 %5 to double
%7 = fsub double %3, %6
ret double %7
}

LLVM IR (-O2):
define double @frac(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ ec_f_bak(unsigned char *, int, unsigned char);
void ss_encrypt(unsigned char *a, int n, unsigned char *key) {
  int i;
  for (i = 0; i < 4; i++)
    ec_f_bak(a, n, key[i]);
}


x86 assembly (clang, -O0):
<ss_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    115a <ss_encrypt+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
call   1030 <ec_f_bak@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <ss_encrypt+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ss_encrypt>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
movzbl (%rdx),%edx
call   1030 <ec_f_bak@plt>
movzbl 0x1(%rbx),%edx
mov    %rbp,%rdi
mov    %r14d,%esi
call   1030 <ec_f_bak@plt>
movzbl 0x2(%rbx),%edx
mov    %rbp,%rdi
mov    %r14d,%esi
call   1030 <ec_f_bak@plt>
movzbl 0x3(%rbx),%edx
mov    %rbp,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <ec_f_bak@plt>

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

LLVM IR (-O2):
define void @ss_encrypt(i8* %0, i32 %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = tail call i32 @ec_f_bak(i8* %0, i32 %1, i8 zeroext %4)
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = tail call i32 @ec_f_bak(i8* %0, i32 %1, i8 zeroext %7)
%9 = getelementptr inbounds i8, i8* %2, i64 2
%10 = load i8, i8* %9
%11 = tail call i32 @ec_f_bak(i8* %0, i32 %1, i8 zeroext %10)
%12 = getelementptr inbounds i8, i8* %2, i64 3
%13 = load i8, i8* %12
%14 = tail call i32 @ec_f_bak(i8* %0, i32 %1, i8 zeroext %13)
ret void
}
void ez_def_mutex_lock(volatile void *_param) {
  volatile int *mutex = _param;
  do {
    while (*mutex)
      ;
    (*mutex)++;
    if (*mutex == 1)
      break;
    (*mutex)--;
  } while (1);
}


x86 assembly (clang, -O0):
<ez_def_mutex_lock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1115 <ez_def_mutex_lock+0x15>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    $0x0,%eax
je     1129 <ez_def_mutex_lock+0x29>
jmp    1115 <ez_def_mutex_lock+0x15>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    $0x1,%eax
jne    1148 <ez_def_mutex_lock+0x48>
jmp    1162 <ez_def_mutex_lock+0x62>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    $0x1,%al
test   $0x1,%al
jne    1110 <ez_def_mutex_lock+0x10>
jmp    1162 <ez_def_mutex_lock+0x62>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ez_def_mutex_lock>:
cmpl   $0x0,(%rdi)
jne    1100 <ez_def_mutex_lock>
addl   $0x1,(%rdi)
mov    (%rdi),%eax
cmp    $0x1,%eax
je     1114 <ez_def_mutex_lock+0x14>
addl   $0xffffffff,(%rdi)
jmp    1100 <ez_def_mutex_lock>
ret

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

LLVM IR (-O2):
define void @ez_def_mutex_lock(i8* %0) {
%2 = bitcast i8* %0 to i32*
br label %3
3: ; preds = %6, %1
%4 = load volatile i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %12
br label %3
7: ; preds = %3
%8 = load volatile i32, i32* %2
%9 = add nsw i32 %8, 1
store volatile i32 %9, i32* %2
%10 = load volatile i32, i32* %2
%11 = icmp eq i32 %10, 1
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = load volatile i32, i32* %2
%14 = add nsw i32 %13, -1
store volatile i32 %14, i32* %2
br label %6
15: ; preds = %7
ret void
}
/* Type definitions */
typedef int ptrdiff_t;

/* Variables and functions */
ptrdiff_t posrelat(ptrdiff_t pos, size_t len) {
  if (pos < 0)
    pos += (ptrdiff_t)len + 1;
  return (pos >= 0) ? pos : 0;
}


x86 assembly (clang, -O0):
<posrelat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1122 <posrelat+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1137 <posrelat+0x37>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <posrelat+0x41>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <posrelat+0x41>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posrelat>:
lea    0x1(%rsi),%ecx
mov    %edi,%eax
sar    $0x1f,%eax
and    %ecx,%eax
xor    %ecx,%ecx
add    %edi,%eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @posrelat(i32 %0, i64 %1) {
%3 = icmp slt i32 %0, 0
%4 = trunc i64 %1 to i32
%5 = add nsw i32 %4, 1
%6 = select i1 %3, i32 %5, i32 0
%7 = add nsw i32 %6, %0
%8 = icmp sgt i32 %7, 0
%9 = select i1 %8, i32 %7, i32 0
ret i32 %9
}
unsigned int stress_get_cpu(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @stress_get_cpu() {
ret i32 0
}

LLVM IR (-O2):
define i32 @stress_get_cpu() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int syscall(int, int, int /*<<< orphan*/);
int inotify_rm_watch(int fd, uint32_t wd) { return syscall(255, fd, wd); }


x86 assembly (clang, -O0):
<inotify_rm_watch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0xff,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inotify_rm_watch>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0xff,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @inotify_rm_watch(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 = call i32 @syscall(i32 255, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @inotify_rm_watch(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 255, i32 %0, i32 %1)
ret i32 %3
}