xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(short *, char *, int);
int ntohs(short);
int getFlag(char *datagram) {
  short flag;
  memcpy(&flag, datagram, sizeof(short));
  return ntohs(flag);
}


x86 assembly (clang, -O0):
<getFlag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xa(%rbp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
movswl -0xa(%rbp),%edi
call   1040 <ntohs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFlag>:
push   %rax
mov    %rdi,%rsi
lea    0x6(%rsp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
movswl 0x6(%rsp),%edi
call   1040 <ntohs@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getFlag(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i16* %3, i8* %4, i32 2)
%6 = load i16, i16* %3
%7 = call i32 @ntohs(i16 signext %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @getFlag(i8* %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = call i32 @memcpy(i16* %2, i8* %0, i32 2)
%5 = load i16, i16* %2
%6 = call i32 @ntohs(i16 signext %5)
ret i32 %6
}
int compare0(const void *p0, const void *p1) {
  unsigned u0 = *(const unsigned *)p0;
  unsigned u1 = *(const unsigned *)p1;
  int ret = 0;
  if (u0 < u1)
    ret = -1;
  if (u0 > u1)
    ret = 1;
  static unsigned comparisons;
  comparisons++;
  return ret;
}


x86 assembly (clang, -O0):
<compare0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    1138 <compare0+0x38>
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jbe    114b <compare0+0x4b>
movl   $0x1,-0x1c(%rbp)
mov    0x2ed3(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eca(%rip)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare0>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
sbb    %edx,%edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovbe %edx,%eax
addl   $0x1,0x2f0b(%rip)
ret

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

LLVM IR (-O2):
@compare0.comparisons = internal unnamed_addr global i32 0
define i32 @compare0(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ult i32 %4, %6
%8 = sext i1 %7 to i32
%9 = icmp ugt i32 %4, %6
%10 = select i1 %9, i32 1, i32 %8
%11 = load i32, i32* @compare0.comparisons
%12 = add i32 %11, 1
store i32 %12, i32* @compare0.comparisons
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ ZowiTone(int, double, int, int);
void S_mode3() {
  ZowiTone(10, 1318.51, 50, 100);
  ZowiTone(10, 1567.98, 50, 100);
  ZowiTone(10, 2349.32, 100, 0);
}


x86 assembly (clang, -O0):
<S_mode3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
movsd  0xeef(%rip),%xmm0
mov    $0x32,%esi
mov    $0x64,%edx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
movsd  0xecb(%rip),%xmm0
mov    $0x32,%esi
mov    $0x64,%edx
call   1030 <ZowiTone@plt>
mov    $0xa,%edi
movsd  0xea7(%rip),%xmm0
mov    $0x64,%esi
xor    %edx,%edx
call   1030 <ZowiTone@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<S_mode3>:
push   %rax
movsd  0xee7(%rip),%xmm0
mov    $0xa,%edi
mov    $0x32,%esi
mov    $0x64,%edx
call   1030 <ZowiTone@plt>
movsd  0xed3(%rip),%xmm0
mov    $0xa,%edi
mov    $0x32,%esi
mov    $0x64,%edx
call   1030 <ZowiTone@plt>
movsd  0xebf(%rip),%xmm0
mov    $0xa,%edi
mov    $0x64,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <ZowiTone@plt>

LLVM IR (-O0):
define void @S_mode3() {
%1 = call i32 @ZowiTone(i32 10, double 1.318510e+03, i32 50, i32 100)
%2 = call i32 @ZowiTone(i32 10, double 1.567980e+03, i32 50, i32 100)
%3 = call i32 @ZowiTone(i32 10, double 2.349320e+03, i32 100, i32 0)
ret void
}

LLVM IR (-O2):
define void @S_mode3() {
%1 = tail call i32 @ZowiTone(i32 10, double 1.318510e+03, i32 50, i32 100)
%2 = tail call i32 @ZowiTone(i32 10, double 1.567980e+03, i32 50, i32 100)
%3 = tail call i32 @ZowiTone(i32 10, double 2.349320e+03, i32 100, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ release_processor();
void null_process() {
  while (1) {
    release_processor();
  }
}


x86 assembly (clang, -O0):
<null_process>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <null_process+0x9>
mov    $0x0,%al
call   1030 <release_processor@plt>
jmp    1119 <null_process+0x9>

x86 assembly (clang, -O2):
<null_process>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <release_processor@plt>
jmp    1120 <null_process+0x10>

LLVM IR (-O0):
define void @null_process() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @release_processor()
br label %1
}

LLVM IR (-O2):
define void @null_process() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @release_processor()
br label %1
}
int f() { return 12 + 34; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 46
}

LLVM IR (-O2):
define i32 @f() {
ret i32 46
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t get_timestamp() {
  uint64_t ret;
  struct timeval tv;
  if (gettimeofday(&tv, NULL) == 0) {
    ret = tv.tv_sec;
  } else {
    do {
      do {
      } while (0);
    } while (0);
    ret = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<get_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jne    113c <get_timestamp+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1158 <get_timestamp+0x48>
jmp    1141 <get_timestamp+0x31>
jmp    1146 <get_timestamp+0x36>
jmp    114b <get_timestamp+0x3b>
jmp    1150 <get_timestamp+0x40>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_timestamp>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
jne    112d <get_timestamp+0x1d>
mov    0x8(%rsp),%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64 }
define i64 @get_timestamp() {
%1 = alloca i64
%2 = alloca %struct.timeval
%3 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%7 = load i64, i64* %6
store i64 %7, i64* %1
br label %13
8: ; preds = %0
br label %9
9: ; preds = %8
br label %10
10: ; preds = %9
br label %11
11: ; preds = %10
br label %12
12: ; preds = %11
store i64 0, i64* %1
br label %13
13: ; preds = %12, %5
%14 = load i64, i64* %1
ret i64 %14
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define i64 @get_timestamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = select i1 %4, i64 %6, i64 0
ret i64 %7
}
/* Variables and functions */
int primes(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int N = 200000;
  printf("primes: %d\n", primes(N));
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"primes: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @primes(i32 200000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ decimalDigit(char);
int decimalInt(char *value) {
  int ret;
  for (ret = 0; *value; value++) {
    ret *= 10;
    ret += decimalDigit(*value);
  }
  return ret;
}


x86 assembly (clang, -O0):
<decimalInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <decimalInt+0x51>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <decimalDigit@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <decimalInt+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimalInt>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%cl
test   %cl,%cl
je     114d <decimalInt+0x3d>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rax,%rax,4),%r14d
movsbl %cl,%edi
call   1030 <decimalDigit@plt>
lea    (%rax,%r14,2),%eax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <decimalInt+0x20>
jmp    114f <decimalInt+0x3f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @decimalInt(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 10
%9 = tail call i64 @decimalDigit(i8 signext %5)
%10 = trunc i64 %9 to i32
%11 = add i32 %8, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
/* Type definitions */
typedef int uint16_t;
struct p4_add_table_entry {
  int dummy;
};

/* Variables and functions */
struct p4_add_table_entry *unpack_p4_add_table_entry(char *buffer,
                                                     uint16_t offset) {
  return (struct p4_add_table_entry *)(buffer + offset);
}


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

x86 assembly (clang, -O2):
<unpack_p4_add_table_entry>:
movslq %esi,%rax
add    %rdi,%rax
ret

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

LLVM IR (-O2):
%struct.p4_add_table_entry = type { i32 }
define %struct.p4_add_table_entry* @unpack_p4_add_table_entry(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to %struct.p4_add_table_entry*
ret %struct.p4_add_table_entry* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct packet {
  int dummy;
};

/* Variables and functions */
int pdu_eth(struct packet *, int /*<<< orphan*/ const *,
            int /*<<< orphan*/ const *, int);
int pdu_eth_ipv6(struct packet *p, const uint8_t *dst_addr,
                 const uint8_t *src_addr) {
  return pdu_eth(p, dst_addr, src_addr, 0x86dd);
}


x86 assembly (clang, -O0):
<pdu_eth_ipv6>:
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
mov    $0x86dd,%ecx
call   1030 <pdu_eth@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_eth_ipv6>:
mov    $0x86dd,%ecx
jmp    1030 <pdu_eth@plt>

LLVM IR (-O0):
%struct.packet = type { i32 }
define i32 @pdu_eth_ipv6(%struct.packet* %0, i32* %1, i32* %2) {
%4 = alloca %struct.packet*
%5 = alloca i32*
%6 = alloca i32*
store %struct.packet* %0, %struct.packet** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load %struct.packet*, %struct.packet** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i32 @pdu_eth(%struct.packet* %7, i32* %8, i32* %9, i32 34525)
ret i32 %10
}

LLVM IR (-O2):
%struct.packet = type { i32 }
define i32 @pdu_eth_ipv6(%struct.packet* %0, i32* %1, i32* %2) {
%4 = tail call i32 @pdu_eth(%struct.packet* %0, i32* %1, i32* %2, i32 34525)
ret i32 %4
}
/* Variables and functions */
bool isApplicationAttachedToDebugger() { return false; }


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

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

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

LLVM IR (-O2):
define i32 @isApplicationAttachedToDebugger() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_dump_exploded_nodes(int /*<<< orphan*/);
int test_2(int a) {
  if (a != 42 && a != 113 && a != 666) {
    return (-2);
  }
  __analyzer_dump_exploded_nodes(0);
  return 0;
}


x86 assembly (clang, -O0):
<test_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2a,-0x8(%rbp)
je     1148 <test_2+0x38>
cmpl   $0x71,-0x8(%rbp)
je     1148 <test_2+0x38>
cmpl   $0x29a,-0x8(%rbp)
je     1148 <test_2+0x38>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1156 <test_2+0x46>
xor    %edi,%edi
call   1030 <__analyzer_dump_exploded_nodes@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_2>:
push   %rbx
cmp    $0x2a,%edi
je     1128 <test_2+0x18>
cmp    $0x29a,%edi
je     1128 <test_2+0x18>
mov    $0xfffffffe,%ebx
cmp    $0x71,%edi
jne    1131 <test_2+0x21>
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <__analyzer_dump_exploded_nodes@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 42
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 113
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 666
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 -2, i32* %2
br label %15
13: ; preds = %9, %6, %1
%14 = call i32 @__analyzer_dump_exploded_nodes(i32 0)
store i32 0, i32* %2
br label %15
15: ; preds = %13, %12
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_2(i32 %0) {
switch i32 %0, label %4 [
i32 666, label %2
i32 113, label %2
i32 42, label %2
]
2: ; preds = %1, %1, %1
%3 = tail call i32 @__analyzer_dump_exploded_nodes(i32 0)
br label %4
4: ; preds = %1, %2
%5 = phi i32 [ 0, %2 ], [ -2, %1 ]
ret i32 %5
}
/* Type definitions */
struct winsize {
  int ws_row;
};

/* Variables and functions */
int /*<<< orphan*/ TIOCGWINSZ;
int ioctl(int, int /*<<< orphan*/, struct winsize *);
int winhi(void) {
  struct winsize win;
  int rows = 24;
  if (ioctl(1, TIOCGWINSZ, &win) != -1 && win.ws_row > 0) {
    rows = win.ws_row;
  }
  return rows;
}


x86 assembly (clang, -O0):
<winhi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x18,-0xc(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
je     114f <winhi+0x3f>
cmpl   $0x0,-0x8(%rbp)
jle    114f <winhi+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<winhi>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x1,%edi
call   1030 <ioctl@plt>
mov    (%rsp),%ecx
test   %ecx,%ecx
mov    $0x18,%edx
cmovle %edx,%ecx
cmp    $0xffffffff,%eax
cmove  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
define i32 @winhi() {
%1 = alloca %struct.winsize
%2 = alloca i32
store i32 24, i32* %2
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 1, i32 %3, %struct.winsize* %1)
%5 = icmp ne i32 %4, -1
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %6, %0
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
define i32 @winhi() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 1, i32 %3, %struct.winsize* %1)
%5 = icmp ne i32 %4, -1
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = icmp sgt i32 %7, 0
%9 = select i1 %5, i1 %8, i1 false
%10 = select i1 %9, i32 %7, i32 24
ret i32 %10
}
/* Variables and functions */
bool nrf52_errata_39(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_39() {
ret i32 0
}
void swap(int *number1, int *number2) {
  int temp;
  temp = *number1;
  *number1 = *number2;
  *number2 = temp;
}


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

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void printd(unsigned char *data, int cnt) {
  if (cnt > 16)
    cnt = 16;
  while (cnt-- > 0) {
    printf(" %02x", *data);
    ++data;
  }
}


x86 assembly (clang, -O0):
<printd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jle    1130 <printd+0x20>
movl   $0x10,-0xc(%rbp)
jmp    1135 <printd+0x25>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    116d <printd+0x5d>
mov    -0x8(%rbp),%rax
lea    0xeac(%rip),%rdi
movzbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1135 <printd+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printd>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <printd+0x37>
mov    %rdi,%rbx
cmp    $0x10,%esi
mov    $0x10,%ebp
cmovb  %esi,%ebp
add    $0x1,%ebp
lea    0xed0(%rip),%r14
movzbl (%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <printd+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c" %02x\00"
define void @printd(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 = icmp sgt i32 %5, 16
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 16, i32* %4
br label %8
8: ; preds = %7, %2
br label %9
9: ; preds = %13, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %10, -1
store i32 %11, i32* %4
%12 = icmp sgt i32 %10, 0
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
br label %9
19: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" %02x\00"
define void @printd(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = icmp ult i32 %1, 16
%6 = select i1 %5, i32 %1, i32 16
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ %6, %4 ]
%9 = phi i8* [ %13, %7 ], [ %0, %4 ]
%10 = add nsw i32 %8, -1
%11 = load i8, i8* %9
%12 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %11)
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = icmp ugt i32 %8, 1
br i1 %14, label %7, label %15
15: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_unset_env_recorded() {
  printf("NOT IMPLEMENTED:"
         "pa_unset_env_recorded"
         "\n");
}


x86 assembly (clang, -O0):
<pa_unset_env_recorded>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_unset_env_recorded\0A\00"
define i32 @pa_unset_env_recorded() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_unset_env_recorded\00"
define i32 @pa_unset_env_recorded() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *parson_strndup(const char *string, size_t n) {
  char *output_string = (char *)malloc(n + 1);
  if (!output_string)
    return NULL;
  output_string[n] = '\0';
  strncpy(output_string, string, n);
  return output_string;
}


x86 assembly (clang, -O0):
<parson_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <parson_strndup+0x39>
movq   $0x0,-0x8(%rbp)
jmp    117e <parson_strndup+0x5e>
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   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parson_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1151 <parson_strndup+0x31>
mov    %rax,%rbx
movb   $0x0,(%rax,%r14,1)
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
jmp    1153 <parson_strndup+0x33>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @parson_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 i64, i64* %5
%8 = add i64 %7, 1
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %2
store i8* null, i8** %3
br label %23
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = load i64, i64* %5
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %6
%19 = load i8*, i8** %4
%20 = load i64, i64* %5
%21 = call i32 @strncpy(i8* %18, i8* %19, i64 %20)
%22 = load i8*, i8** %6
store i8* %22, i8** %3
br label %23
23: ; preds = %14, %13
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @parson_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %8
%9 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %1)
br label %10
10: ; preds = %2, %7
%11 = phi i8* [ %5, %7 ], [ null, %2 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printl(char *, char *);
void spin(char *func_name) {
  printl("\nspinning in %s ...\n", func_name);
  while (1) {
  }
}


x86 assembly (clang, -O0):
<spin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printl@plt>
jmp    112c <spin+0x1c>

x86 assembly (clang, -O2):
<spin>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printl@plt>
jmp    1120 <spin+0x10>

LLVM IR (-O0):
@.str = [21 x i8] c"\0Aspinning in %s ...\0A\00"
define void @spin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printl(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %5
5: ; preds = %1, %5
br label %5
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0Aspinning in %s ...\0A\00"
define void @spin(i8* %0) {
%2 = tail call i32 @printl(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %3
3: ; preds = %1, %3
br label %3
}
/* Type definitions */
struct sysinfo {
  size_t freeram;
  size_t bufferram;
  size_t sharedram;
};

/* Variables and functions */
int /*<<< orphan*/ sysinfo(struct sysinfo *);
size_t freeRAM() {
  struct sysinfo info;
  sysinfo(&info);
  return info.freeram + info.bufferram + info.sharedram;
}


x86 assembly (clang, -O0):
<freeRAM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
call   1030 <sysinfo@plt>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
add    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeRAM>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <sysinfo@plt>
mov    0x8(%rsp),%rax
add    (%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sysinfo = type { i64, i64, i64 }
define i64 @freeRAM() {
%1 = alloca %struct.sysinfo
%2 = call i32 @sysinfo(%struct.sysinfo* %1)
%3 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = add i64 %4, %6
%8 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 2
%9 = load i64, i64* %8
%10 = add i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.sysinfo = type { i64, i64, i64 }
define i64 @freeRAM() {
%1 = alloca %struct.sysinfo
%2 = bitcast %struct.sysinfo* %1 to i8*
%3 = call i32 @sysinfo(%struct.sysinfo* %1)
%4 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = add i64 %7, %5
%9 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 2
%10 = load i64, i64* %9
%11 = add i64 %8, %10
ret i64 %11
}
void foo_2_1_1_2_2_2_2_1_1() {}


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

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

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

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

/* Variables and functions */
__attribute__((always_)) uint32_t B_PASS32(uint32_t const x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @B_PASS32(i32 returned %0) {
ret i32 %0
}
void nseel_asm_assign_fast_fromfp_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_assign_fast_fromfp_end() {
ret void
}
int getSize(long palindrome) {
  int size = 0;
  do {
    size++;
  } while (palindrome /= 10);
  return size;
}


x86 assembly (clang, -O0):
<getSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    110f <getSize+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSize>:
xor    %ecx,%ecx
movabs $0x6666666666666667,%rsi
66 66 66
nopl   0x0(%rax)
add    $0x1,%ecx
mov    %rdi,%rax
imul   %rsi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
add    $0x9,%rdi
cmp    $0x12,%rdi
mov    %rdx,%rdi
ja     1110 <getSize+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getSize(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 0, %1 ], [ %5, %2 ]
%5 = add nuw nsw i32 %4, 1
%6 = sdiv i64 %3, 10
%7 = add i64 %3, 9
%8 = icmp ult i64 %7, 19
br i1 %8, label %9, label %2
9: ; preds = %2
ret i32 %5
}
int cycle_is_update_mcbase(unsigned int flags) {
  return (flags & 0x0e000000) == 0x06000000;
}


x86 assembly (clang, -O0):
<cycle_is_update_mcbase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xe000000,%eax
cmp    $0x6000000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_is_update_mcbase>:
and    $0xe000000,%edi
xor    %eax,%eax
cmp    $0x6000000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @cycle_is_update_mcbase(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 234881024
%5 = icmp eq i32 %4, 100663296
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @cycle_is_update_mcbase(i32 %0) {
%2 = and i32 %0, 234881024
%3 = icmp eq i32 %2, 100663296
%4 = zext i1 %3 to i32
ret i32 %4
}
int roof(int a, int b) { return ((((a) + (b)-1) / ((b) ? (b) : 1)) * (b)); }


x86 assembly (clang, -O0):
<roof>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112b <roof+0x2b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <roof+0x38>
mov    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <roof+0x38>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
cltd
idiv   %ecx
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roof>:
test   %esi,%esi
mov    $0x1,%ecx
cmovne %esi,%ecx
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %ecx
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @roof(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 = add nsw i32 %5, %6
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %4
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %11
%15 = phi i32 [ %12, %11 ], [ 1, %13 ]
%16 = sdiv i32 %8, %15
%17 = load i32, i32* %4
%18 = mul nsw i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @roof(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i32 1, i32 %1
%7 = sdiv i32 %4, %6
%8 = mul nsw i32 %7, %1
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *chizu_internal_strdup(const char *s) {
  size_t n = strlen(s);
  char *p = (char *)malloc(n + 1);
  if (p)
    strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<chizu_internal_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1172 <chizu_internal_strdup+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chizu_internal_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <chizu_internal_strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @chizu_internal_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
br label %17
17: ; preds = %13, %1
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
define i8* @chizu_internal_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ SIGSEGV;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int main(int ac, const char **av) {
  raise(SIGSEGV);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGSEGV = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @SIGSEGV
%7 = call i32 @raise(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@SIGSEGV = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @SIGSEGV
%4 = tail call i32 @raise(i32 %3)
ret i32 0
}
double dot_product(double *v1, double *v2) {
  double product;
  product = v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
  return product;
}


x86 assembly (clang, -O0):
<dot_product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_product>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dot_product(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fmul double %14, %17
%19 = call double @llvm.fmuladd.f64(double %8, double %11, double %18)
%20 = load double*, double** %3
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 2
%25 = load double, double* %24
%26 = call double @llvm.fmuladd.f64(double %22, double %25, double %19)
store double %26, double* %5
%27 = load double, double* %5
ret double %27
}

LLVM IR (-O2):
define double @dot_product(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
double exp(double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @exp(double returned %0) {
ret double %0
}
void UI_get_method(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_get_method() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _rethrow(void *);
void Cyc_Core_rethrow(void *e) { _rethrow(e); }


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

x86 assembly (clang, -O2):
<Cyc_Core_rethrow>:
jmp    1030 <_rethrow@plt>

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

LLVM IR (-O2):
define void @Cyc_Core_rethrow(i8* %0) {
%2 = tail call i32 @_rethrow(i8* %0)
ret void
}
void gdk_drag_begin() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drag_begin() {
ret void
}
void dma_flush_range(unsigned long start, unsigned long stop) {}


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

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

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

LLVM IR (-O2):
define void @dma_flush_range(i64 %0, i64 %1) {
ret void
}
void __register_frame_info(void *begin, void *ob) {}


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

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

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

LLVM IR (-O2):
define void @__register_frame_info(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ scanf(char *, int *, int *, int *, int *, int *);
void Input(int *up, int *down, int *left, int *right, int *pulse10ms) {
  if (scanf("%d %d %d %d %d", up, down, left, right, pulse10ms) == EOF) {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<Input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    0xea9(%rip),%rdi
call   1030 <scanf@plt>
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%rax
jne    1173 <Input+0x53>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Input>:
push   %rax
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xec9(%rip),%rdi
call   1030 <scanf@plt>
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%rax
je     114a <Input+0x2a>
pop    %rax
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%d %d %d %d %d\00"
@EOF = global i64 0
define void @Input(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i64 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %11, i32* %12, i32* %13, i32* %14, i32* %15)
%17 = load i64, i64* @EOF
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %5
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d %d %d %d %d\00"
@EOF = global i64 0
define void @Input(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i64 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *PrintHello(void *threadid) {
  int tid;
  tid = (int)threadid;
  printf("Hello World! Thread ID, %d\n", tid);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<PrintHello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHello>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Hello World! Thread ID, %d\0A\00"
define i8* @PrintHello(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @pthread_exit(i32* null)
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [28 x i8] c"Hello World! Thread ID, %d\0A\00"
define noalias i8* @PrintHello(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
int tnode_shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tnode_shutdown() {
ret i32 0
}