xunge/DecIR huggingface dataset:
int CompExchangeInt(volatile int *ptr, int oldval, int newval) {
  return __sync_val_compare_and_swap(ptr, oldval, newval);
}


x86 assembly (clang, -O0):
<CompExchangeInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompExchangeInt>:
mov    %esi,%eax
lock cmpxchg %edx,(%rdi)
ret

LLVM IR (-O0):
define i32 @CompExchangeInt(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 = cmpxchg i32* %7, i32 %8, i32 %9 seq_cst seq_cst
%11 = extractvalue { i32, i1 } %10, 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @CompExchangeInt(i32* nocapture %0, i32 %1, i32 %2) {
%4 = cmpxchg i32* %0, i32 %1, i32 %2 seq_cst seq_cst
%5 = extractvalue { i32, i1 } %4, 0
ret i32 %5
}
/* Variables and functions */
scalar_t__ execve(char const *, char *const *, char *const *);
int /*<<< orphan*/ unix_error(char *);
void Execve(const char *filename, char *const argv[], char *const envp[]) {
  if (execve(filename, argv, envp) < 0)
    unix_error("Execve error");
}


x86 assembly (clang, -O0):
<Execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <execve@plt>
cmp    $0x0,%rax
jge    115b <Execve+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Execve>:
push   %rax
call   1030 <execve@plt>
test   %rax,%rax
js     112d <Execve+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"Execve error\00"
define void @Execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i64 @execve(i8* %0, i8** %1, i8** %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _mm_empty();
void __attribute__((__target__("mmx"))) mm_empty_wrap(void) { _mm_empty(); }


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

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

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

LLVM IR (-O2):
define void @mm_empty_wrap() {
%1 = tail call i32 (...) @_mm_empty()
ret void
}
/* Type definitions */
struct winsize {
  int ws_row;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int btktermio_get_rows(void) {
  struct winsize w;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
  return w.ws_row;
}


x86 assembly (clang, -O0):
<btktermio_get_rows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btktermio_get_rows>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @btktermio_get_rows() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @btktermio_get_rows() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int kexit(int);
int do_exit(int value) { return (kexit(value)); }


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

x86 assembly (clang, -O2):
<do_exit>:
jmp    1030 <kexit@plt>

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

LLVM IR (-O2):
define i32 @do_exit(i32 %0) {
%2 = tail call i32 @kexit(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ x54x_log(char *, int);
uint8_t ConvertSenseLength(uint8_t RequestSenseLength) {
  x54x_log("Unconverted Request Sense length %i\n", RequestSenseLength);
  if (RequestSenseLength == 0)
    RequestSenseLength = 14;
  else if (RequestSenseLength == 1)
    RequestSenseLength = 0;
  x54x_log("Request Sense length %i\n", RequestSenseLength);
  return (RequestSenseLength);
}


x86 assembly (clang, -O0):
<ConvertSenseLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <x54x_log@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1140 <ConvertSenseLength+0x30>
movl   $0xe,-0x4(%rbp)
jmp    1156 <ConvertSenseLength+0x46>
cmpl   $0x1,-0x4(%rbp)
jne    1151 <ConvertSenseLength+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1156 <ConvertSenseLength+0x46>
mov    -0x4(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <x54x_log@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertSenseLength>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <x54x_log@plt>
xor    %eax,%eax
cmp    $0x1,%ebx
cmovne %ebx,%eax
test   %ebx,%ebx
mov    $0xe,%ebx
cmovne %eax,%ebx
lea    0xed2(%rip),%rdi
mov    %ebx,%esi
call   1030 <x54x_log@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Unconverted Request Sense length %i\0A\00"
@.str.1 = [25 x i8] c"Request Sense length %i\0A\00"
define i32 @ConvertSenseLength(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @x54x_log(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 14, i32* %2
br label %13
8: ; preds = %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 0, i32* %2
br label %12
12: ; preds = %11, %8
br label %13
13: ; preds = %12, %7
%14 = load i32, i32* %2
%15 = call i32 @x54x_log(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [37 x i8] c"Unconverted Request Sense length %i\0A\00"
@.str.1 = [25 x i8] c"Request Sense length %i\0A\00"
define i32 @ConvertSenseLength(i32 %0) {
%2 = tail call i32 @x54x_log(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i32 0, i32 %0
%6 = select i1 %3, i32 14, i32 %5
%7 = tail call i32 @x54x_log(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t host_to_be(uint32_t i) {
  return ((((((i)) << (24)) | (((i)) >> (32 - (24)))) & 0xFF00FF00) |
          (((((i)) << (8)) | (((i)) >> (32 - (8)))) & 0x00FF00FF));
}


x86 assembly (clang, -O0):
<host_to_be>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
and    $0xff00ff00,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
mov    -0x4(%rbp),%edx
sar    $0x18,%edx
or     %edx,%ecx
and    $0xff00ff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_to_be>:
mov    %edi,%eax
shl    $0x18,%eax
mov    %edi,%ecx
sar    $0x8,%ecx
and    $0xff00ff00,%ecx
or     %eax,%ecx
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x18,%edi
or     %edi,%eax
and    $0xff00ff,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @host_to_be(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = or i32 %4, %6
%8 = and i32 %7, -16711936
%9 = load i32, i32* %2
%10 = shl i32 %9, 8
%11 = load i32, i32* %2
%12 = ashr i32 %11, 24
%13 = or i32 %10, %12
%14 = and i32 %13, 16711935
%15 = or i32 %8, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @host_to_be(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr i32 %0, 8
%4 = and i32 %3, -16711936
%5 = or i32 %4, %2
%6 = shl i32 %0, 8
%7 = ashr i32 %0, 24
%8 = or i32 %6, %7
%9 = and i32 %8, 16711935
%10 = or i32 %5, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ debugPrint(char *);
int /*<<< orphan*/ next_glInitNames();
int /*<<< orphan*/ printGLError();
void glInitNames() {
  next_glInitNames();
  printGLError();
  debugPrint("glInitNames()\n");
}


x86 assembly (clang, -O0):
<glInitNames>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <next_glInitNames@plt>
mov    $0x0,%al
call   1040 <printGLError@plt>
lea    0xeb7(%rip),%rdi
call   1050 <debugPrint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glInitNames>:
push   %rax
xor    %eax,%eax
call   1030 <next_glInitNames@plt>
xor    %eax,%eax
call   1040 <printGLError@plt>
lea    0xeba(%rip),%rdi
pop    %rax
jmp    1050 <debugPrint@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"glInitNames()\0A\00"
define void @glInitNames() {
%1 = call i32 (...) @next_glInitNames()
%2 = call i32 (...) @printGLError()
%3 = call i32 @debugPrint(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"glInitNames()\0A\00"
define void @glInitNames() {
%1 = tail call i32 (...) @next_glInitNames()
%2 = tail call i32 (...) @printGLError()
%3 = tail call i32 @debugPrint(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ squares(int);
int main() { squares(10); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <squares@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @squares(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @squares(i32 10)
ret i32 0
}
int fun1060() { return 1060; }


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

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

LLVM IR (-O0):
define i32 @fun1060() {
ret i32 1060
}

LLVM IR (-O2):
define i32 @fun1060() {
ret i32 1060
}
/* Variables and functions */
unsigned char *chacha8_decrypt(unsigned char *, size_t *, unsigned char const *,
                               size_t, unsigned char const *,
                               unsigned char const *);
unsigned char *crypt_decrypt_chacha8(unsigned char *out, size_t *out_len,
                                     const unsigned char *in, size_t in_len,
                                     const unsigned char *nonce,
                                     const unsigned char *key) {
  return chacha8_decrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_decrypt_chacha8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <chacha8_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_decrypt_chacha8>:
jmp    1030 <chacha8_decrypt@plt>

LLVM IR (-O0):
define i8* @crypt_decrypt_chacha8(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @chacha8_decrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_decrypt_chacha8(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @chacha8_decrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpneq_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_cmpneq_ps(__m128 __a, __m128 __b) {
  return _mm_cmpneq_ps(__a, __b);
}


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

x86 assembly (clang, -O2):
<test_mm_cmpneq_ps>:
jmp    1030 <_mm_cmpneq_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpneq_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpneq_ps(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
void error(char *msg) {
  perror(msg);
  printf("\n");
  exit(-4249);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffef67,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1040 <perror@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xffffef67,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 -4249)
unreachable
}

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @exit(i32 -4249)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(void) {
  int i;
  long x[12] __attribute__((aligned(16)));
  x[0] = 1;
  for (i = 0; i < 12; i++)
    x[i] = i;
  if (x[0] != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x70(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
jge    1153 <main+0x43>
movslq -0x8(%rbp),%rcx
movslq -0x8(%rbp),%rax
mov    %rcx,-0x70(%rbp,%rax,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <main+0x1e>
cmpq   $0x0,-0x70(%rbp)
je     1165 <main+0x55>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [12 x i64]
store i32 0, i32* %1
%4 = getelementptr inbounds [12 x i64], [12 x i64]* %3, i64 0, i64 0
store i64 1, i64* %4
store i32 0, i32* %2
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 12
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [12 x i64], [12 x i64]* %3, i64 0, i64 %12
store i64 %10, i64* %13
br label %14
14: ; preds = %8
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %5
17: ; preds = %5
%18 = getelementptr inbounds [12 x i64], [12 x i64]* %3, i64 0, i64 0
%19 = load i64, i64* %18
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 (...) @abort()
unreachable
23: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void d2i_POLICYQUALINFO(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_POLICYQUALINFO() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
__attribute__((hot)) int sr_cmpu64(char *a, size_t asz, char *b, size_t bsz,
                                   void *arg __attribute__((unused))) {
  (void)asz;
  (void)bsz;
  register uint64_t av = *(uint64_t *)a;
  register uint64_t bv = *(uint64_t *)b;
  if (av == bv)
    return 0;
  return (av > bv) ? 1 : -1;
}


x86 assembly (clang, -O0):
<sr_cmpu64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x40(%rbp),%rax
jne    1148 <sr_cmpu64+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1163 <sr_cmpu64+0x63>
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rsi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmovg  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr_cmpu64>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %esi,%esi
cmp    (%rdx),%rax
setg   %sil
lea    -0x1(%rsi,%rsi,1),%eax
cmove  %ecx,%eax
ret
cs nopw 0x0(%rax,%rax,1)

LLVM IR (-O0):
define i32 @sr_cmpu64(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
store i8* %0, i8** %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
%14 = load i64, i64* %8
%15 = load i64, i64* %10
%16 = load i8*, i8** %7
%17 = bitcast i8* %16 to i64*
%18 = load i64, i64* %17
store i64 %18, i64* %12
%19 = load i8*, i8** %9
%20 = bitcast i8* %19 to i64*
%21 = load i64, i64* %20
store i64 %21, i64* %13
%22 = load i64, i64* %12
%23 = load i64, i64* %13
%24 = icmp eq i64 %22, %23
br i1 %24, label %25, label %26
25: ; preds = %5
store i32 0, i32* %6
br label %32
26: ; preds = %5
%27 = load i64, i64* %12
%28 = load i64, i64* %13
%29 = icmp sgt i64 %27, %28
%30 = zext i1 %29 to i64
%31 = select i1 %29, i32 1, i32 -1
store i32 %31, i32* %6
br label %32
32: ; preds = %26, %25
%33 = load i32, i32* %6
ret i32 %33
}

LLVM IR (-O2):
define i32 @sr_cmpu64(i8* nocapture %0, i64 %1, i8* nocapture %2, i64 %3, i8* nocapture readnone %4) {
%6 = bitcast i8* %0 to i64*
%7 = load i64, i64* %6
%8 = bitcast i8* %2 to i64*
%9 = load i64, i64* %8
%10 = icmp eq i64 %7, %9
%11 = icmp sgt i64 %7, %9
%12 = select i1 %11, i32 1, i32 -1
%13 = select i1 %10, i32 0, i32 %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ ArgText();
int /*<<< orphan*/ ExitUser(int);
int /*<<< orphan*/ Me();
int /*<<< orphan*/ Name_Got(int, char *);
char *TextOf(int /*<<< orphan*/);
int UserOf(int /*<<< orphan*/);
void Act_Become(void) {
  char *x = TextOf(ArgText());
  int u = UserOf(Me());
  if (u != -1) {
    ExitUser(u);
    Name_Got(u, x);
  }
}


x86 assembly (clang, -O0):
<Act_Become>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ArgText@plt>
mov    %eax,%edi
call   1080 <TextOf@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <Me@plt>
mov    %eax,%edi
call   1030 <UserOf@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
je     11a9 <Act_Become+0x49>
mov    -0xc(%rbp),%edi
call   1040 <ExitUser@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1060 <Name_Got@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_Become>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <ArgText@plt>
mov    %eax,%edi
call   1080 <TextOf@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1070 <Me@plt>
mov    %eax,%edi
call   1030 <UserOf@plt>
cmp    $0xffffffff,%eax
je     11a0 <Act_Become+0x40>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <ExitUser@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <Name_Got@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @Act_Become() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i32 (...) @ArgText()
%4 = call i8* @TextOf(i32 %3)
store i8* %4, i8** %1
%5 = call i32 (...) @Me()
%6 = call i32 @UserOf(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, -1
br i1 %8, label %9, label %15
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @ExitUser(i32 %10)
%12 = load i32, i32* %2
%13 = load i8*, i8** %1
%14 = call i32 @Name_Got(i32 %12, i8* %13)
br label %15
15: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
define void @Act_Become() {
%1 = tail call i32 (...) @ArgText()
%2 = tail call i8* @TextOf(i32 %1)
%3 = tail call i32 (...) @Me()
%4 = tail call i32 @UserOf(i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = tail call i32 @ExitUser(i32 %4)
%8 = tail call i32 @Name_Got(i32 %4, i8* %2)
br label %9
9: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x29() {
  Assert_real((iscntrl(41) == 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_iscntrl.c",
              210, ("iscntrl should be 0 for )"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x29>:
push   %rax
mov    $0x29,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xd2,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for )\00"
define void @t_iscntrl_0x29() {
%1 = call i64 @iscntrl(i32 41)
%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 210, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for )\00"
define void @t_iscntrl_0x29() {
%1 = tail call i64 @iscntrl(i32 41)
%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 210, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void put_word(p, x) unsigned char *p;
unsigned long x;
{
  p[0] = x & 0xff;
  p[1] = (x >> 8) & 0xff;
  p[2] = (x >> 16) & 0xff;
  p[3] = (x >> 24) & 0xff;
}


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

x86 assembly (clang, -O2):
<put_word>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @put_word(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
store i8 %3, i8* %0
%4 = lshr i64 %1, 8
%5 = trunc i64 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i64 %1, 16
%8 = trunc i64 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i64 %1, 24
%11 = trunc i64 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
main() {
  double sum, atof(char[]);
  char line[100];
  int mygetline(char line[], int max);
  sum = 0;
  while (mygetline(line, 100) > 0)
    printf("\t%g\n", sum += atof(line));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x64,%esi
call   1050 <mygetline@plt>
cmp    $0x0,%eax
jle    1185 <main+0x55>
lea    -0x80(%rbp),%rdi
call   1030 <atof@plt>
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
jmp    114a <main+0x1a>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
lea    0x10(%rsp),%rdi
mov    $0x64,%esi
call   1050 <mygetline@plt>
test   %eax,%eax
jle    1195 <main+0x65>
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x10(%rsp),%rbx
lea    0xea0(%rip),%r14
mov    %rbx,%rdi
call   1030 <atof@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
mov    %r14,%rdi
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <mygetline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\09%g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca [100 x i8]
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i32 @mygetline(i8* %5, i32 100)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call double @atof(i8* %9)
%11 = load double, double* %2
%12 = fadd double %11, %10
store double %12, double* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %12)
br label %4
14: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\09%g\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @mygetline(i8* %2, i32 100)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0, %5
%6 = phi double [ %8, %5 ], [ 0.000000e+00, %0 ]
%7 = call double @atof(i8* %2)
%8 = fadd double %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %8)
%10 = call i32 @mygetline(i8* %2, i32 100)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5, %0
ret i32 0
}
void do_data_abort() {}


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

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

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

LLVM IR (-O2):
define void @do_data_abort() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int venc_sleep(int time_millis) {
  usleep(time_millis * 1000);
  return 0;
}


x86 assembly (clang, -O0):
<venc_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<venc_sleep>:
push   %rax
imul   $0x3e8,%edi,%edi
call   1030 <usleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @venc_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @venc_sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret i32 0
}
void list_free_ignore(void *p) { (void)p; }


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

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

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

LLVM IR (-O2):
define void @list_free_ignore(i8* nocapture %0) {
ret void
}
int sys_symlink(const char *old_path, int fd, const char *new_path) {}


x86 assembly (clang, -O0):
<sys_symlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sys_symlink(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 undef
}
void apdu_record_reset(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ErrorLog(int, char *, int /*<<< orphan*/ *, char *);
void ErrorHnd(int error, char *func, FILE *efile, char *smsg) {
  ErrorLog(error, func, efile, smsg);
}


x86 assembly (clang, -O0):
<ErrorHnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <ErrorLog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ErrorHnd>:
jmp    1030 <ErrorLog@plt>

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

LLVM IR (-O2):
define void @ErrorHnd(i32 %0, i8* %1, i32* %2, i8* %3) {
%5 = tail call i32 @ErrorLog(i32 %0, i8* %1, i32* %2, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ driller_free(void *);
void driller_free_hook(void *mem, const void *caller) { driller_free(mem); }


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

x86 assembly (clang, -O2):
<driller_free_hook>:
jmp    1030 <driller_free@plt>

LLVM IR (-O0):
define void @driller_free_hook(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 = call i32 @driller_free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @driller_free_hook(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @driller_free(i8* %0)
ret void
}
/* Type definitions */
struct tini_base {
  int dummy;
};

/* Variables and functions */
void config_load(char const *, struct tini_base **);
int /*<<< orphan*/ tini_free(struct tini_base *);
void config_reload(const char *config_file, struct tini_base **base) {
  tini_free(*base);
  return config_load(config_file, base);
}


x86 assembly (clang, -O0):
<config_reload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <tini_free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <config_load@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_reload>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%rdi
call   1040 <tini_free@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <config_load@plt>

LLVM IR (-O0):
%struct.tini_base = type { i32 }
define void @config_reload(i8* %0, %struct.tini_base** %1) {
%3 = alloca i8*
%4 = alloca %struct.tini_base**
store i8* %0, i8** %3
store %struct.tini_base** %1, %struct.tini_base*** %4
%5 = load %struct.tini_base**, %struct.tini_base*** %4
%6 = load %struct.tini_base*, %struct.tini_base** %5
%7 = call i32 @tini_free(%struct.tini_base* %6)
%8 = load i8*, i8** %3
%9 = load %struct.tini_base**, %struct.tini_base*** %4
ret void
}

LLVM IR (-O2):
%struct.tini_base = type { i32 }
define void @config_reload(i8* %0, %struct.tini_base** %1) {
%3 = load %struct.tini_base*, %struct.tini_base** %1
%4 = tail call i32 @tini_free(%struct.tini_base* %3)
tail call void @config_load(i8* %0, %struct.tini_base** %1)
ret void
}
/* Variables and functions */
char toupper(unsigned char);
void isaac_toupper(char *str) {
  char *sptr;
  if (!str)
    return;
  for (sptr = str; *sptr != '\0'; sptr++) {
    *sptr = toupper((unsigned char)*sptr);
  }
}


x86 assembly (clang, -O0):
<isaac_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <isaac_toupper+0x1c>
jmp    1169 <isaac_toupper+0x59>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1169 <isaac_toupper+0x59>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <isaac_toupper+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isaac_toupper>:
push   %rbx
test   %rdi,%rdi
je     1146 <isaac_toupper+0x36>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1146 <isaac_toupper+0x36>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isaac_toupper+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @isaac_toupper(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call signext i8 @toupper(i8 zeroext %7)
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *space_out(char *s) {
  while (isspace(*s)) {
    s++;
  }
  return (s);
}


x86 assembly (clang, -O0):
<space_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <space_out+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <space_out+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space_out>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <space_out+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @space_out(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isspace(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @space_out(i8* %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
ret i8* %3
}
void doStuff3(const int y) {}


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

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

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

LLVM IR (-O2):
define void @doStuff3(i32 %0) {
ret void
}
/* Variables and functions */
int FILENAME_MAX;
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ mcfioC_GetBlockName(int, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void mcfio_getblockname_(int *blkId, char *answer, int length) {
  char *aString;
  aString = (char *)malloc(sizeof(char) * (FILENAME_MAX + 1));
  mcfioC_GetBlockName(*blkId, aString);
  strncpy(answer, aString, length);
  free(aString);
}


x86 assembly (clang, -O0):
<mcfio_getblockname_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rsi
call   1060 <mcfioC_GetBlockName@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <strncpy@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcfio_getblockname_>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    0x0(%rbp),%edi
mov    %rax,%rsi
call   1060 <mcfioC_GetBlockName@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <strncpy@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@FILENAME_MAX = global i32 0
define void @mcfio_getblockname_(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* @FILENAME_MAX
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = mul i64 1, %10
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %7
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = load i8*, i8** %7
%18 = call i32 @mcfioC_GetBlockName(i32 %16, i8* %17)
%19 = load i8*, i8** %5
%20 = load i8*, i8** %7
%21 = load i32, i32* %6
%22 = call i32 @strncpy(i8* %19, i8* %20, i32 %21)
%23 = load i8*, i8** %7
%24 = call i32 @free(i8* %23)
ret void
}

LLVM IR (-O2):
@FILENAME_MAX = global i32 0
define void @mcfio_getblockname_(i32* nocapture %0, i8* %1, i32 %2) {
%4 = load i32, i32* @FILENAME_MAX
%5 = add nsw i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = load i32, i32* %0
%9 = tail call i32 @mcfioC_GetBlockName(i32 %8, i8* %7)
%10 = tail call i32 @strncpy(i8* %1, i8* %7, i32 %2)
%11 = tail call i32 @free(i8* %7)
ret void
}
void regerror(s) const char *s;
{ error("REGULAR EXPRESSION ERROR (%s)", (char *)s); }


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

x86 assembly (clang, -O2):
<regerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"REGULAR EXPRESSION ERROR (%s)\00"
define void @regerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"REGULAR EXPRESSION ERROR (%s)\00"
define void @regerror(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
void stub1(float, char);
void testClosureFBrV(void (*closure)(float, char), float a1, char a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureFBrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1131 <testClosureFBrV+0x31>
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
movsbl -0xd(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFBrV>:
test   %rdi,%rdi
je     110e <testClosureFBrV+0xe>
mov    %rdi,%rax
movsbl %sil,%edi
jmp    *%rax
ret

LLVM IR (-O0):
define void @testClosureFBrV(void (float, i8)* %0, float %1, i8 signext %2) {
%4 = alloca void (float, i8)*
%5 = alloca float
%6 = alloca i8
store void (float, i8)* %0, void (float, i8)** %4
store float %1, float* %5
store i8 %2, i8* %6
%7 = load void (float, i8)*, void (float, i8)** %4
%8 = icmp ne void (float, i8)* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load void (float, i8)*, void (float, i8)** %4
%11 = load float, float* %5
%12 = load i8, i8* %6
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @testClosureFBrV(void (float, i8)* %0, float %1, i8 signext %2) {
%4 = icmp eq void (float, i8)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(float %1, i8 signext %2)
br label %6
6: ; preds = %5, %3
ret void
}
void gtk_rc_reparse_all() {}


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

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

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

LLVM IR (-O2):
define void @gtk_rc_reparse_all() {
ret void
}
unsigned char checkStringOutParameter(char **path, unsigned int *pathLength) {
  if (path == 0x0 && pathLength != 0x0) {
    *pathLength = 0;
  }
  return path != 0x0;
}


x86 assembly (clang, -O0):
<checkStringOutParameter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <checkStringOutParameter+0x2c>
cmpq   $0x0,-0x10(%rbp)
je     112c <checkStringOutParameter+0x2c>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkStringOutParameter>:
test   %rdi,%rdi
jne    1110 <checkStringOutParameter+0x10>
test   %rsi,%rsi
je     1110 <checkStringOutParameter+0x10>
movl   $0x0,(%rsi)
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define zeroext i8 @checkStringOutParameter(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
store i8** %0, i8*** %3
store i32* %1, i32** %4
%5 = load i8**, i8*** %3
%6 = icmp eq i8** %5, null
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = load i32*, i32** %4
store i32 0, i32* %11
br label %12
12: ; preds = %10, %7, %2
%13 = load i8**, i8*** %3
%14 = icmp ne i8** %13, null
%15 = zext i1 %14 to i32
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @checkStringOutParameter(i8** readnone %0, i32* writeonly %1) {
%3 = icmp eq i8** %0, null
%4 = icmp ne i32* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 0, i32* %1
br label %7
7: ; preds = %6, %2
%8 = icmp ne i8** %0, null
%9 = zext i1 %8 to i8
ret i8 %9
}
int test_imm_DCint8_mem(signed char *val) {
  return ((*val) & (0xDC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_DCint8_mem(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 = and i32 %5, 220
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_DCint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -36
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}