xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printHelp(char *progName) {
  printf("%s [options]\n", progName);
  char *helpString =
      "    -h        | Print help and quit\n    -f <file> | File to read?\n    "
      "-s <file> | Save crc to this file.\n    -l <file> | Load crc from "
      "file\n    -V        | Validate the file\n    -c        | Run crc check "
      "on file\n";
  printf("%s", helpString);
}


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

x86 assembly (clang, -O2):
<printHelp>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xfbc(%rip),%rdi
lea    0xee0(%rip),%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%s [options]\0A\00"
@.str.1 = [213 x i8] c" -h | Print help and quit\0A -f <file> | File to read?\0A -s <file> | Save crc to this file.\0A -l <file> | Load crc from file\0A -V | Validate the file\0A -c | Run crc check on file\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define void @printHelp(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
store i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str.1, i64 0, i64 0), i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s [options]\0A\00"
@.str.1 = [213 x i8] c" -h | Print help and quit\0A -f <file> | File to read?\0A -s <file> | Save crc to this file.\0A -l <file> | Load crc from file\0A -V | Validate the file\0A -c | Run crc check on file\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define void @printHelp(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void get_cpuid(unsigned int leaf, unsigned int *cpuid) {
  asm volatile("cpuid"
               : "=a"(cpuid[0]), "=b"(cpuid[1]), "=c"(cpuid[2]), "=d"(cpuid[3])
               : "a"(leaf));
}


x86 assembly (clang, -O0):
<get_cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,%r9d
mov    -0x28(%rbp),%rax
mov    %ecx,%esi
mov    -0x20(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,0x4(%rdi)
mov    %esi,0x8(%rcx)
mov    %edx,0xc(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpuid>:
push   %rbx
mov    %edi,%eax
cpuid
mov    %eax,(%rsi)
mov    %ebx,0x4(%rsi)
mov    %ecx,0x8(%rsi)
mov    %edx,0xc(%rsi)
pop    %rbx
ret

LLVM IR (-O0):
define void @get_cpuid(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32, i32* %3
%14 = call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %13)
%15 = extractvalue { i32, i32, i32, i32 } %14, 0
%16 = extractvalue { i32, i32, i32, i32 } %14, 1
%17 = extractvalue { i32, i32, i32, i32 } %14, 2
%18 = extractvalue { i32, i32, i32, i32 } %14, 3
store i32 %15, i32* %6
store i32 %16, i32* %8
store i32 %17, i32* %10
store i32 %18, i32* %12
ret void
}

LLVM IR (-O2):
define void @get_cpuid(i32 %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = getelementptr inbounds i32, i32* %1, i64 3
%6 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %3
store i32 %9, i32* %4
store i32 %10, i32* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ vsyslog(int /*<<< orphan*/, char const *,
                           int /*<<< orphan*/);
void verrExit(const char *format, va_list vl) {
  vsyslog(LOG_INFO, format, vl);
  exit(-100);
}


x86 assembly (clang, -O0):
<verrExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vsyslog@plt>
mov    $0xffffff9c,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<verrExit>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1030 <vsyslog@plt>
mov    $0xffffff9c,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
define void @verrExit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @LOG_INFO
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @vsyslog(i32 %5, i8* %6, i32 %7)
%9 = call i32 @exit(i32 -100)
unreachable
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
define void @verrExit(i8* %0, i32 %1) {
%3 = load i32, i32* @LOG_INFO
%4 = tail call i32 @vsyslog(i32 %3, i8* %0, i32 %1)
%5 = tail call i32 @exit(i32 -100)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dm9000_reg_write(int, int);
void dm9000_reset() {
  dm9000_reg_write(0x1e, (1 << 0));
  dm9000_reg_write(0x1f, 0);
  dm9000_reg_write(0x00, ((1 << 1) | (1 << 0)));
  dm9000_reg_write(0x00, 0);
  dm9000_reg_write(0x00, ((1 << 1) | (1 << 0)));
  dm9000_reg_write(0x00, 0);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x1e,%edi
mov    $0x1,%esi
call   1030 <dm9000_reg_write@plt>
mov    $0x1f,%edi
xor    %esi,%esi
call   1030 <dm9000_reg_write@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <dm9000_reg_write@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <dm9000_reg_write@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <dm9000_reg_write@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <dm9000_reg_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
mov    $0x1e,%edi
mov    $0x1,%esi
call   1030 <dm9000_reg_write@plt>
mov    $0x1f,%edi
xor    %esi,%esi
call   1030 <dm9000_reg_write@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <dm9000_reg_write@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <dm9000_reg_write@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1030 <dm9000_reg_write@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <dm9000_reg_write@plt>

LLVM IR (-O0):
define void @dm9000_reset() {
%1 = call i32 @dm9000_reg_write(i32 30, i32 1)
%2 = call i32 @dm9000_reg_write(i32 31, i32 0)
%3 = call i32 @dm9000_reg_write(i32 0, i32 3)
%4 = call i32 @dm9000_reg_write(i32 0, i32 0)
%5 = call i32 @dm9000_reg_write(i32 0, i32 3)
%6 = call i32 @dm9000_reg_write(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @dm9000_reset() {
%1 = tail call i32 @dm9000_reg_write(i32 30, i32 1)
%2 = tail call i32 @dm9000_reg_write(i32 31, i32 0)
%3 = tail call i32 @dm9000_reg_write(i32 0, i32 3)
%4 = tail call i32 @dm9000_reg_write(i32 0, i32 0)
%5 = tail call i32 @dm9000_reg_write(i32 0, i32 3)
%6 = tail call i32 @dm9000_reg_write(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writeCommand1parm(char *, unsigned int);
void back(unsigned int speed) {
  if (speed <= 100) {
    writeCommand1parm("MB", speed);
  }
}


x86 assembly (clang, -O0):
<back>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
ja     1134 <back+0x24>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <writeCommand1parm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<back>:
cmp    $0x64,%edi
ja     1123 <back+0x13>
mov    %edi,%esi
lea    0xee2(%rip),%rdi
jmp    1030 <writeCommand1parm@plt>
ret

LLVM IR (-O0):
@.str = [3 x i8] c"MB\00"
define void @back(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ule i32 %3, 100
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @writeCommand1parm(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"MB\00"
define void @back(i32 %0) {
%2 = icmp ult i32 %0, 101
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @writeCommand1parm(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int int8_t;
typedef int /*<<< orphan*/ input;

/* Variables and functions */
int /*<<< orphan*/ test_rebase(int, int *, int, int, int *, int /*<<< orphan*/);
void test_negative_digit(void) {
  int8_t input[] = {1, -1, 1, 0, 1, 0};
  int8_t expected[] = {0};
  test_rebase(2, input, (sizeof(input) / sizeof(input[0])), 10, expected, 0);
}


x86 assembly (clang, -O0):
<test_negative_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x24(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%r8
mov    $0x2,%edi
mov    $0x6,%edx
mov    $0xa,%ecx
xor    %r9d,%r9d
call   1040 <test_rebase@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_negative_digit>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%r8
mov    $0x2,%edi
mov    $0x6,%edx
mov    $0xa,%ecx
xor    %r9d,%r9d
call   1030 <test_rebase@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_negative_digit.input = [6 x i32] [i32 1, i32 -1, i32 1, i32 0, i32 1, i32 0]
define void @test_negative_digit() {
%1 = alloca [6 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%7 = call i32 @test_rebase(i32 2, i32* %5, i32 6, i32 10, i32* %6, i32 0)
ret void
}

LLVM IR (-O2):
@__const.test_negative_digit.input = [6 x i32] [i32 1, i32 -1, i32 1, i32 0, i32 1, i32 0]
define void @test_negative_digit() {
%1 = alloca [6 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 0, i32* %5
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%7 = call i32 @test_rebase(i32 2, i32* %6, i32 6, i32 10, i32* %5, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_string(char *);
void print_warning(char *str) { __console_tx_string(str); }


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

x86 assembly (clang, -O2):
<print_warning>:
jmp    1030 <__console_tx_string@plt>

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

LLVM IR (-O2):
define void @print_warning(i8* %0) {
%2 = tail call i32 @__console_tx_string(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int fibo(int);
int main() {
  int x = 10;
  int result = fibo(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   1040 <fibo@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x37,-0xc(%rbp)
jne    1152 <main+0x32>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <fibo@plt>
cmp    $0x37,%eax
jne    1137 <main+0x17>
xor    %eax,%eax
call   1030 <__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 @fibo(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq 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 @fibo(i32 10)
%2 = icmp eq i32 %1, 55
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *my_malloc(size_t size) {
  void *p;
  p = malloc(size);
  if (!p) {
    fprintf(stderr, "Failed to allocate: %zu bytes of memory.\n", size);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <my_malloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <my_malloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Failed to allocate: %zu bytes of memory.\0A\00"
define i8* @my_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Failed to allocate: %zu bytes of memory.\0A\00"
define noalias i8* @my_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
void *plat_gvideo_set_mode(int *w, int *h, int *bpp) { return 0; }


x86 assembly (clang, -O0):
<plat_gvideo_set_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @plat_gvideo_set_mode(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
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @plat_gvideo_set_mode(i32* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
ret i8* null
}
void PKEY_USAGE_PERIOD_new(void) {}


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

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

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

LLVM IR (-O2):
define void @PKEY_USAGE_PERIOD_new() {
ret void
}
void av_blowfish_crypt_ecb() {}


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

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

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

LLVM IR (-O2):
define void @av_blowfish_crypt_ecb() {
ret void
}
int is_valid_http_url(char *url) { return '/' == url[0]; }


x86 assembly (clang, -O0):
<is_valid_http_url>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x2f,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_http_url>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_valid_http_url(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 47, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_valid_http_url(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned int unpacku16(unsigned char *buf) {
  return ((unsigned int)buf[0] << 8) | buf[1];
}


x86 assembly (clang, -O0):
<unpacku16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpacku16>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @unpacku16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @unpacku16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int munmap(void *, size_t);
int /*<<< orphan*/ perror(char *);
void pagealign_free(void *addr, size_t size) {
  int ret = munmap(addr, size);
  if (ret == -1)
    perror("munmap");
}


x86 assembly (clang, -O0):
<pagealign_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <munmap@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1156 <pagealign_free+0x36>
lea    0xeaf(%rip),%rdi
call   1040 <perror@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pagealign_free>:
push   %rax
call   1030 <munmap@plt>
cmp    $0xffffffff,%eax
je     112d <pagealign_free+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"munmap\00"
define void @pagealign_free(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void sayToWorld(char who[]) { printf("Hello, %s!\n", who); }


x86 assembly (clang, -O0):
<sayToWorld>:
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):
<sayToWorld>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello, %s!\0A\00"
define void @sayToWorld(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putendl(char *);
int /*<<< orphan*/ ft_putstr(char *);
void job_error(int k) {
  if (k == 1)
    ft_putstr("fg");
  else
    ft_putstr("bg");
  ft_putendl(": no current job");
}


x86 assembly (clang, -O0):
<job_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1146 <job_error+0x26>
lea    0xec4(%rip),%rdi
call   1040 <ft_putstr@plt>
jmp    1152 <job_error+0x32>
lea    0xeb6(%rip),%rdi
call   1040 <ft_putstr@plt>
lea    0xead(%rip),%rdi
call   1030 <ft_putendl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<job_error>:
push   %rax
cmp    $0x1,%edi
lea    0xed5(%rip),%rax
lea    0xed1(%rip),%rdi
cmove  %rax,%rdi
call   1040 <ft_putstr@plt>
lea    0xec4(%rip),%rdi
pop    %rax
jmp    1030 <ft_putendl@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"fg\00"
@.str.1 = [3 x i8] c"bg\00"
@.str.2 = [17 x i8] c": no current job\00"
define void @job_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @ft_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @ft_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = call i32 @ft_putendl(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"fg\00"
@.str.1 = [3 x i8] c"bg\00"
@.str.2 = [17 x i8] c": no current job\00"
define void @job_error(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @ft_putstr(i8* %3)
%5 = tail call i32 @ft_putendl(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void flow_record_to_null(void *record, char **s, int tag) {}


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

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

LLVM IR (-O0):
define void @flow_record_to_null(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
ret void
}

LLVM IR (-O2):
define void @flow_record_to_null(i8* nocapture %0, i8** nocapture %1, i32 %2) {
ret void
}
int register_blkdev(unsigned int x, char *y) {
  int a;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @register_blkdev(i32 %0, i8* nocapture readnone %1) {
ret i32 undef
}
signed int signedint_ignoring_unsignedshortint(signed int x,
                                               unsigned short int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @signedint_ignoring_unsignedshortint(i32 returned %0, i16 zeroext %1) {
ret i32 %0
}
void task_a(int t, int t2, int *tt) {}


x86 assembly (clang, -O0):
<task_a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @task_a(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
ret void
}

LLVM IR (-O2):
define void @task_a(i32 %0, i32 %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x32_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x32_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x32_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x32_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x32_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x51() {
  Assert_real((isdigit(81) == 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_isdigit.c",
              410, ("isdigit should be 0 for Q"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x51>:
push   %rax
mov    $0x51,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x19a,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for Q\00"
define void @t_isdigit_0x51() {
%1 = call i64 @isdigit(i32 81)
%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 410, i8* getelementptr inbounds ([26 x i8], [26 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for Q\00"
define void @t_isdigit_0x51() {
%1 = tail call i64 @isdigit(i32 81)
%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 410, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int spi_write(int, unsigned char *, int);
int do_write_enable(int fd) {
  unsigned char op = 0x06;
  return spi_write(fd, &op, 1);
}


x86 assembly (clang, -O0):
<do_write_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x6,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <spi_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_write_enable>:
push   %rax
movb   $0x6,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <spi_write@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @do_write_enable(i32 %0) {
%2 = alloca i8
store i8 6, i8* %2
%3 = call i32 @spi_write(i32 %0, i8* %2, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ acos(int /*<<< orphan*/);
int /*<<< orphan*/ popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basACos() { pushNumber(acos(popNumber())); }


x86 assembly (clang, -O0):
<basACos>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <acos@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<basACos>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <acos@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basACos() {
%1 = call i32 (...) @popNumber()
%2 = call i32 @acos(i32 %1)
%3 = call i32 @pushNumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @basACos() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @acos(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
unsigned long hashString(const char *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hashString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%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     114a <hashString+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hashString+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashString>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hashString+0x2d>
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 <hashString+0x10>
ret
mov    $0x1505,%eax
ret

LLVM IR (-O0):
define i64 @hashString(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i8* %0, i8** %2
store i64 5381, 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 = 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
ret i64 %20
}

LLVM IR (-O2):
define i64 @hashString(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 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 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, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
int test_imm_97uint16_reg(unsigned short val) {
  return ((val) & (0x97 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_97uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x97,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_97uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 151
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int convert(unsigned char hexNumber) {
  unsigned int temp = 0;
  switch (hexNumber) {
  case 'a':
    return 10;
  case 'b':
    return 11;
  case 'c':
    return 12;
  case 'd':
    return 13;
  case 'e':
    return 14;
  case 'f':
    return 15;
  }
  temp = hexNumber;
  return temp;
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
movzbl -0x5(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     1183 <convert+0x83>
mov    -0x18(%rbp),%rax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xa,-0x4(%rbp)
jmp    1190 <convert+0x90>
movl   $0xb,-0x4(%rbp)
jmp    1190 <convert+0x90>
movl   $0xc,-0x4(%rbp)
jmp    1190 <convert+0x90>
movl   $0xd,-0x4(%rbp)
jmp    1190 <convert+0x90>
movl   $0xe,-0x4(%rbp)
jmp    1190 <convert+0x90>
movl   $0xf,-0x4(%rbp)
jmp    1190 <convert+0x90>
movzbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
lea    -0x61(%rdi),%eax
movzbl %al,%ecx
lea    0xa(%rcx),%eax
cmp    $0x6,%cl
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @convert(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 0, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
switch i32 %6, label %13 [
i32 97, label %7
i32 98, label %8
i32 99, label %9
i32 100, label %10
i32 101, label %11
i32 102, label %12
]
7: ; preds = %1
store i32 10, i32* %2
br label %17
8: ; preds = %1
store i32 11, i32* %2
br label %17
9: ; preds = %1
store i32 12, i32* %2
br label %17
10: ; preds = %1
store i32 13, i32* %2
br label %17
11: ; preds = %1
store i32 14, i32* %2
br label %17
12: ; preds = %1
store i32 15, i32* %2
br label %17
13: ; preds = %1
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
store i32 %15, i32* %4
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %13, %12, %11, %10, %9, %8, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @convert(i8 zeroext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 6
%4 = zext i8 %0 to i32
%5 = zext i8 %2 to i32
%6 = add nuw nsw i32 %5, 10
%7 = select i1 %3, i32 %6, i32 %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ msg(int, char *);
void deltas_start_read(void) {
  msg(0x100, "deltas_start_read called\n");
  exit(1);
}


x86 assembly (clang, -O0):
<deltas_start_read>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100,%edi
lea    0xed0(%rip),%rsi
call   1040 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<deltas_start_read>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x100,%edi
call   1040 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"deltas_start_read called\0A\00"
define void @deltas_start_read() {
%1 = call i32 @msg(i32 256, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"deltas_start_read called\0A\00"
define void @deltas_start_read() {
%1 = tail call i32 @msg(i32 256, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int is_list(const char *e) { return *e == '('; }


x86 assembly (clang, -O0):
<is_list>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x28,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_list>:
xor    %eax,%eax
cmpb   $0x28,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_list(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 40
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_list(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 40
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ehc_test(int, int, int);
int /*<<< orphan*/ uhc_test(int, int, int);
int grusbhc_test(int ehc_addr, int uhc_addr, int bedesc, int beregs) {
  if (uhc_addr)
    uhc_test(uhc_addr, bedesc, beregs);
  if (ehc_addr)
    ehc_test(ehc_addr, bedesc, beregs);
  return 0;
}


x86 assembly (clang, -O0):
<grusbhc_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114c <grusbhc_test+0x2c>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <uhc_test@plt>
cmpl   $0x0,-0x4(%rbp)
je     1164 <grusbhc_test+0x44>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <ehc_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grusbhc_test>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %edi,%ebx
test   %esi,%esi
je     113b <grusbhc_test+0x1b>
mov    %esi,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <uhc_test@plt>
test   %ebx,%ebx
je     114b <grusbhc_test+0x2b>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <ehc_test@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @grusbhc_test(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = call i32 @uhc_test(i32 %12, i32 %13, i32 %14)
br label %16
16: ; preds = %11, %4
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %5
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = call i32 @ehc_test(i32 %20, i32 %21, i32 %22)
br label %24
24: ; preds = %19, %16
ret i32 0
}

LLVM IR (-O2):
define i32 @grusbhc_test(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @uhc_test(i32 %1, i32 %2, i32 %3)
br label %8
8: ; preds = %6, %4
%9 = icmp eq i32 %0, 0
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = tail call i32 @ehc_test(i32 %0, i32 %2, i32 %3)
br label %12
12: ; preds = %10, %8
ret i32 0
}
int nbl_has_tmll(char *pstrBuffer) {
  return (*((unsigned int *)(pstrBuffer + 0x20))) != 0;
}


x86 assembly (clang, -O0):
<nbl_has_tmll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x20(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nbl_has_tmll>:
xor    %eax,%eax
cmpl   $0x0,0x20(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @nbl_has_tmll(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 32
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @nbl_has_tmll(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 32
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
double spiking(double rate, double rn) {
  if (rn <= rate)
    return 1.;
  return 0.;
}


x86 assembly (clang, -O0):
<spiking>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1134 <spiking+0x34>
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113c <spiking+0x3c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<spiking>:
cmpnlesd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm0
andnpd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @spiking(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp ole double %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store double 1.000000e+00, double* %3
br label %11
10: ; preds = %2
store double 0.000000e+00, double* %3
br label %11
11: ; preds = %10, %9
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @spiking(double %0, double %1) {
%3 = fcmp ugt double %1, %0
%4 = select i1 %3, double 0.000000e+00, double 1.000000e+00
ret double %4
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
void do_stuff_last() {
  printf("Thread %d: do_stuff_last\n", omp_get_thread_num());
}


x86 assembly (clang, -O0):
<do_stuff_last>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_stuff_last>:
push   %rax
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Thread %d: do_stuff_last\0A\00"
define void @do_stuff_last() {
%1 = call i32 (...) @omp_get_thread_num()
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Thread %d: do_stuff_last\0A\00"
define void @do_stuff_last() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, int);
int main() {
  int i;
  for (i = 1; i <= 255; i++) {
    printf("%c %s %d\n", i, "-", i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     115a <main+0x4a>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%ecx
lea    0xec0(%rip),%rdi
lea    0xec3(%rip),%rdx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%ebx
lea    0xedf(%rip),%r14
lea    0xee2(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15,%rdx
mov    %ebx,%ecx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%c %s %d\0A\00"
@.str.1 = [2 x i8] c"-\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), 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 i32 0
}
/* Variables and functions */
int readFloat(char *);
int getTemp() {
  return readFloat("/sys/class/thermal/thermal_zone0/temp") / 1000;
}


x86 assembly (clang, -O0):
<getTemp>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <readFloat@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTemp>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <readFloat@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"/sys/class/thermal/thermal_zone0/temp\00"
define i32 @getTemp() {
%1 = call i32 @readFloat(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = sdiv i32 %1, 1000
ret i32 %2
}

LLVM IR (-O2):
@.str = [38 x i8] c"/sys/class/thermal/thermal_zone0/temp\00"
define i32 @getTemp() {
%1 = tail call i32 @readFloat(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = sdiv i32 %1, 1000
ret i32 %2
}