xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xa0() {
  Assert_real((islower(160) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              805, ("islower should be 0 for 0xa0"));
}


x86 assembly (clang, -O0):
<t_islower_0xa0>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa0,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x325,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0xa0>:
push   %rax
mov    $0xa0,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x325,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xa0\00"
define void @t_islower_0xa0() {
%1 = call i64 @islower(i32 160)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 805, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xa0\00"
define void @t_islower_0xa0() {
%1 = tail call i64 @islower(i32 160)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 805, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glIndexdv(int /*<<< orphan*/ *);
void Indexdv(GLdouble c[1]) { glIndexdv(c); }


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

x86 assembly (clang, -O2):
<Indexdv>:
jmp    1030 <glIndexdv@plt>

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

LLVM IR (-O2):
define void @Indexdv(i32* %0) {
%2 = tail call i32 @glIndexdv(i32* %0)
ret void
}
/* Variables and functions */
int smallest(int, int, int);
int smallest_bit(int, int, int);
int smallest_div(int, int, int);
int test_all_same() {
  return 5 == smallest(5, 5, 5) && 5 == smallest_div(5, 5, 5) &&
         5 == smallest_bit(5, 5, 5);
}


x86 assembly (clang, -O0):
<test_all_same>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1050 <smallest@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x5,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1199 <test_all_same+0x69>
mov    $0x5,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <smallest_div@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x5,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1199 <test_all_same+0x69>
mov    $0x5,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1040 <smallest_bit@plt>
mov    %eax,%ecx
mov    $0x5,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all_same>:
push   %rbx
mov    $0x5,%edi
mov    $0x5,%esi
mov    $0x5,%edx
call   1050 <smallest@plt>
xor    %ebx,%ebx
cmp    $0x5,%eax
jne    1181 <test_all_same+0x51>
mov    $0x5,%edi
mov    $0x5,%esi
mov    $0x5,%edx
call   1030 <smallest_div@plt>
cmp    $0x5,%eax
jne    1181 <test_all_same+0x51>
mov    $0x5,%edi
mov    $0x5,%esi
mov    $0x5,%edx
call   1040 <smallest_bit@plt>
xor    %ebx,%ebx
cmp    $0x5,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_all_same() {
%1 = call i32 @smallest(i32 5, i32 5, i32 5)
%2 = icmp eq i32 5, %1
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i32 @smallest_div(i32 5, i32 5, i32 5)
%5 = icmp eq i32 5, %4
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i32 @smallest_bit(i32 5, i32 5, i32 5)
%8 = icmp eq i32 5, %7
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ false, %3 ], [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_all_same() {
%1 = tail call i32 @smallest(i32 5, i32 5, i32 5)
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i32 @smallest_div(i32 5, i32 5, i32 5)
%5 = icmp eq i32 %4, 5
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @smallest_bit(i32 5, i32 5, i32 5)
%8 = icmp eq i32 %7, 5
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 0, %3 ], [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ MON_2;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_mon_2() { return nl_langinfo(MON_2); }


x86 assembly (clang, -O0):
<langinfo_mon_2>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_mon_2>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@MON_2 = global i32 0
define i8* @langinfo_mon_2() {
%1 = load i32, i32* @MON_2
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@MON_2 = global i32 0
define i8* @langinfo_mon_2() {
%1 = load i32, i32* @MON_2
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
void ff_hevc_put_hevc_epel_h8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h8_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void greet(const char *who) { printf("Hi, %s\n", who); }


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

x86 assembly (clang, -O2):
<greet>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"Hi, %s\0A\00"
define void @greet(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wait(int *);
void WpeSignalChild(int sig) {
  int statloc;
  wait(&statloc);
}


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

x86 assembly (clang, -O2):
<WpeSignalChild>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <wait@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @WpeSignalChild(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @wait(i32* %2)
ret void
}
int isPalindrome(int x) {
  int rem, temp, ans;
  ans = 0;
  temp = x;
  while (temp != 0) {
    rem = temp % 10;
    temp = temp / 10;
    ans = ans * 10 + rem;
  }
  if (ans == x)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isPalindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1149 <isPalindrome+0x49>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
imul   $0xa,-0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <isPalindrome+0x14>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1161 <isPalindrome+0x61>
movl   $0x1,-0x4(%rbp)
jmp    1168 <isPalindrome+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindrome>:
xor    %r8d,%r8d
test   %edi,%edi
je     1141 <isPalindrome+0x41>
mov    %edi,%eax
nopl   0x0(%rax)
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rax
add    %esi,%eax
lea    (%rax,%rax,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %ecx,%edx
sub    %esi,%edx
lea    (%r8,%r8,4),%esi
lea    (%rdx,%rsi,2),%r8d
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <isPalindrome+0x10>
xor    %eax,%eax
cmp    %edi,%r8d
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isPalindrome(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = sdiv i32 %5, 10
%8 = mul nsw i32 %4, 10
%9 = add nsw i32 %8, %6
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
%14 = icmp eq i32 %13, %0
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void __attribute__((__section__("mlocked_text")))
stress_badhandler(int signum) {
  (void)signum;
  _exit(1);
}


x86 assembly (clang, -O0):
<stress_badhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<stress_badhandler>:
push   %rax
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @stress_badhandler(i32 %0) section "mlocked_text" {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @stress_badhandler(i32 %0) section "mlocked_text" {
%2 = tail call i32 @_exit(i32 1)
unreachable
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  {
    state[0UL] = (input[0UL] & 914778474UL) << 7U;
    if ((state[0UL] >> 1U) & 1U) {
      state[0UL] >>= ((state[0UL] >> 1U) & 7U) | 1UL;
    } else {
      state[0UL] >>= ((state[0UL] >> 4U) & 7U) | 1UL;
    }
    output[0UL] = state[0UL] << 3U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x3686696a,%rax
shl    $0x7,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x1,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114f <RandomFunc+0x4f>
mov    -0x14(%rbp),%eax
shr    $0x1,%eax
and    $0x7,%eax
mov    %eax,%eax
mov    %eax,%ecx
or     $0x1,%rcx
mov    -0x14(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x14(%rbp)
jmp    1168 <RandomFunc+0x68>
mov    -0x14(%rbp),%eax
shr    $0x4,%eax
and    $0x7,%eax
mov    %eax,%eax
mov    %eax,%ecx
or     $0x1,%rcx
mov    -0x14(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
shl    $0x9,%eax
and    $0xcd2d400,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = zext i32 %8 to i64
%10 = and i64 %9, 914778474
%11 = shl i64 %10, 7
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %12, i32* %13
%14 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%15 = load i32, i32* %14
%16 = lshr i32 %15, 1
%17 = and i32 %16, 1
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %30
19: ; preds = %2
%20 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%21 = load i32, i32* %20
%22 = lshr i32 %21, 1
%23 = and i32 %22, 7
%24 = zext i32 %23 to i64
%25 = or i64 %24, 1
%26 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%27 = load i32, i32* %26
%28 = trunc i64 %25 to i32
%29 = lshr i32 %27, %28
store i32 %29, i32* %26
br label %41
30: ; preds = %2
%31 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%32 = load i32, i32* %31
%33 = lshr i32 %32, 4
%34 = and i32 %33, 7
%35 = zext i32 %34 to i64
%36 = or i64 %35, 1
%37 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%38 = load i32, i32* %37
%39 = trunc i64 %36 to i32
%40 = lshr i32 %38, %39
store i32 %40, i32* %37
br label %41
41: ; preds = %30, %19
%42 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%43 = load i32, i32* %42
%44 = shl i32 %43, 3
%45 = load i32*, i32** %4
%46 = getelementptr inbounds i32, i32* %45, i64 0
store i32 %44, i32* %46
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 9
%5 = and i32 %4, 215143424
store i32 %5, i32* %1
ret void
}
int test_imm_FDuint8_mem(unsigned char *val) {
  return ((*val) & (0xFD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FDuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 253
%7 = icmp ne i32 %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_FDuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -3
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, char *);
void printError(char *str, char *fileName, int lineNum) {
  printf("Error in file %s, line %d: %s\n\r", fileName, lineNum, str);
}


x86 assembly (clang, -O0):
<printError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printError>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Error in file %s, line %d: %s\0A\0D\00"
define void @printError(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Error in file %s, line %d: %s\0A\0D\00"
define void @printError(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CallBack0(int);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
void HistoryDelete(void) {
  if (!CheckRunningInMainThread("HistoryDelete"))
    return;
  CallBack0(102 + 512);
}


x86 assembly (clang, -O0):
<HistoryDelete>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    113e <HistoryDelete+0x1e>
jmp    1148 <HistoryDelete+0x28>
mov    $0x266,%edi
call   1040 <CallBack0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HistoryDelete>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     113c <HistoryDelete+0x1c>
mov    $0x266,%edi
pop    %rax
jmp    1040 <CallBack0@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"HistoryDelete\00"
define void @HistoryDelete() {
%1 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @CallBack0(i32 614)
br label %5
5: ; preds = %0, %3
ret void
}
double calculation(double num1, double num2) {
  return (num1 - num2) / (num1 * num2);
}


x86 assembly (clang, -O0):
<calculation>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculation>:
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @calculation(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = load double, double* %3
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = fdiv double %7, %10
ret double %11
}

LLVM IR (-O2):
define double @calculation(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fmul double %0, %1
%5 = fdiv double %3, %4
ret double %5
}
/* Variables and functions */
char *strchr(char *, char);
char *strdup(char *);
void strsplit7(char *string, char sep, char **first, char **second) {
  char *copy = strdup(string);
  char *sep_ptr = strchr(copy, sep);
  *sep_ptr = '\0';
  *first = copy;
  *second = sep_ptr + 1;
}


x86 assembly (clang, -O0):
<strsplit7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rcx
add    $0x1,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsplit7>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
movb   $0x0,(%rax)
mov    %rbx,(%r15)
add    $0x1,%rax
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @strsplit7(i8* %0, i8 signext %1, i8** %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %5
store i8 %1, i8* %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%11 = load i8*, i8** %5
%12 = call i8* @strdup(i8* %11)
store i8* %12, i8** %9
%13 = load i8*, i8** %9
%14 = load i8, i8* %6
%15 = call i8* @strchr(i8* %13, i8 signext %14)
store i8* %15, i8** %10
%16 = load i8*, i8** %10
store i8 0, i8* %16
%17 = load i8*, i8** %9
%18 = load i8**, i8*** %7
store i8* %17, i8** %18
%19 = load i8*, i8** %10
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = load i8**, i8*** %8
store i8* %20, i8** %21
ret void
}

LLVM IR (-O2):
define void @strsplit7(i8* nocapture %0, i8 signext %1, i8** nocapture writeonly %2, i8** nocapture writeonly %3) {
%5 = tail call i8* @strdup(i8* %0)
%6 = tail call i8* @strchr(i8* dereferenceable(1) %5, i8 signext %1)
store i8 0, i8* %6
store i8* %5, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %3
ret void
}
int conjunctionValue(int x, int y) { return x & y; }


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

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

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

LLVM IR (-O2):
define i32 @conjunctionValue(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Variables and functions */
char const *strrchr(char const *, char);
const char *getName(const char *path) { return strrchr(path, '/') + 1; }


x86 assembly (clang, -O0):
<getName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getName>:
push   %rax
mov    $0x2f,%esi
call   1030 <strrchr@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @getName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strrchr(i8* %3, i8 signext 47)
%5 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %5
}

LLVM IR (-O2):
define i8* @getName(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = getelementptr inbounds i8, i8* %2, i64 1
ret i8* %3
}
void PKCS7_SIGNER_INFO_free(void) {}


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

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

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

LLVM IR (-O2):
define void @PKCS7_SIGNER_INFO_free() {
ret void
}
signed int fci_hpi_init(void *handle, signed int speed, signed int slaveaddr) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @fci_hpi_init(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int set_error(int);
int cgio_configure(int what, void *value) {
  int ierr = -13;
  if (what > 200) {
  }
  return set_error(ierr);
}


x86 assembly (clang, -O0):
<cgio_configure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xfffffff3,-0x14(%rbp)
cmpl   $0xc8,-0x4(%rbp)
jle    1138 <cgio_configure+0x28>
jmp    1138 <cgio_configure+0x28>
mov    -0x14(%rbp),%edi
call   1030 <set_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgio_configure>:
mov    $0xfffffff3,%edi
jmp    1030 <set_error@plt>

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

LLVM IR (-O2):
define i32 @cgio_configure(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @set_error(i32 -13)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void imprimirASCII() {
  int o = 0;
  do {
    printf("%d %c \n", o, o);
    o++;
  } while (o <= 255);
}


x86 assembly (clang, -O0):
<imprimirASCII>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    111f <imprimirASCII+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimirASCII>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <imprimirASCII+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d %c \0A\00"
define void @imprimirASCII() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
int isPrime(int n) {
  if (n == 2)
    return 1;
  if (n == 1)
    return 0;
  for (int i = 2; i < n; i++) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    111d <isPrime+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    117c <isPrime+0x7c>
cmpl   $0x1,-0x8(%rbp)
jne    1133 <isPrime+0x33>
movl   $0x0,-0x4(%rbp)
jmp    117c <isPrime+0x7c>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1175 <isPrime+0x75>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1162 <isPrime+0x62>
movl   $0x0,-0x4(%rbp)
jmp    117c <isPrime+0x7c>
jmp    1167 <isPrime+0x67>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <isPrime+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
cmp    $0x1,%edi
je     113a <isPrime+0x3a>
mov    $0x1,%eax
cmp    $0x2,%edi
je     1139 <isPrime+0x39>
jle    1139 <isPrime+0x39>
xor    %eax,%eax
test   $0x1,%dil
je     1139 <isPrime+0x39>
mov    $0x3,%eax
xchg   %ax,%ax
mov    %eax,%ecx
cmp    %eax,%edi
je     1132 <isPrime+0x32>
mov    %edi,%eax
cltd
idiv   %ecx
lea    0x1(%rcx),%eax
test   %edx,%edx
jne    1120 <isPrime+0x20>
xor    %eax,%eax
cmp    %edi,%ecx
setge  %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPrime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %28
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 0, i32* %2
br label %28
12: ; preds = %8
store i32 2, i32* %4
br label %13
13: ; preds = %24, %12
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %27
17: ; preds = %13
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %17
store i32 0, i32* %2
br label %28
23: ; preds = %17
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %13
27: ; preds = %13
store i32 1, i32* %2
br label %28
28: ; preds = %27, %22, %11, %7
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
switch i32 %0, label %2 [
i32 2, label %18
i32 1, label %7
]
2: ; preds = %1
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = and i32 %0, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %18, label %8
7: ; preds = %1
br label %18
8: ; preds = %4, %11
%9 = phi i32 [ %14, %11 ], [ 3, %4 ]
%10 = icmp eq i32 %9, %0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = srem i32 %0, %9
%13 = icmp eq i32 %12, 0
%14 = add nuw nsw i32 %9, 1
br i1 %13, label %15, label %8
15: ; preds = %8, %11
%16 = icmp sge i32 %9, %0
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %2, %4, %15, %1, %7
%19 = phi i32 [ 0, %7 ], [ 1, %1 ], [ 1, %2 ], [ 0, %4 ], [ %17, %15 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int udpclient(char *, int);
int lancer_connect(char *host, int port) {
  printf("Lancer Connected %d\n", port);
  return udpclient(host, port);
}


x86 assembly (clang, -O0):
<lancer_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <udpclient@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lancer_connect>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <udpclient@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Lancer Connected %d\0A\00"
define i32 @lancer_connect(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 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @udpclient(i8* %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [21 x i8] c"Lancer Connected %d\0A\00"
define i32 @lancer_connect(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @udpclient(i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ nucomp_canonicalization(int);
void Init_complex(void) { nucomp_canonicalization(1); }


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

x86 assembly (clang, -O2):
<Init_complex>:
mov    $0x1,%edi
jmp    1030 <nucomp_canonicalization@plt>

LLVM IR (-O0):
define void @Init_complex() {
%1 = call i32 @nucomp_canonicalization(i32 1)
ret void
}

LLVM IR (-O2):
define void @Init_complex() {
%1 = tail call i32 @nucomp_canonicalization(i32 1)
ret void
}
void int2be(unsigned int val, unsigned char *addr) {
  addr[0] = (val >> 24) & 0xff;
  addr[1] = (val >> 16) & 0xff;
  addr[2] = (val >> 8) & 0xff;
  addr[3] = val & 0xFF;
}


x86 assembly (clang, -O0):
<int2be>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2be>:
bswap  %edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @int2be(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = lshr i32 %5, 24
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %3
%12 = lshr i32 %11, 16
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %3
%18 = lshr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i32, i32* %3
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @int2be(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %0, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %0 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
void ThreadSemaphoreIncrease(int count) {}


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

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

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

LLVM IR (-O2):
define void @ThreadSemaphoreIncrease(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int asn1_parse2(int /*<<< orphan*/ *, unsigned char const **, long,
                int /*<<< orphan*/, int /*<<< orphan*/, int,
                int /*<<< orphan*/);
int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent) {
  return (asn1_parse2(bp, &pp, len, 0, 0, indent, 0));
}


x86 assembly (clang, -O0):
<ASN1_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r9d
lea    -0x10(%rbp),%rsi
xor    %r8d,%r8d
mov    %r8d,%ecx
movl   $0x0,(%rsp)
call   1030 <asn1_parse2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_parse>:
sub    $0x18,%rsp
mov    %ecx,%r9d
mov    %rsi,0x10(%rsp)
movl   $0x0,(%rsp)
lea    0x10(%rsp),%rsi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <asn1_parse2@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @ASN1_parse(i32* %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i8*
store i8* %1, i8** %5
%6 = call i32 @asn1_parse2(i32* %0, i8** %5, i64 %2, i32 0, i32 0, i32 %3, i32 0)
ret i32 %6
}
unsigned long hasher31(char *str) {
  unsigned long hash = 5381;
  int tmp = 0;
  while ((tmp = *str++)) {
    hash = ((hash << 5) + hash) + tmp;
  }
  return hash % (0x2000);
}


x86 assembly (clang, -O0):
<hasher31>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1151 <hasher31+0x51>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <hasher31+0x17>
mov    -0x10(%rbp),%rax
and    $0x1fff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasher31>:
mov    (%rdi),%cl
test   %cl,%cl
je     1132 <hasher31+0x32>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hasher31+0x10>
and    $0x1fff,%eax
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hasher31(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = mul i64 %6, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i64 %11, 8191
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 5381, %1 ], [ %15, %14 ]
ret i64 %17
}
int test_imm_98uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x98 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_98uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 152
%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_98uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9961472
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int s2e_open(const char *fname) {
  int fd;
  __s2e_touch_string(fname);
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, 0xEE, 0x00, 0x00\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n"
                       : "=a"(fd)
                       : "a"(-1), "b"(fname), "c"(0));
  return fd;
}


x86 assembly (clang, -O0):
<s2e_open>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <__s2e_touch_string@plt>
mov    -0x10(%rbp),%rbx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
(bad)
add    %ch,%dh
add    %al,(%rax)
add    %al,(%rax)
add    %al,(%rax)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2e_open>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__s2e_touch_string@plt>
mov    $0xffffffff,%eax
xor    %ecx,%ecx
(bad)
add    %ch,%dh
add    %al,(%rax)
add    %al,(%rax)
add    %al,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @s2e_open(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @__s2e_touch_string to i32 (i8*, ...)*)(i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0xEE, 0x00, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "={ax},{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 -1, i8* %6, i32 0)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @s2e_open(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @__s2e_touch_string to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0xEE, 0x00, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "={ax},{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 -1, i8* %0, i32 0)
ret i32 %3
}
void i2s_ASN1_INTEGER(void) {}


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

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

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

LLVM IR (-O2):
define void @i2s_ASN1_INTEGER() {
ret void
}
int stbi__bitreverse16(int n) {
  n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1);
  n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2);
  n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4);
  n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8);
  return n;
}


x86 assembly (clang, -O0):
<stbi__bitreverse16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaaaa,%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x5555,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xcccc,%eax
sar    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0x3333,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0,%eax
sar    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0xf0f,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi__bitreverse16>:
rol    $0x8,%di
mov    %edi,%eax
and    $0xf0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x3333,%eax
shr    $0x2,%edi
and    $0x3333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x5555,%ecx
shr    %eax
and    $0x5555,%eax
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @stbi__bitreverse16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 43690
%5 = ashr i32 %4, 1
%6 = load i32, i32* %2
%7 = and i32 %6, 21845
%8 = shl i32 %7, 1
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, 52428
%12 = ashr i32 %11, 2
%13 = load i32, i32* %2
%14 = and i32 %13, 13107
%15 = shl i32 %14, 2
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = and i32 %17, 61680
%19 = ashr i32 %18, 4
%20 = load i32, i32* %2
%21 = and i32 %20, 3855
%22 = shl i32 %21, 4
%23 = or i32 %19, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = and i32 %24, 65280
%26 = ashr i32 %25, 8
%27 = load i32, i32* %2
%28 = and i32 %27, 255
%29 = shl i32 %28, 8
%30 = or i32 %26, %29
store i32 %30, i32* %2
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @stbi__bitreverse16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bitreverse.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
void pthread_cond_wait() {}


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

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

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

LLVM IR (-O2):
define void @pthread_cond_wait() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: spw303v [-i <inputfile>] [-o <outputfile>]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: spw303v [-i <inputfile>] [-o <outputfile>]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: spw303v [-i <inputfile>] [-o <outputfile>]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}