xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ outportb(int, int);
extern void WriteATT(int index, int val) {
  outportb(0x3C0, index);
  outportb(0x3C0, val);
}


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

x86 assembly (clang, -O2):
<WriteATT>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x3c0,%edi
call   1030 <outportb@plt>
mov    $0x3c0,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outportb@plt>

LLVM IR (-O0):
define void @WriteATT(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 = call i32 @outportb(i32 960, i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @outportb(i32 960, i32 %7)
ret void
}

LLVM IR (-O2):
define void @WriteATT(i32 %0, i32 %1) {
%3 = tail call i32 @outportb(i32 960, i32 %0)
%4 = tail call i32 @outportb(i32 960, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char const *,
                            int /*<<< orphan*/);
void log_filep(void *data, int priority, const char *file, int line,
               const char *fn, const char *format, va_list args) {
  FILE *fp = data;
  fprintf(fp, "libkmod: %s: ", fn);
  vfprintf(fp, format, args);
}


x86 assembly (clang, -O0):
<log_filep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xea8(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    0x10(%rbp),%edx
call   1040 <vfprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_filep>:
push   %rbp
push   %r14
push   %rbx
mov    %r9,%r14
mov    %r8,%rdx
mov    %rdi,%rbx
mov    0x20(%rsp),%ebp
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <vfprintf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"libkmod: %s: \00"
define void @log_filep(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i8* %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%16 = load i8*, i8** %8
%17 = bitcast i8* %16 to i32*
store i32* %17, i32** %15
%18 = load i32*, i32** %15
%19 = load i8*, i8** %12
%20 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = load i32*, i32** %15
%22 = load i8*, i8** %13
%23 = load i32, i32* %14
%24 = call i32 @vfprintf(i32* %21, i8* %22, i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"libkmod: %s: \00"
define void @log_filep(i8* nocapture %0, i32 %1, i8* nocapture readnone %2, i32 %3, i8* %4, i8* nocapture %5, i32 %6) {
%8 = bitcast i8* %0 to i32*
%9 = tail call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = tail call i32 @vfprintf(i32* %8, i8* %5, i32 %6)
ret void
}
/* Variables and functions */
scalar_t__ FLT_RADIX;
double radixdbl_(double *x) { return (double)FLT_RADIX; }


x86 assembly (clang, -O0):
<radixdbl_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
cvtsi2sdq (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radixdbl_>:
mov    0x2ee1(%rip),%rax
cvtsi2sdq (%rax),%xmm0
ret

LLVM IR (-O0):
@FLT_RADIX = global i64 0
define double @radixdbl_(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load i64, i64* @FLT_RADIX
%4 = sitofp i64 %3 to double
ret double %4
}

LLVM IR (-O2):
@FLT_RADIX = global i64 0
define double @radixdbl_(double* nocapture readnone %0) {
%2 = load i64, i64* @FLT_RADIX
%3 = sitofp i64 %2 to double
ret double %3
}
/* Variables and functions */
unsigned char *aes128cbc_decrypt(unsigned char *, size_t *,
                                 unsigned char const *, size_t,
                                 unsigned char const *, unsigned char const *);
unsigned char *crypt_decrypt_aes128cbc(unsigned char *out, size_t *out_len,
                                       const unsigned char *in, size_t in_len,
                                       const unsigned char *nonce,
                                       const unsigned char *key) {
  return aes128cbc_decrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_decrypt_aes128cbc>:
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 <aes128cbc_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_decrypt_aes128cbc>:
jmp    1030 <aes128cbc_decrypt@plt>

LLVM IR (-O0):
define i8* @crypt_decrypt_aes128cbc(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* @aes128cbc_decrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_decrypt_aes128cbc(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @aes128cbc_decrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
void core_usage() {}


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

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

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

LLVM IR (-O2):
define void @core_usage() {
ret void
}
int _gfortran_caf_this_image(int distance __attribute__((unused))) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @_gfortran_caf_this_image(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ type(char *);
void cr() { type("\r\n"); }


x86 assembly (clang, -O0):
<cr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <type@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @cr() {
%1 = tail call i32 @type(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int assert(char *, int /*<<< orphan*/);
int /*<<< orphan*/ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int tcpSelect(int nfds, fd_set *readfds) {
  return assert("select", select(nfds, readfds, NULL, NULL, NULL));
}


x86 assembly (clang, -O0):
<tcpSelect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1040 <select@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpSelect>:
push   %rax
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <select@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"select\00"
define i32 @tcpSelect(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 @select(i32 %5, i32* %6, i32* null, i32* null, i32* null)
%8 = call i32 @assert(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [7 x i8] c"select\00"
define i32 @tcpSelect(i32 %0, i32* %1) {
%3 = tail call i32 @select(i32 %0, i32* %1, i32* null, i32* null, i32* null)
%4 = tail call i32 @assert(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_jp_hl(void) { op_write1(0xe9); }


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

x86 assembly (clang, -O2):
<op_enc_jp_hl>:
mov    $0xe9,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_jp_hl() {
%1 = call i32 @op_write1(i32 233)
ret void
}

LLVM IR (-O2):
define void @op_enc_jp_hl() {
%1 = tail call i32 @op_write1(i32 233)
ret void
}
int gcd(int a, int b) {
  while (b != 0)
    a %= b, a ^= b, b ^= a, a ^= b;
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1140 <gcd+0x40>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int mgsort(void *, int, int, int /*<<< orphan*/, int,
           int (*)(void const *, void const *));
int mgsrt(void *data, int size, int esize,
          int (*compare)(const void *key1, const void *key2)) {
  return mgsort(data, size, esize, 0, size - 1, compare);
}


x86 assembly (clang, -O0):
<mgsrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%r8d
sub    $0x1,%r8d
mov    -0x18(%rbp),%r9
xor    %ecx,%ecx
call   1030 <mgsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgsrt>:
mov    %rcx,%r9
lea    -0x1(%rsi),%r8d
xor    %ecx,%ecx
jmp    1030 <mgsort@plt>

LLVM IR (-O0):
define i32 @mgsrt(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*)* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 (i8*, i8*)* %3, i32 (i8*, i8*)** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %8
%15 = call i32 @mgsort(i8* %9, i32 %10, i32 %11, i32 0, i32 %13, i32 (i8*, i8*)* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @mgsrt(i8* %0, i32 %1, i32 %2, i32 (i8*, i8*)* %3) {
%5 = add nsw i32 %1, -1
%6 = tail call i32 @mgsort(i8* %0, i32 %1, i32 %2, i32 0, i32 %5, i32 (i8*, i8*)* %3)
ret i32 %6
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char *const *, char const *, struct option const *,
                     int *, int);
int timidity_getopt_long_only(int argc, char *const *argv, const char *options,
                              const struct option *long_options,
                              int *opt_index) {
  return _getopt_internal(argc, argv, options, long_options, opt_index, 1);
}


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

x86 assembly (clang, -O2):
<timidity_getopt_long_only>:
mov    $0x1,%r9d
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @timidity_getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @_getopt_internal(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @timidity_getopt_long_only(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 1)
ret i32 %6
}
imm0adr1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if (22 <= (*((short *)(11111111 & ~(__alignof__(short) - 1)))))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0xa98ac6,%eax
movswl (%rax),%ecx
mov    $0x16,%eax
cmp    %ecx,%eax
jg     1140 <imm0adr1+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <imm0adr1+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0adr1>:
xor    %eax,%eax
cmpw   $0x16,0xa98ac6
setge  %al
ret

LLVM IR (-O0):
define i32 @imm0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* inttoptr (i64 11111110 to i16*)
%17 = sext i16 %16 to i32
%18 = icmp sle i32 22, %17
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @imm0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = load i16, i16* inttoptr (i64 11111110 to i16*)
%8 = icmp sgt i16 %7, 21
%9 = zext i1 %8 to i32
ret i32 %9
}
int hash2(const char *w) {
  int n;
  for (n = 1; *w != '\0'; n *= (*w++ - 64))
    ;
  return n % 47;
}


x86 assembly (clang, -O0):
<hash2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <hash2+0x45>
jmp    1124 <hash2+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
sub    $0x40,%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash2+0xf>
mov    -0xc(%rbp),%eax
mov    $0x2f,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash2>:
mov    (%rdi),%cl
test   %cl,%cl
je     1143 <hash2+0x43>
add    $0x1,%rdi
mov    $0x1,%eax
nop
movsbl %cl,%ecx
add    $0xffffffc0,%ecx
imul   %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash2+0x10>
cltq
imul   $0xffffffffae4c415d,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x2f,%ecx,%ecx
sub    %ecx,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @hash2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %4
br label %10
10: ; preds = %9
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 64
%16 = load i32, i32* %3
%17 = mul nsw i32 %16, %15
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = load i32, i32* %3
%20 = srem i32 %19, 47
ret i32 %20
}

LLVM IR (-O2):
define i32 @hash2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 1, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = add nsw i32 %8, -64
%11 = mul nsw i32 %10, %6
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = srem i32 %11, 47
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 1, %1 ], [ %15, %14 ]
ret i32 %17
}
char *tomato(void) { return 0; }


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

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

LLVM IR (-O0):
define i8* @tomato() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @tomato() {
ret i8* null
}
int isLittleEndian() {
  short int number = 0x1;
  char *numPtr = (char *)&number;
  return (numPtr[0] == 1);
}


x86 assembly (clang, -O0):
<isLittleEndian>:
push   %rbp
mov    %rsp,%rbp
movw   $0x1,-0x2(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isLittleEndian() {
ret i32 1
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
bool file_exists(const char *path) {
  struct stat st;
  return stat(path, &st) == 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("If at first you don\'t succeed, try, try, try again! ");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"If at first you don't succeed, try, try, try again! \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"If at first you don't succeed, try, try, try again! \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int _gdbio_open_r(int /*<<< orphan*/ *, char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int gdbio_creat(const char *pathname, mode_t mode) {
  return _gdbio_open_r(&errno, pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
}


x86 assembly (clang, -O0):
<gdbio_creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edx
mov    0x2e8d(%rip),%rax
or     (%rax),%edx
mov    0x2eb4(%rip),%rax
or     (%rax),%edx
mov    -0xc(%rbp),%ecx
mov    0x2e88(%rip),%rdi
call   1030 <_gdbio_open_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdbio_creat>:
mov    %esi,%ecx
mov    %rdi,%rsi
mov    0x2edc(%rip),%rax
mov    0x2e9d(%rip),%rdx
mov    (%rdx),%edx
or     (%rax),%edx
mov    0x2ec2(%rip),%rax
or     (%rax),%edx
mov    0x2e99(%rip),%rdi
jmp    1030 <_gdbio_open_r@plt>

LLVM IR (-O0):
@errno = global i32 0
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @gdbio_creat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_CREAT
%7 = load i32, i32* @O_WRONLY
%8 = or i32 %6, %7
%9 = load i32, i32* @O_TRUNC
%10 = or i32 %8, %9
%11 = load i32, i32* %4
%12 = call i32 @_gdbio_open_r(i32* @errno, i8* %5, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@errno = global i32 0
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @gdbio_creat(i8* %0, i32 %1) {
%3 = load i32, i32* @O_CREAT
%4 = load i32, i32* @O_WRONLY
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @_gdbio_open_r(i32* @errno, i8* %0, i32 %7, i32 %1)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ drminfo(char *);
int main(int argc, char *argv[]) {
  argc--;
  argv++;
  while (argc) {
    drminfo(*argv);
    argc--;
    argv++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116b <main+0x5b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <drminfo@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x1,%edi
je     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <drminfo@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add nsw i32 %0, -1
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8** [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @drminfo(i8* %9)
%11 = add nsw i32 %6, -1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ mp_decode_binl(char const **);
const char *mp_decode_bin(const char **data, uint32_t *len) {
  assert(len != NULL);
  *len = mp_decode_binl(data);
  const char *str = *data;
  *data += *len;
  return str;
}


x86 assembly (clang, -O0):
<mp_decode_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <mp_decode_binl@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_decode_bin>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <mp_decode_binl@plt>
mov    %eax,(%r14)
mov    (%rbx),%rcx
cltq
add    %rcx,%rax
mov    %rax,(%rbx)
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mp_decode_bin(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
%5 = alloca i8*
store i8** %0, i8*** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = icmp ne i32* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8**, i8*** %3
%11 = call i32 @mp_decode_binl(i8** %10)
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %13
store i8* %14, i8** %5
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = load i8**, i8*** %3
%18 = load i8*, i8** %17
%19 = sext i32 %16 to i64
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8* %20, i8** %17
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define i8* @mp_decode_bin(i8** %0, i32* writeonly %1) {
%3 = icmp ne i32* %1, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @mp_decode_binl(i8** %0)
store i32 %6, i32* %1
%7 = load i8*, i8** %0
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %0
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ task_assert_flag(int, int);
void task_assert_used(int id) { task_assert_flag(id, (1 << 0)); }


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

x86 assembly (clang, -O2):
<task_assert_used>:
mov    $0x1,%esi
jmp    1030 <task_assert_flag@plt>

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

LLVM IR (-O2):
define void @task_assert_used(i32 %0) {
%2 = tail call i32 @task_assert_flag(i32 %0, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wrkpth;

/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char wrkpth[2048];
  char full_wrk[2048];
  getcwd(wrkpth, sizeof(wrkpth));
  sprintf(full_wrk, "%s/main.sh", wrkpth);
  setuid(0);
  system(full_wrk);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x810(%rbp),%rdi
mov    $0x800,%esi
call   1040 <getcwd@plt>
lea    -0x1010(%rbp),%rdi
lea    -0x810(%rbp),%rdx
lea    0xe88(%rip),%rsi
call   1050 <sprintf@plt>
xor    %edi,%edi
call   1060 <setuid@plt>
lea    -0x1010(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x1008,%rsp
lea    0x800(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x800,%esi
call   1040 <getcwd@plt>
lea    0xe9a(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1050 <sprintf@plt>
xor    %edi,%edi
call   1060 <setuid@plt>
mov    %r14,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x1008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s/main.sh\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2048 x i8]
%3 = alloca [2048 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%5 = call i32 @getcwd(i8* %4, i32 2048)
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @setuid(i32 0)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s/main.sh\00"
define i32 @main() {
%1 = alloca [2048 x i8]
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%5 = call i32 @getcwd(i8* %3, i32 2048)
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = call i32 @setuid(i32 0)
%8 = call i32 @system(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *, int, char *);
char *strerror(int);
void errno_exit(const char *s) {
  printf("%s error %d, %s\n", s, errno, strerror(errno));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<errno_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    %rax,%rcx
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errno_exit>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1050 <strerror@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %rax,%rcx
call   1030 <printf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s error %d, %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @errno_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4, i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s error %d, %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @errno_exit(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
void f(char *x) { *x = 'x'; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x78,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movb   $0x78,(%rdi)
ret

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

LLVM IR (-O2):
define void @f(i8* nocapture writeonly %0) {
store i8 120, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xa0() {
  Assert_real((isalpha(160) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              805, ("isalpha should be 0 for 0xa0"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xa0\00"
define void @t_isalpha_0xa0() {
%1 = tail call i64 @isalpha(i32 160)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 805, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
char *unused_str(int /*<<< orphan*/ *);
int main(void) {
  printf("#define HAVE_UNUSED /* yes */\n");
  printf("#undef UNUSED\n");
  printf("#define UNUSED %s /* yes */\n", unused_str(NULL));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <unused_str@plt>
mov    %rax,%rsi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <unused_str@plt>
lea    0xea9(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"#define HAVE_UNUSED /* yes */\0A\00"
@.str.1 = [15 x i8] c"#undef UNUSED\0A\00"
@.str.2 = [29 x i8] c"#define UNUSED %s /* yes */\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%4 = call i8* @unused_str(i32* null)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [29 x i8] c"#define UNUSED %s /* yes */\0A\00"
@str = [30 x i8] c"#define HAVE_UNUSED /* yes */\00"
@str.3 = [14 x i8] c"#undef UNUSED\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i8* @unused_str(i32* null)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret i32 0
}
int do_090() { return 90; }


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

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

LLVM IR (-O0):
define i32 @do_090() {
ret i32 90
}

LLVM IR (-O2):
define i32 @do_090() {
ret i32 90
}
/* Type definitions */
struct quat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ quat_divide(float *, float *, float *);
__attribute__((always_)) struct quat *
psquat_divide(struct quat *result, struct quat *a, struct quat *b) {
  quat_divide((float *)result, (float *)a, (float *)b);
  return result;
}


x86 assembly (clang, -O0):
<psquat_divide>:
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 <quat_divide@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psquat_divide>:
push   %rbx
mov    %rdi,%rbx
call   1030 <quat_divide@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.quat = type { i32 }
define %struct.quat* @psquat_divide(%struct.quat* %0, %struct.quat* %1, %struct.quat* %2) {
%4 = alloca %struct.quat*
%5 = alloca %struct.quat*
%6 = alloca %struct.quat*
store %struct.quat* %0, %struct.quat** %4
store %struct.quat* %1, %struct.quat** %5
store %struct.quat* %2, %struct.quat** %6
%7 = load %struct.quat*, %struct.quat** %4
%8 = bitcast %struct.quat* %7 to float*
%9 = load %struct.quat*, %struct.quat** %5
%10 = bitcast %struct.quat* %9 to float*
%11 = load %struct.quat*, %struct.quat** %6
%12 = bitcast %struct.quat* %11 to float*
%13 = call i32 @quat_divide(float* %8, float* %10, float* %12)
%14 = load %struct.quat*, %struct.quat** %4
ret %struct.quat* %14
}

LLVM IR (-O2):
%struct.quat = type { i32 }
define %struct.quat* @psquat_divide(%struct.quat* returned %0, %struct.quat* %1, %struct.quat* %2) {
%4 = bitcast %struct.quat* %0 to float*
%5 = bitcast %struct.quat* %1 to float*
%6 = bitcast %struct.quat* %2 to float*
%7 = tail call i32 @quat_divide(float* %4, float* %5, float* %6)
ret %struct.quat* %0
}
/* Variables and functions */
int /*<<< orphan*/ twoDsim_fps(double);
void fps(double f) { twoDsim_fps(f); }


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

x86 assembly (clang, -O2):
<fps>:
jmp    1030 <twoDsim_fps@plt>

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

LLVM IR (-O2):
define void @fps(double %0) {
%2 = tail call i32 @twoDsim_fps(double %0)
ret void
}
double moose_body_mass(double latitude) {
  double mass = 0.0;
  return mass;
}


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

x86 assembly (clang, -O2):
<moose_body_mass>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @moose_body_mass(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
define double @moose_body_mass(double %0) {
ret double 0.000000e+00
}
void foo_1_2_1_2_1_1_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_1_1_2_2_2() {
ret void
}
void chx_spin_unlock(struct chx_spinlock *lk) { (void)lk; }


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

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

LLVM IR (-O0):
%struct.chx_spinlock = type opaque
define void @chx_spin_unlock(%struct.chx_spinlock* %0) {
%2 = alloca %struct.chx_spinlock*
store %struct.chx_spinlock* %0, %struct.chx_spinlock** %2
%3 = load %struct.chx_spinlock*, %struct.chx_spinlock** %2
ret void
}

LLVM IR (-O2):
%struct.chx_spinlock = type opaque
define void @chx_spin_unlock(%struct.chx_spinlock* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N;
  scanf("%d", &N);
  printf("%d\n", 4 * N);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
shl    $0x2,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
shl    $0x2,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = shl nsw i32 %4, 2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int slib_get_kid(int lib_id, const char *name) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @slib_get_kid(i32 %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ GetChar();
void Init() { GetChar(); }


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

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

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

LLVM IR (-O2):
define void @Init() {
%1 = tail call i32 (...) @GetChar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_help() {
  printf(
      "\n"
      "Usage: udp_load_balancer [-h] [--port PORT] [--servers SERVERS]\n"
      "\n"
      "The options are as follows:\n"
      "      -h, --help            show this help message and exit\n"
      "      -p, --port PORT\n"
      "                            Port to listen UDP messages (min 1, max "
      "65535)\n"
      "      --host HOST or IP\n"
      "                            Bind the following Host or IP address to "
      "listen UDP messages (default: localhost)\n"
      "      -s, --servers SERVERS\n"
      "                            Servers list to balance the UDP messages\n"
      "                            Example: \"127.0.0.1:8123, localhost:8124, "
      "example.com:8123\"\n");
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [571 x i8] c"\0AUsage: udp_load_balancer [-h] [--port PORT] [--servers SERVERS]\0A\0AThe options are as follows:\0A -h, --help show this help message and exit\0A -p, --port PORT\0A Port to listen UDP messages (min 1, max 65535)\0A --host HOST or IP\0A Bind the following Host or IP address to listen UDP messages (default: localhost)\0A -s, --servers SERVERS\0A Servers list to balance the UDP messages\0A Example: \22127.0.0.1:8123, localhost:8124, example.com:8123\22\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([571 x i8], [571 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [570 x i8] c"\0AUsage: udp_load_balancer [-h] [--port PORT] [--servers SERVERS]\0A\0AThe options are as follows:\0A -h, --help show this help message and exit\0A -p, --port PORT\0A Port to listen UDP messages (min 1, max 65535)\0A --host HOST or IP\0A Bind the following Host or IP address to listen UDP messages (default: localhost)\0A -s, --servers SERVERS\0A Servers list to balance the UDP messages\0A Example: \22127.0.0.1:8123, localhost:8124, example.com:8123\22\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([570 x i8], [570 x i8]* @str, i64 0, i64 0))
ret void
}