xunge/DecIR huggingface dataset:
void bt5a_shutdown() { int i; }


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

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

LLVM IR (-O0):
define void @bt5a_shutdown() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @bt5a_shutdown() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ quit(int, char *, size_t);
char *rr_malloc(size_t n_bytes) {
  char *result;
  result = (char *)malloc((((n_bytes) > (1)) ? (n_bytes) : (1)));
  if (!result)
    quit(-1, "rr_malloc: could not allocate %d bytes\n", n_bytes);
  return (result);
}


x86 assembly (clang, -O0):
<rr_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
jbe    1144 <rr_malloc+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <rr_malloc+0x32>
mov    $0x1,%eax
mov    %rax,-0x18(%rbp)
jmp    1152 <rr_malloc+0x32>
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117f <rr_malloc+0x5f>
mov    -0x8(%rbp),%rdx
mov    $0xffffffff,%edi
lea    0xe86(%rip),%rsi
call   1030 <quit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rr_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rdi,%rdi
mov    $0x1,%edi
cmovne %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1154 <rr_malloc+0x34>
lea    0xeb9(%rip),%rsi
mov    $0xffffffff,%edi
mov    %rbx,%rdx
call   1030 <quit@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [40 x i8] c"rr_malloc: could not allocate %d bytes\0A\00"
define i8* @rr_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp ugt i64 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i64, i64* %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi i64 [ %7, %6 ], [ 1, %8 ]
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = icmp ne i8* %13, null
br i1 %14, label %18, label %15
15: ; preds = %9
%16 = load i64, i64* %2
%17 = call i32 @quit(i32 -1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %16)
br label %18
18: ; preds = %15, %9
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@.str = [40 x i8] c"rr_malloc: could not allocate %d bytes\0A\00"
define i8* @rr_malloc(i64 %0) {
%2 = icmp ugt i64 %0, 1
%3 = select i1 %2, i64 %0, i64 1
%4 = tail call i64 @malloc(i64 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @quit(i32 -1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %8
8: ; preds = %6, %1
%9 = inttoptr i64 %4 to i8*
ret i8* %9
}
void App_MemFault_ISR(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<App_MemFault_ISR>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <App_MemFault_ISR+0x9>
jmp    1109 <App_MemFault_ISR+0x9>

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

LLVM IR (-O0):
define void @App_MemFault_ISR() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @App_MemFault_ISR() {
br label %1
1: ; preds = %1, %0
br label %1
}
int test_imm_4Bint32_reg(int val) { return ((val) & (0x4B << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_4Bint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x4b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_4Bint32_reg(i32 %0) {
%2 = and i32 %0, 75
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct tms {
  int /*<<< orphan*/ tms_cstime;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
clock_t get_tms_cstime(struct tms *ptms) { return ptms->tms_cstime; }


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

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

LLVM IR (-O0):
%struct.tms = type { i32 }
define i32 @get_tms_cstime(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
%3 = load %struct.tms*, %struct.tms** %2
%4 = getelementptr inbounds %struct.tms, %struct.tms* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @get_tms_cstime(%struct.tms* nocapture %0) {
%2 = getelementptr inbounds %struct.tms, %struct.tms* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DisplayList_aux(struct list *, int /*<<< orphan*/);
void DisplayList(struct list *l) { DisplayList_aux(l, 0); }


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

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

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

LLVM IR (-O2):
%struct.list = type { i32 }
define void @DisplayList(%struct.list* %0) {
%2 = tail call i32 @DisplayList_aux(%struct.list* %0, i32 0)
ret void
}
int ll_trailing_zero(long long a) { return __builtin_ctzll(a); }


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

x86 assembly (clang, -O2):
<ll_trailing_zero>:
bsf    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @ll_trailing_zero(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.cttz.i64(i64 %3, i1 true)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ll_trailing_zero(i64 %0) {
%2 = tail call i64 @llvm.cttz.i64(i64 %0, i1 true)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int f237(int *);
int f238(int *p) { return f237(p); }


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

x86 assembly (clang, -O2):
<f238>:
jmp    1030 <f237@plt>

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

LLVM IR (-O2):
define i32 @f238(i32* %0) {
%2 = tail call i32 @f237(i32* %0)
ret i32 %2
}
int test_imm_B5int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xB5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B5int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 181
%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_B5int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 777389080576
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ log_info(char *, ...);
int /*<<< orphan*/ xkey_finalize();
void finalize_handler(int sig) {
  log_info("finalize_handler: Finalizing, signal=%d", sig);
  xkey_finalize();
  log_info("finalize_handler: Exiting");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<finalize_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <log_info@plt>
mov    $0x0,%al
call   1030 <xkey_finalize@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <log_info@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<finalize_handler>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <log_info@plt>
xor    %eax,%eax
call   1030 <xkey_finalize@plt>
lea    0xed9(%rip),%rdi
xor    %eax,%eax
call   1040 <log_info@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"finalize_handler: Finalizing, signal=%d\00"
@.str.1 = [26 x i8] c"finalize_handler: Exiting\00"
@EXIT_SUCCESS = global i32 0
define void @finalize_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @log_info(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @xkey_finalize()
%6 = call i32 (i8*, ...) @log_info(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [40 x i8] c"finalize_handler: Finalizing, signal=%d\00"
@.str.1 = [26 x i8] c"finalize_handler: Exiting\00"
@EXIT_SUCCESS = global i32 0
define void @finalize_handler(i32 %0) {
%2 = tail call i32 (i8*, ...) @log_info(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @xkey_finalize()
%4 = tail call i32 (i8*, ...) @log_info(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
}
int _tt_dummyfunc(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_tt_dummyfunc() {
ret i32 0
}
void g_key_file_remove_group() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_remove_group() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ term_read_paste(long *);
void term_discard_paste(void) {
  long size;
  free(term_read_paste(&size));
}


x86 assembly (clang, -O0):
<term_discard_paste>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1040 <term_read_paste@plt>
mov    %eax,%edi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_discard_paste>:
push   %rax
mov    %rsp,%rdi
call   1040 <term_read_paste@plt>
mov    %eax,%edi
call   1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @term_discard_paste() {
%1 = alloca i64
%2 = call i32 @term_read_paste(i64* %1)
%3 = call i32 @free(i32 %2)
ret void
}

LLVM IR (-O2):
define void @term_discard_paste() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @term_read_paste(i64* %1)
%4 = call i32 @free(i32 %3)
ret void
}
unsigned long stringToHash(const char *str) {
  const char *s = str;
  unsigned long hash = 0;
  while (*s != '\0')
    hash = ((hash * 33) ^ (*s++));
  return hash;
}


x86 assembly (clang, -O0):
<stringToHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <stringToHash+0x4c>
imul   $0x21,-0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbq (%rcx),%rcx
xor    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <stringToHash+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringToHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <stringToHash+0x2d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
xor    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <stringToHash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @stringToHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 33
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i64
%11 = xor i64 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
int getnum(s)
char *s;
{
  int a;
  char c;
  a = 0;
  while ((c = *s++) >= '0' && c <= '9') {
    a = a * 10 + c - '0';
  }
  return (a);
}


x86 assembly (clang, -O0):
<getnum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xe(%rbp)
jl     1141 <getnum+0x41>
movsbl -0xd(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
test   $0x1,%al
jne    1151 <getnum+0x51>
jmp    1166 <getnum+0x66>
imul   $0xa,-0xc(%rbp),%eax
movsbl -0xd(%rbp),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <getnum+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnum>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <getnum+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <getnum+0x20>
ret

LLVM IR (-O0):
define i32 @getnum(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %17, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
store i8 %8, i8* %4
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 48
br i1 %10, label %11, label %15
11: ; preds = %5
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 57
br label %15
15: ; preds = %11, %5
%16 = phi i1 [ false, %5 ], [ %14, %11 ]
br i1 %16, label %17, label %24
17: ; preds = %15
%18 = load i32, i32* %3
%19 = mul nsw i32 %18, 10
%20 = load i8, i8* %4
%21 = sext i8 %20 to i32
%22 = add nsw i32 %19, %21
%23 = sub nsw i32 %22, 48
store i32 %23, i32* %3
br label %5
24: ; preds = %15
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @getnum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i8* [ %10, %5 ], [ %0, %1 ]
%8 = phi i32 [ %13, %5 ], [ 0, %1 ]
%9 = zext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = mul nsw i32 %8, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %9
%14 = load i8, i8* %10
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
double sphere_area(double r) { return 4 * 3.1415926 * r * r; }


x86 assembly (clang, -O0):
<sphere_area>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sphere_area>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @sphere_area(double %0) {
%2 = fmul double %0, 0x402921FB4D12D84A
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
void console_ESC_K(char *esc_param) {
  int p[1];
  sscanf(esc_param, "%d", &p[0]);
}


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

x86 assembly (clang, -O2):
<console_ESC_K>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @console_ESC_K(i8* nocapture %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%5 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
ret void
}
void __attribute__((section(".after_vectors"), weak)) SVC_Handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<SVC_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <SVC_Handler+0x9>
jmp    1109 <SVC_Handler+0x9>

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

LLVM IR (-O0):
define weak void @SVC_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @SVC_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
signed int signedint_ignoring_signedshort(signed int x, signed short y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @signedint_ignoring_signedshort(i32 returned %0, i16 signext %1) {
ret i32 %0
}
void NetworkShutDown() {}


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

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

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

LLVM IR (-O2):
define void @NetworkShutDown() {
ret void
}
/* Variables and functions */
double fabs(double);
int /*<<< orphan*/ printf(char *, double, double, double);
int assertEquals(double x, double y, double d) {
  if (fabs(x - y) <= d)
    return 0;
  printf("assertEquals fails: %.7g != %.7g +/- %.7g\n", x, y, d);
  return 1;
}


x86 assembly (clang, -O0):
<assertEquals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movaps 0xec8(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1157 <assertEquals+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1179 <assertEquals+0x69>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertEquals>:
push   %rax
movapd %xmm0,%xmm3
subsd  %xmm1,%xmm3
andpd  0xedf(%rip),%xmm3
xor    %eax,%eax
ucomisd %xmm3,%xmm2
jae    113a <assertEquals+0x2a>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"assertEquals fails: %.7g != %.7g +/- %.7g\0A\00"
define i32 @assertEquals(double %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fsub double %8, %9
%11 = call double @llvm.fabs.f64(double %10)
%12 = load double, double* %7
%13 = fcmp ole double %11, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 0, i32* %4
br label %20
15: ; preds = %3
%16 = load double, double* %5
%17 = load double, double* %6
%18 = load double, double* %7
%19 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), double %16, double %17, double %18)
store i32 1, i32* %4
br label %20
20: ; preds = %15, %14
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
@.str = [43 x i8] c"assertEquals fails: %.7g != %.7g +/- %.7g\0A\00"
define i32 @assertEquals(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp ugt double %5, %2
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), double %0, double %1, double %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ mps_telemetry_flush();
void doFlush(void) { mps_telemetry_flush(); }


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

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

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

LLVM IR (-O2):
define void @doFlush() {
%1 = tail call i32 (...) @mps_telemetry_flush()
ret void
}
void rtl8139_init() {}


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

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

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

LLVM IR (-O2):
define void @rtl8139_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void getNum(int *numptr) {
  printf("Please enter a number -- ");
  scanf("%i", numptr);
}


x86 assembly (clang, -O0):
<getNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed7(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNum>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Please enter a number -- \00"
@.str.1 = [3 x i8] c"%i\00"
define void @getNum(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Please enter a number -- \00"
@.str.1 = [3 x i8] c"%i\00"
define void @getNum(i32* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
ret void
}
void QF_onIdle(void) { ; }


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

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

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

LLVM IR (-O2):
define void @QF_onIdle() {
ret void
}
void iassert(int val) {}


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

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

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

LLVM IR (-O2):
define void @iassert(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall0(int);
void start_threads(void) { syscall0(0x2003); }


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

x86 assembly (clang, -O2):
<start_threads>:
mov    $0x2003,%edi
jmp    1030 <syscall0@plt>

LLVM IR (-O0):
define void @start_threads() {
%1 = call i32 @syscall0(i32 8195)
ret void
}

LLVM IR (-O2):
define void @start_threads() {
%1 = tail call i32 @syscall0(i32 8195)
ret void
}
/* Variables and functions */
scalar_t__ source_peekn(char *, unsigned int);
int source_peeknc(unsigned pos) {
  char c;
  if (source_peekn(&c, pos) <= 0)
    return -1;
  return (unsigned int)(unsigned char)c;
}


x86 assembly (clang, -O0):
<source_peeknc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    -0x9(%rbp),%rdi
call   1030 <source_peekn@plt>
cmp    $0x0,%rax
jg     113d <source_peeknc+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1144 <source_peeknc+0x34>
movzbl -0x9(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<source_peeknc>:
push   %rax
mov    %edi,%esi
lea    0x7(%rsp),%rdi
call   1030 <source_peekn@plt>
test   %rax,%rax
movzbl 0x7(%rsp),%ecx
mov    $0xffffffff,%eax
cmovg  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @source_peeknc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @source_peekn(i8* %4, i32 %5)
%7 = icmp sle i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @source_peeknc(i32 %0) {
%2 = alloca i8
%3 = call i64 @source_peekn(i8* %2, i32 %0)
%4 = icmp slt i64 %3, 1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 -1, i32 %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ powf(float, int);
int sqrtf(scalar_t__);
float circular_in(float step, float max_steps, float max_val) {
  float ratio = step / max_steps;
  return -max_val * (sqrtf(1 - powf(ratio, 2)) - 1);
}


x86 assembly (clang, -O0):
<circular_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <powf@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1040 <sqrtf@plt>
movss  -0x14(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circular_in>:
sub    $0x18,%rsp
divss  %xmm1,%xmm0
xorps  0xed1(%rip),%xmm2
movaps %xmm2,(%rsp)
mov    $0x2,%edi
call   1030 <powf@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1040 <sqrtf@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @circular_in(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fdiv float %8, %9
store float %10, float* %7
%11 = load float, float* %6
%12 = fneg float %11
%13 = load float, float* %7
%14 = call i64 @powf(float %13, i32 2)
%15 = sub nsw i64 1, %14
%16 = call i32 @sqrtf(i64 %15)
%17 = sub nsw i32 %16, 1
%18 = sitofp i32 %17 to float
%19 = fmul float %12, %18
ret float %19
}

LLVM IR (-O2):
define float @circular_in(float %0, float %1, float %2) {
%4 = fdiv float %0, %1
%5 = fneg float %2
%6 = tail call i64 @powf(float %4, i32 2)
%7 = sub nsw i64 1, %6
%8 = tail call i32 @sqrtf(i64 %7)
%9 = add nsw i32 %8, -1
%10 = sitofp i32 %9 to float
%11 = fmul float %5, %10
ret float %11
}
void test_one(int x) {
#pragma omp target teams distribute parallel for
  for (int i = 0; i < x; i++)
    ;
}


x86 assembly (clang, -O0):
<test_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <test_one+0x2d>
jmp    111f <test_one+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <test_one+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_one(i32 %0) {
ret void
}
float read_float(const char *buf) { return *(float *)buf; }


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

x86 assembly (clang, -O2):
<read_float>:
movss  (%rdi),%xmm0
ret

LLVM IR (-O0):
define float @read_float(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to float*
%5 = load float, float* %4
ret float %5
}

LLVM IR (-O2):
define float @read_float(i8* nocapture %0) {
%2 = bitcast i8* %0 to float*
%3 = load float, float* %2
ret float %3
}
unsigned long long int fib(int n) {
  int x, y;
  if (n < 2)
    return n;
  else {
    x = fib(n - 1);
    y = fib(n - 2);
    return x + y;
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1132 <fib+0x22>
movslq -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115a <fib+0x4a>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x1,%edi
jg     1120 <fib+0x10>
movslq %ebx,%rax
jmp    113a <fib+0x2a>
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
mov    %rax,%r14
add    $0xfffffffe,%ebx
mov    %ebx,%edi
call   1030 <fib@plt>
add    %r14d,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
br label %5
5: ; preds = %3, %7
%6 = phi i64 [ %14, %7 ], [ %4, %3 ]
ret i64 %6
7: ; preds = %1
%8 = add nsw i32 %0, -1
%9 = tail call i64 @fib(i32 %8)
%10 = add nsw i32 %0, -2
%11 = tail call i64 @fib(i32 %10)
%12 = add i64 %11, %9
%13 = shl i64 %12, 32
%14 = ashr exact i64 %13, 32
br label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ response;

/* Variables and functions */
int /*<<< orphan*/ FifoProtocol_memcpy(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ *, int);
uint16_t inv_fifoprotocol_helper_encode_load(uint8_t who, uint8_t what,
                                             uint32_t response, uint8_t *out) {
  out[0] = who;
  out[1] = what;
  response = response;
  FifoProtocol_memcpy((&out[2]), (&response), (sizeof(response)));
  return 6;
}


x86 assembly (clang, -O0):
<inv_fifoprotocol_helper_encode_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x8,%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    $0x6,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_fifoprotocol_helper_encode_load>:
push   %rax
mov    %edx,0x4(%rsp)
mov    %edi,(%rcx)
mov    %esi,0x4(%rcx)
lea    0x8(%rcx),%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    $0x6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @inv_fifoprotocol_helper_encode_load(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i32*, i32** %8
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %6
%13 = load i32*, i32** %8
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %7
store i32 %15, i32* %7
%16 = load i32*, i32** %8
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = call i32 @FifoProtocol_memcpy(i32* %17, i32* %7, i32 4)
ret i32 6
}

LLVM IR (-O2):
define i32 @inv_fifoprotocol_helper_encode_load(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
store i32 %2, i32* %5
store i32 %0, i32* %3
%6 = getelementptr inbounds i32, i32* %3, i64 1
store i32 %1, i32* %6
%7 = getelementptr inbounds i32, i32* %3, i64 2
%8 = call i32 @FifoProtocol_memcpy(i32* %7, i32* %5, i32 4)
ret i32 6
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
time_t time(time_t *tloc) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @time(i32* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ fn();
int /*<<< orphan*/ funfn(int, int, int, int, char *);
int /*<<< orphan*/ malloc(int);
int /*<<< orphan*/ nonMalloc(int);
int main() {
  malloc(10);
  nonMalloc(20);
  fn();
  funfn(1, 2, 3, 4, "hey");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    $0x14,%edi
call   1050 <nonMalloc@plt>
mov    $0x0,%al
call   1030 <fn@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
lea    0xe86(%rip),%r8
call   1060 <funfn@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    $0x14,%edi
call   1050 <nonMalloc@plt>
xor    %eax,%eax
call   1030 <fn@plt>
lea    0xe9d(%rip),%r8
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1060 <funfn@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"hey\00"
define i32 @main() {
%1 = call i32 @malloc(i32 10)
%2 = call i32 @nonMalloc(i32 20)
%3 = call i32 (...) @fn()
%4 = call i32 @funfn(i32 1, i32 2, i32 3, i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"hey\00"
define i32 @main() {
%1 = tail call i32 @malloc(i32 10)
%2 = tail call i32 @nonMalloc(i32 20)
%3 = tail call i32 (...) @fn()
%4 = tail call i32 @funfn(i32 1, i32 2, i32 3, i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *rq_calendar_alloc(int /*<<< orphan*/ *);
void *rq_calendar_constructor() { return rq_calendar_alloc(NULL); }


x86 assembly (clang, -O0):
<rq_calendar_constructor>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <rq_calendar_alloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_calendar_constructor>:
xor    %edi,%edi
jmp    1030 <rq_calendar_alloc@plt>

LLVM IR (-O0):
define i8* @rq_calendar_constructor() {
%1 = call i8* @rq_calendar_alloc(i32* null)
ret i8* %1
}

LLVM IR (-O2):
define i8* @rq_calendar_constructor() {
%1 = tail call i8* @rq_calendar_alloc(i32* null)
ret i8* %1
}
void uv_cpu_init(void) {}


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

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

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

LLVM IR (-O2):
define void @uv_cpu_init() {
ret void
}
void do_state_3(char c, int *state, char *word, int *length) {
  word[(*length)++] = c;
  if (c == '\"') {
    *state = 4;
  } else if (c == '\\') {
    *state = 5;
  }
}


x86 assembly (clang, -O0):
<do_state_3>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rsi
mov    (%rsi),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rsi)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movsbl -0x1(%rbp),%eax
cmp    $0x22,%eax
jne    114c <do_state_3+0x4c>
mov    -0x10(%rbp),%rax
movl   $0x4,(%rax)
jmp    1168 <do_state_3+0x68>
movsbl -0x1(%rbp),%eax
cmp    $0x5c,%eax
jne    1163 <do_state_3+0x63>
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
jmp    1168 <do_state_3+0x68>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_state_3>:
movslq (%rcx),%r8
lea    0x1(%r8),%eax
mov    %eax,(%rcx)
mov    %dil,(%rdx,%r8,1)
cmp    $0x22,%dil
je     1120 <do_state_3+0x20>
cmp    $0x5c,%dil
jne    1127 <do_state_3+0x27>
mov    $0x5,%eax
jmp    1125 <do_state_3+0x25>
mov    $0x4,%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @do_state_3(i8 signext %0, i32* nocapture writeonly %1, i8* nocapture writeonly %2, i32* nocapture %3) {
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
store i8 %0, i8* %8
switch i8 %0, label %12 [
i8 34, label %10
i8 92, label %9
]
9: ; preds = %4
br label %10
10: ; preds = %4, %9
%11 = phi i32 [ 5, %9 ], [ 4, %4 ]
store i32 %11, i32* %1
br label %12
12: ; preds = %10, %4
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t I2SOutPointerGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(0x40021000 + 0x0000002C))));
}


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

x86 assembly (clang, -O2):
<I2SOutPointerGet>:
mov    %rdi,-0x8(%rsp)
mov    0x4002102c,%rax
40
ret

LLVM IR (-O0):
define i64 @I2SOutPointerGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073877036 to i64*)
ret i64 %3
}

LLVM IR (-O2):
define i64 @I2SOutPointerGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073877036 to i64*)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int V1 = 2;
  int V2 = 3;
  int V3 = 1;
  int V4;
  if (V1 == 3) {
    V4 = V2;
  } else {
    V4 = V3;
  }
  printf("%d\n", V4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    1142 <main+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <main+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <printf@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *);
off_t lseek(int fildes __attribute__((unused)),
            off_t offset __attribute__((unused)),
            int whence __attribute__((unused))) {
  printf("lseek\n");
  errno = EBADF;
  return -1;
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea3(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
mov    0x2eb3(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
@str = [6 x i8] c"lseek\00"
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* @EBADF
store i32 %5, i32* @errno
ret i32 -1
}
/* Variables and functions */
int ez_net_resolve_generic(char *, char *, size_t, int /*<<< orphan*/);
int ez_net_resolve_host_name(char *host, char *ipbuf, size_t ipbuf_len) {
  return ez_net_resolve_generic(host, ipbuf, ipbuf_len, 0);
}


x86 assembly (clang, -O0):
<ez_net_resolve_host_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <ez_net_resolve_generic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ez_net_resolve_host_name>:
xor    %ecx,%ecx
jmp    1030 <ez_net_resolve_generic@plt>

LLVM IR (-O0):
define i32 @ez_net_resolve_host_name(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @ez_net_resolve_generic(i8* %7, i8* %8, i64 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ez_net_resolve_host_name(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @ez_net_resolve_generic(i8* %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}