xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ my_sleep(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, ...);
int /*<<< orphan*/ pthread_self();
void sig_int(int signo) {
  printf("[%lu] caught %d\n", pthread_self(), signo);
  my_sleep(5);
  printf("[%lu] wake from sleep in signal handler\n", pthread_self());
}


x86 assembly (clang, -O0):
<sig_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x5,%edi
call   1050 <my_sleep@plt>
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_int>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x5,%edi
call   1050 <my_sleep@plt>
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"[%lu] caught %d\0A\00"
@.str.1 = [41 x i8] c"[%lu] wake from sleep in signal handler\0A\00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pthread_self()
%4 = load i32, i32* %2
%5 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = call i32 @my_sleep(i32 5)
%7 = call i32 (...) @pthread_self()
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"[%lu] caught %d\0A\00"
@.str.1 = [41 x i8] c"[%lu] wake from sleep in signal handler\0A\00"
define void @sig_int(i32 %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
%4 = tail call i32 @my_sleep(i32 5)
%5 = tail call i32 (...) @pthread_self()
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ makeUINT64(int /*<<< orphan*/, int /*<<< orphan*/);
uint64_t *make2UINT64s(uint32_t upper1, uint32_t lower1, uint32_t upper2,
                       uint32_t lower2, uint64_t dest[2]) {
  dest[0] = makeUINT64(upper1, lower1);
  dest[1] = makeUINT64(upper2, lower2);
  return dest;
}


x86 assembly (clang, -O0):
<make2UINT64s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <makeUINT64@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <makeUINT64@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make2UINT64s>:
push   %rbp
push   %r14
push   %rbx
mov    %r8,%rbx
mov    %ecx,%r14d
mov    %edx,%ebp
call   1030 <makeUINT64@plt>
mov    %eax,(%rbx)
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <makeUINT64@plt>
mov    %eax,0x4(%rbx)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32* @make2UINT64s(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 = call i32 @makeUINT64(i32 %11, i32 %12)
%14 = load i32*, i32** %10
%15 = getelementptr inbounds i32, i32* %14, i64 0
store i32 %13, i32* %15
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = call i32 @makeUINT64(i32 %16, i32 %17)
%19 = load i32*, i32** %10
%20 = getelementptr inbounds i32, i32* %19, i64 1
store i32 %18, i32* %20
%21 = load i32*, i32** %10
ret i32* %21
}

LLVM IR (-O2):
define i32* @make2UINT64s(i32 %0, i32 %1, i32 %2, i32 %3, i32* returned writeonly %4) {
%6 = tail call i32 @makeUINT64(i32 %0, i32 %1)
store i32 %6, i32* %4
%7 = tail call i32 @makeUINT64(i32 %2, i32 %3)
%8 = getelementptr inbounds i32, i32* %4, i64 1
store i32 %7, i32* %8
ret i32* %4
}
void addone(int *n) { (*n)++; }


x86 assembly (clang, -O0):
<addone>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addone>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @addone(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
const char *LABEL() { return "Some text"; }


x86 assembly (clang, -O0):
<LABEL>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LABEL>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Some text\00"
define i8* @LABEL() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"Some text\00"
define i8* @LABEL() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
void fstat() {}


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

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

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

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

/* Variables and functions */
__attribute__((always_)) uint32_t detexPack32R16(uint32_t r16) { return r16; }


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

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

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

LLVM IR (-O2):
define i32 @detexPack32R16(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ strlcpy(char *, char *, int);
int main(int argc, char **argv) {
  strlcpy(argv[0], argv[1], 10);
  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    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    $0xa,%edx
call   1030 <strlcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
mov    0x8(%rsi),%rsi
mov    $0xa,%edx
call   1030 <strlcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strlcpy(i8* %8, i8* %11, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @strlcpy(i8* %3, i8* %5, i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_outb(unsigned char, int);
void main(void) {
  const char *str;
  unsigned char ch;
  str = "one\r\n";
  while ((ch = *str++) != '\0') {
    __builtin_outb(ch, 0x3f0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl %al,%eax
cmp    $0x0,%eax
je     1156 <main+0x46>
mov    $0x3f0,%esi
movzbl -0x9(%rbp),%edi
call   1030 <__builtin_outb@plt>
jmp    1123 <main+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6f,%edi
mov    $0x3f0,%esi
call   1030 <__builtin_outb@plt>
mov    $0x6e,%edi
mov    $0x3f0,%esi
call   1030 <__builtin_outb@plt>
mov    $0x65,%edi
mov    $0x3f0,%esi
call   1030 <__builtin_outb@plt>
mov    $0xd,%edi
mov    $0x3f0,%esi
call   1030 <__builtin_outb@plt>
mov    $0xa,%edi
mov    $0x3f0,%esi
pop    %rax
jmp    1030 <__builtin_outb@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @__builtin_outb(i8 zeroext 111, i32 1008)
%2 = tail call i32 @__builtin_outb(i8 zeroext 110, i32 1008)
%3 = tail call i32 @__builtin_outb(i8 zeroext 101, i32 1008)
%4 = tail call i32 @__builtin_outb(i8 zeroext 13, i32 1008)
%5 = tail call i32 @__builtin_outb(i8 zeroext 10, i32 1008)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addToSolutionList(int **);
int /*<<< orphan*/ fillRow(int, int **);
int /*<<< orphan*/ writePosition(int, int, int **);
void fillPosition(int row, int col, int **chessboard) {
  writePosition(row, col, chessboard);
  if (row == 7) {
    addToSolutionList(chessboard);
  } else {
    fillRow(row + 1, chessboard);
  }
}


x86 assembly (clang, -O0):
<fillPosition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <writePosition@plt>
cmpl   $0x7,-0x4(%rbp)
jne    1169 <fillPosition+0x39>
mov    -0x10(%rbp),%rdi
call   1050 <addToSolutionList@plt>
jmp    1178 <fillPosition+0x48>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1040 <fillRow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillPosition>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %edi,%ebp
call   1030 <writePosition@plt>
cmp    $0x7,%ebp
jne    1150 <fillPosition+0x20>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <addToSolutionList@plt>
add    $0x1,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fillRow@plt>

LLVM IR (-O0):
define void @fillPosition(i32 %0, i32 %1, i32** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32** %2, i32*** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32**, i32*** %6
%10 = call i32 @writePosition(i32 %7, i32 %8, i32** %9)
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 7
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i32**, i32*** %6
%15 = call i32 @addToSolutionList(i32** %14)
br label %21
16: ; preds = %3
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
%19 = load i32**, i32*** %6
%20 = call i32 @fillRow(i32 %18, i32** %19)
br label %21
21: ; preds = %16, %13
ret void
}

LLVM IR (-O2):
define void @fillPosition(i32 %0, i32 %1, i32** %2) {
%4 = tail call i32 @writePosition(i32 %0, i32 %1, i32** %2)
%5 = icmp eq i32 %0, 7
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @addToSolutionList(i32** %2)
br label %11
8: ; preds = %3
%9 = add nsw i32 %0, 1
%10 = tail call i32 @fillRow(i32 %9, i32** %2)
br label %11
11: ; preds = %8, %6
ret void
}
/* Variables and functions */
int cfe_writeblk(int, int /*<<< orphan*/, unsigned char *, int);
int cfe_write(int handle, unsigned char *buffer, int length) {
  return cfe_writeblk(handle, 0, buffer, length);
}


x86 assembly (clang, -O0):
<cfe_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %esi,%esi
call   1030 <cfe_writeblk@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfe_write>:
mov    %edx,%ecx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <cfe_writeblk@plt>

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

LLVM IR (-O2):
define i32 @cfe_write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @cfe_writeblk(i32 %0, i32 0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
scalar_t__ isspace(char);
int getbool(char *start) {
  while (isspace(*start))
    ++start;
  if (*start == 'T' || *start == 't')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<getbool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <getbool+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <getbool+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x54,%eax
je     1163 <getbool+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x74,%eax
jne    116f <getbool+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    1176 <getbool+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbool>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <isspace@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <getbool+0x10>
mov    -0x1(%rbx),%cl
and    $0xdf,%cl
xor    %eax,%eax
cmp    $0x54,%cl
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getbool(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = load i8, i8* %3
%10 = and i8 %9, -33
%11 = icmp eq i8 %10, 84
%12 = zext i1 %11 to i32
ret i32 %12
}
long double test_nearbyintl(long double x) { return __builtin_nearbyintl(x); }


x86 assembly (clang, -O0):
<test_nearbyintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <nearbyintl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nearbyintl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <nearbyintl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @test_nearbyintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @llvm.nearbyint.f80(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @test_nearbyintl(x86_fp80 %0) {
%2 = tail call x86_fp80 @llvm.nearbyint.f80(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int _stat(const char *path, struct stat *buf) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @_stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @_stat(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1) {
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ convert();
int main() {
  convert();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <convert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <convert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @convert()
ret i32 0
}
int thumb_rel_count_regs_in_map(int map) {
  int c;
  for (c = 0; map != 0; ++c)
    map &= map - 1;
  return c;
}


x86 assembly (clang, -O0):
<thumb_rel_count_regs_in_map>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <thumb_rel_count_regs_in_map+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <thumb_rel_count_regs_in_map+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<thumb_rel_count_regs_in_map>:
xor    %eax,%eax
test   %edi,%edi
je     111c <thumb_rel_count_regs_in_map+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <thumb_rel_count_regs_in_map+0x10>
ret

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

LLVM IR (-O2):
define i32 @thumb_rel_count_regs_in_map(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
int find_int_key_in_list(void *data, void *needle) {
  return (*(int *)data) == (*(int *)needle) ? 1 : 0;
}


x86 assembly (clang, -O0):
<find_int_key_in_list>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_int_key_in_list>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @find_int_key_in_list(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @find_int_key_in_list(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 eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int test_imm_12uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x12 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_12uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 18
%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_12uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 77309411328
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int Min2(int a, int b) {
  if (b < a)
    return b;
  else
    return a;
}


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

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

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

LLVM IR (-O2):
define i32 @Min2(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
struct mfx_option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char **, char const *, struct mfx_option const *,
                     int *, int /*<<< orphan*/);
int mfx_getopt(int argc, char **argv, const char *optstring) {
  return _getopt_internal(argc, argv, optstring, (const struct mfx_option *)0,
                          (int *)0, 0);
}


x86 assembly (clang, -O0):
<mfx_getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
call   1030 <_getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfx_getopt>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.mfx_option = type { i32 }
define i32 @mfx_getopt(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %6
%10 = call i32 @_getopt_internal(i32 %7, i8** %8, i8* %9, %struct.mfx_option* null, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.mfx_option = type { i32 }
define i32 @mfx_getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.mfx_option* null, i32* null, i32 0)
ret i32 %4
}
void lendian2byte(unsigned int a, unsigned char *b) {
  b[0] = a;
  b[1] = a >> 8;
  b[2] = a >> 16;
  b[3] = a >> 24;
}


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

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

LLVM IR (-O0):
define void @lendian2byte(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 = trunc i32 %5 to i8
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i32, i32* %3
%10 = lshr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
%14 = load i32, i32* %3
%15 = lshr i32 %14, 16
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8 %16, i8* %18
%19 = load i32, i32* %3
%20 = lshr i32 %19, 24
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 3
store i8 %21, i8* %23
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @returni() {
ret void
}
unsigned long sdbm_hash(const char *str) {
  unsigned long hash;
  int c;
  hash = 0;
  while ((c = (unsigned char)*str++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<sdbm_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1155 <sdbm_hash+0x55>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <sdbm_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdbm_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <sdbm_hash+0x29>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <sdbm_hash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @sdbm_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i8* %0, i8** %2
store i64 0, i64* %3
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 = zext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %5
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = load i64, i64* %3
%15 = shl i64 %14, 6
%16 = add i64 %13, %15
%17 = load i64, i64* %3
%18 = shl i64 %17, 16
%19 = add i64 %16, %18
%20 = load i64, i64* %3
%21 = sub i64 %19, %20
store i64 %21, i64* %3
br label %5
22: ; preds = %5
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @sdbm_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = zext i8 %5 to i64
%10 = mul i64 %7, 65599
%11 = add i64 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t lv2_atom_pad_size(uint32_t size) { return (size + 7U) & (~7U); }


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

x86 assembly (clang, -O2):
<lv2_atom_pad_size>:
lea    0x7(%rdi),%eax
and    $0xfffffff8,%eax
ret

LLVM IR (-O0):
define i32 @lv2_atom_pad_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 7
%5 = and i32 %4, -8
ret i32 %5
}

LLVM IR (-O2):
define i32 @lv2_atom_pad_size(i32 %0) {
%2 = add i32 %0, 7
%3 = and i32 %2, -8
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
void C67_STW_SP_A0(int r) { C67_asm("STW.D *+SP[A0]", r, 0, 0); }


x86 assembly (clang, -O0):
<C67_STW_SP_A0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_STW_SP_A0>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"STW.D *+SP[A0]\00"
define void @C67_STW_SP_A0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @C67_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"STW.D *+SP[A0]\00"
define void @C67_STW_SP_A0(i32 %0) {
%2 = tail call i32 @C67_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
float cos(float);
float Sine__easeIn(float t, float b, float c, float d, float p0, float p1) {
  return -c * cos(t / d * (3.1415926535897932384626433832795 / 2)) + c + b;
}


x86 assembly (clang, -O0):
<Sine__easeIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9d(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm2
movss  -0x1c(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
addss  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sine__easeIn>:
push   %rax
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
divss  %xmm3,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xed4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <cos@plt>
movss  (%rsp),%xmm1
mulss  %xmm1,%xmm0
subss  %xmm0,%xmm1
addss  0x4(%rsp),%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Sine__easeIn(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %9
%14 = fneg float %13
%15 = load float, float* %7
%16 = load float, float* %10
%17 = fdiv float %15, %16
%18 = fpext float %17 to double
%19 = fmul double %18, 0x3FF921FB54442D18
%20 = fptrunc double %19 to float
%21 = call float @cos(float %20)
%22 = load float, float* %9
%23 = call float @llvm.fmuladd.f32(float %14, float %21, float %22)
%24 = load float, float* %8
%25 = fadd float %23, %24
ret float %25
}

LLVM IR (-O2):
define float @Sine__easeIn(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fneg float %2
%8 = fdiv float %0, %3
%9 = fpext float %8 to double
%10 = fmul double %9, 0x3FF921FB54442D18
%11 = fptrunc double %10 to float
%12 = tail call float @cos(float %11)
%13 = tail call float @llvm.fmuladd.f32(float %7, float %12, float %2)
%14 = fadd float %13, %1
ret float %14
}
int test_imm_A6int32_reg(int val) { return ((val) & (0xA6 << 0)) ? -20 : -40; }


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

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

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

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

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
unsigned int read2LE(FILE *fp) {
  unsigned int val;
  val = getc(fp);
  val |= getc(fp) << 8;
  return val;
}


x86 assembly (clang, -O0):
<read2LE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read2LE>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read2LE(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = call i32 @getc(i32* %6)
%8 = shl i32 %7, 8
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @read2LE(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
ret i32 %5
}
int reuse_set_binary_stdout(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @reuse_set_binary_stdout() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *ret;
  ret = strdup(s);
  if (!ret)
    perror("strdup");
  return (ret);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xstrdup+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <perror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1133 <xstrdup+0x13>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xec6(%rip),%rdi
call   1030 <perror@plt>
jmp    112e <xstrdup+0xe>

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

LLVM IR (-O2):
@.str = [7 x i8] c"strdup\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int fibo1(int);
int main() {
  int x = 10;
  int result = fibo1(x);
  if (result != 55) {
    __VERIFIER_error();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fibo1@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x37,-0xc(%rbp)
je     1152 <main+0x32>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <fibo1@plt>
cmp    $0x37,%eax
je     1137 <main+0x17>
xor    %eax,%eax
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fibo1(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 55
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @__VERIFIER_error()
br label %10
10: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fibo1(i32 10)
%2 = icmp eq i32 %1, 55
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tft_clear();
void tft_init(void) { tft_clear(); }


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

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

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

LLVM IR (-O2):
define void @tft_init() {
%1 = tail call i32 (...) @tft_clear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
void *malloc(size_t);
void *xmalloc(size_t n) {
  void *p;
  if (n == 0)
    return NULL;
  p = malloc(n);
  if (p == NULL)
    error(EXIT_FAILURE, errno, "malloc");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <xmalloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1182 <xmalloc+0x62>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117a <xmalloc+0x5a>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
lea    0xe8b(%rip),%rdx
call   1040 <error@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
test   %rdi,%rdi
je     1150 <xmalloc+0x30>
call   1030 <malloc@plt>
test   %rax,%rax
je     1132 <xmalloc+0x12>
pop    %rcx
ret
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdx
call   1040 <error@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [7 x i8] c"malloc\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @EXIT_FAILURE
%8 = load i32, i32* @errno
%9 = tail call i32 @error(i32 %7, i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %3, %6, %1
%11 = phi i8* [ null, %1 ], [ null, %6 ], [ %4, %3 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ w_pawns_able_to_capture_any(int, int);
void w_pawns_able_to_capture_any_test(void **state) {
  assert_int_equal(
      0x0000000014000000ul,
      w_pawns_able_to_capture_any(0x000000001C000000ul, 0x0000100800000000ul));
}


x86 assembly (clang, -O0):
<w_pawns_able_to_capture_any_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1c000000,%edi
xor    %esi,%esi
call   1040 <w_pawns_able_to_capture_any@plt>
mov    %eax,%esi
mov    $0x14000000,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_pawns_able_to_capture_any_test>:
push   %rax
mov    $0x1c000000,%edi
xor    %esi,%esi
call   1040 <w_pawns_able_to_capture_any@plt>
mov    $0x14000000,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @w_pawns_able_to_capture_any_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @w_pawns_able_to_capture_any(i32 469762048, i32 0)
%4 = call i32 @assert_int_equal(i32 335544320, i32 %3)
ret void
}

LLVM IR (-O2):
define void @w_pawns_able_to_capture_any_test(i8** nocapture readnone %0) {
%2 = tail call i32 @w_pawns_able_to_capture_any(i32 469762048, i32 0)
%3 = tail call i32 @assert_int_equal(i32 335544320, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t l) {
  p = realloc(p, l);
  if (p == NULL) {
    abort();
  }
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <xrealloc+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     112d <xrealloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void g_free(void *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<g_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @g_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *);
void *realloc(void *, size_t);
void *h2o_mem_realloc(void *oldp, size_t sz) {
  void *newp = realloc(oldp, sz);
  if (newp == NULL) {
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/cubicdaiya/h2o/refs/heads/"
               "master/include/h2o/h2o/memory.h"
               ":"
               "338"
               ":"
               "no memory");
    return oldp;
  }
  return newp;
}


x86 assembly (clang, -O0):
<h2o_mem_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1165 <h2o_mem_realloc+0x45>
lea    0xead(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <h2o_mem_realloc+0x4d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_realloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1130 <h2o_mem_realloc+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cubicdaiya/h2o/refs/heads/master/include/h2o/h2o/memory.h:338:no memory\00"
define i8* @h2o_mem_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @h2o__fatal(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %4
store i8* %14, i8** %3
br label %17
15: ; preds = %2
%16 = load i8*, i8** %6
store i8* %16, i8** %3
br label %17
17: ; preds = %15, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cubicdaiya/h2o/refs/heads/master/include/h2o/h2o/memory.h:338:no memory\00"
define i8* @h2o_mem_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %0, %5 ], [ %3, %2 ]
ret i8* %8
}