xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *app, int err) {
  printf("usage: %s <-i interval> -- <app and args>\n", app);
  exit(err);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"usage: %s <-i interval> -- <app and args>\0A\00"
define void @usage(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 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [43 x i8] c"usage: %s <-i interval> -- <app and args>\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void funk2() {
  int a = 2;
  printf("%d", a);
}


x86 assembly (clang, -O0):
<funk2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funk2>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @funk2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int const);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *const, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void putserr_and_exitno(const int exit_value, const char *const str) {
  fputs(str, stderr);
  fputc('\n', stderr);
  exit(exit_value);
}


x86 assembly (clang, -O0):
<putserr_and_exitno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<putserr_and_exitno>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
mov    %edi,%ebx
mov    0x2ea0(%rip),%r14
mov    (%r14),%esi
mov    %rax,%rdi
call   1030 <fputs@plt>
mov    (%r14),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @putserr_and_exitno(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* @stderr
%7 = call i32 @fputs(i8* %5, i32 %6)
%8 = load i32, i32* @stderr
%9 = call i32 @fputc(i8 signext 10, i32 %8)
%10 = load i32, i32* %3
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @putserr_and_exitno(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* %1, i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputc(i8 signext 10, i32 %5)
%7 = tail call i32 @exit(i32 %0)
unreachable
}
void RTMemPoolAllocZ(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemPoolAllocZ() {
ret void
}
int truncate(const char *filename, long size) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @truncate(i8* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int common_stat(char const *, struct stat *, int);
int virt_lstat(const char *path, struct stat *buf) {
  return common_stat(path, buf, 0x00020000);
}


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

x86 assembly (clang, -O2):
<virt_lstat>:
mov    $0x20000,%edx
jmp    1030 <common_stat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @virt_lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @common_stat(i8* %5, %struct.stat* %6, i32 131072)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @virt_lstat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 @common_stat(i8* %0, %struct.stat* %1, i32 131072)
ret i32 %3
}
int QRinput_estimateBitsMode8(int size) { return size * 8; }


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

x86 assembly (clang, -O2):
<QRinput_estimateBitsMode8>:
lea    0x0(,%rdi,8),%eax
ret

LLVM IR (-O0):
define i32 @QRinput_estimateBitsMode8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 8
ret i32 %4
}

LLVM IR (-O2):
define i32 @QRinput_estimateBitsMode8(i32 %0) {
%2 = shl nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int yy_top_state();
int scanner_set_topstate(void) { return yy_top_state(); }


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

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

LLVM IR (-O0):
define i32 @scanner_set_topstate() {
%1 = call i32 (...) @yy_top_state()
ret i32 %1
}

LLVM IR (-O2):
define i32 @scanner_set_topstate() {
%1 = tail call i32 (...) @yy_top_state()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ syscall_handler();
void system_svc_handler(void) { syscall_handler(); }


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

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

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

LLVM IR (-O2):
define void @system_svc_handler() {
%1 = tail call i32 (...) @syscall_handler()
ret void
}
signed int signedint_ignoring_longlongint(signed int x, long long int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @signedint_ignoring_longlongint(i32 returned %0, i64 %1) {
ret i32 %0
}
void __VERIFIER_atomic_TAS(volatile int *v, volatile int *o) {
  *o = *v;
  *v = 1;
}


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

x86 assembly (clang, -O2):
<__VERIFIER_atomic_TAS>:
mov    (%rdi),%eax
mov    %eax,(%rsi)
movl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @__VERIFIER_atomic_TAS(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 volatile i32, i32* %5
%7 = load i32*, i32** %4
store volatile i32 %6, i32* %7
%8 = load i32*, i32** %3
store volatile i32 1, i32* %8
ret void
}

LLVM IR (-O2):
define void @__VERIFIER_atomic_TAS(i32* %0, i32* %1) {
%3 = load volatile i32, i32* %0
store volatile i32 %3, i32* %1
store volatile i32 1, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_data(int, int, int);
void all_off(void) {
  write_data(0x20, 0x12, 0x00);
  write_data(0x20, 0x13, 0x00);
  write_data(0x21, 0x12, 0x00);
  write_data(0x21, 0x13, 0x00);
}


x86 assembly (clang, -O0):
<all_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x12,%esi
xor    %edx,%edx
call   1030 <write_data@plt>
mov    $0x20,%edi
mov    $0x13,%esi
xor    %edx,%edx
call   1030 <write_data@plt>
mov    $0x21,%edi
mov    $0x12,%esi
xor    %edx,%edx
call   1030 <write_data@plt>
mov    $0x21,%edi
mov    $0x13,%esi
xor    %edx,%edx
call   1030 <write_data@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_off>:
push   %rax
mov    $0x20,%edi
mov    $0x12,%esi
xor    %edx,%edx
call   1030 <write_data@plt>
mov    $0x20,%edi
mov    $0x13,%esi
xor    %edx,%edx
call   1030 <write_data@plt>
mov    $0x21,%edi
mov    $0x12,%esi
xor    %edx,%edx
call   1030 <write_data@plt>
mov    $0x21,%edi
mov    $0x13,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <write_data@plt>

LLVM IR (-O0):
define void @all_off() {
%1 = call i32 @write_data(i32 32, i32 18, i32 0)
%2 = call i32 @write_data(i32 32, i32 19, i32 0)
%3 = call i32 @write_data(i32 33, i32 18, i32 0)
%4 = call i32 @write_data(i32 33, i32 19, i32 0)
ret void
}

LLVM IR (-O2):
define void @all_off() {
%1 = tail call i32 @write_data(i32 32, i32 18, i32 0)
%2 = tail call i32 @write_data(i32 32, i32 19, i32 0)
%3 = tail call i32 @write_data(i32 33, i32 18, i32 0)
%4 = tail call i32 @write_data(i32 33, i32 19, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
void print_prompt() {
  int delay = 100;
  printf("> \r");
  usleep(delay * 1000);
}


x86 assembly (clang, -O0):
<print_prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
imul   $0x3e8,-0x4(%rbp),%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_prompt>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x186a0,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"> \0D\00"
define void @print_prompt() {
%1 = alloca i32
store i32 100, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"> \0D\00"
define void @print_prompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @usleep(i32 100000)
ret void
}
int helloworld2(int a) { return a + 2; }


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

x86 assembly (clang, -O2):
<helloworld2>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @helloworld2(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
/* Variables and functions */
scalar_t__ do_one_task(int);
void *work(void *threadnum) {
  while (do_one_task((int)threadnum))
    ;
  return 0;
}


x86 assembly (clang, -O0):
<work>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <do_one_task@plt>
cmp    $0x0,%rax
je     1136 <work+0x26>
jmp    111c <work+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<work>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%edi
call   1030 <do_one_task@plt>
test   %rax,%rax
jne    1120 <work+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @work(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
%6 = call i64 @do_one_task(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @work(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
br label %4
4: ; preds = %4, %1
%5 = tail call i64 @do_one_task(i32 %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %4
7: ; preds = %4
ret i8* null
}
unsigned int I2CMasterSlaveAddrGet(unsigned int baseAdd,
                                   unsigned int slaveAdd) {
  return ((*((volatile unsigned int *)(baseAdd + (0xAC)))) & (0x000003FFu));
}


x86 assembly (clang, -O0):
<I2CMasterSlaveAddrGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xac,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x3ff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterSlaveAddrGet>:
add    $0xac,%edi
mov    $0x3ff,%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @I2CMasterSlaveAddrGet(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 = add i32 %5, 172
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, 1023
ret i32 %10
}

LLVM IR (-O2):
define i32 @I2CMasterSlaveAddrGet(i32 %0, i32 %1) {
%3 = add i32 %0, 172
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 1023
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;
typedef int /*<<< orphan*/ gmp_randstate_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_nextprime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_urandomb(int /*<<< orphan*/, int /*<<< orphan*/, int);
void GetPrime(mpz_t prime, gmp_randstate_t r_state) {
  mpz_t random;
  mpz_init(random);
  mpz_urandomb(random, r_state, 512);
  mpz_nextprime(prime, random);
  mpz_clear(random);
}


x86 assembly (clang, -O0):
<GetPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <mpz_init@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x200,%edx
call   1040 <mpz_urandomb@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <mpz_nextprime@plt>
mov    -0xc(%rbp),%edi
call   1060 <mpz_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPrime>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <mpz_init@plt>
mov    %ebx,%esi
mov    $0x200,%edx
call   1040 <mpz_urandomb@plt>
mov    %ebp,%edi
call   1050 <mpz_nextprime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mpz_clear@plt>

LLVM IR (-O0):
define void @GetPrime(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %5
%7 = call i32 @mpz_init(i32 %6)
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @mpz_urandomb(i32 %8, i32 %9, i32 512)
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = call i32 @mpz_nextprime(i32 %11, i32 %12)
%14 = load i32, i32* %5
%15 = call i32 @mpz_clear(i32 %14)
ret void
}

LLVM IR (-O2):
define void @GetPrime(i32 %0, i32 %1) {
%3 = tail call i32 @mpz_init(i32 undef)
%4 = tail call i32 @mpz_urandomb(i32 undef, i32 %1, i32 512)
%5 = tail call i32 @mpz_nextprime(i32 %0, i32 undef)
%6 = tail call i32 @mpz_clear(i32 undef)
ret void
}
/* Variables and functions */
int strlen(char *);
char lastCharOf(char *str) { return str[strlen(str) - 1]; }


x86 assembly (clang, -O0):
<lastCharOf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastCharOf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    -0x1(%rax,%rbx,1),%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @lastCharOf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = load i8, i8* %8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @lastCharOf(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
ret i8 %6
}
/* Variables and functions */
long double cosh(double);
__attribute__((weak)) long double coshl(long double x) {
  return cosh((double)x);
}


x86 assembly (clang, -O0):
<coshl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <cosh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coshl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <cosh@plt>

LLVM IR (-O0):
define weak x86_fp80 @coshl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @cosh(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define weak x86_fp80 @coshl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @cosh(double %2)
ret x86_fp80 %3
}
int test_imm_2Duint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x2D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Duint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 193273528320
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int errno;
int sendto(int, void const *, int, int, struct sockaddr const *, int);
int os_sendto(int s, const void *buf, int len, int flags,
              const struct sockaddr *to, int tolen) {
  int retval;
  retval = sendto(s, buf, len, flags, to, tolen);
  if (retval == -1)
    retval = -errno;
  return retval;
}


x86 assembly (clang, -O0):
<os_sendto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
call   1030 <sendto@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0xffffffff,-0x28(%rbp)
jne    1162 <os_sendto+0x52>
xor    %eax,%eax
mov    0x2e83(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_sendto>:
push   %rax
call   1030 <sendto@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
cmp    $0xffffffff,%eax
cmove  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @os_sendto(i32 %0, i8* %1, i32 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca %struct.sockaddr*
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store %struct.sockaddr* %4, %struct.sockaddr** %11
store i32 %5, i32* %12
%14 = load i32, i32* %7
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load %struct.sockaddr*, %struct.sockaddr** %11
%19 = load i32, i32* %12
%20 = call i32 @sendto(i32 %14, i8* %15, i32 %16, i32 %17, %struct.sockaddr* %18, i32 %19)
store i32 %20, i32* %13
%21 = load i32, i32* %13
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %26
23: ; preds = %6
%24 = load i32, i32* @errno
%25 = sub nsw i32 0, %24
store i32 %25, i32* %13
br label %26
26: ; preds = %23, %6
%27 = load i32, i32* %13
ret i32 %27
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @os_sendto(i32 %0, i8* %1, i32 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = tail call i32 @sendto(i32 %0, i8* %1, i32 %2, i32 %3, %struct.sockaddr* %4, i32 %5)
%8 = icmp eq i32 %7, -1
%9 = load i32, i32* @errno
%10 = sub nsw i32 0, %9
%11 = select i1 %8, i32 %10, i32 %7
ret i32 %11
}
/* Variables and functions */
double pow(double, double);
double hilln(double x, double n, double k) {
  return (pow(x, n) / (pow(x, n) + pow(k, n)) * (1.0 + pow(k, n)));
}


x86 assembly (clang, -O0):
<hilln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xe69(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hilln>:
sub    $0x28,%rsp
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <pow@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <pow@plt>
addsd  0xe78(%rip),%xmm0
mulsd  0x18(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @hilln(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = call double @pow(double %7, double %8)
%10 = load double, double* %4
%11 = load double, double* %5
%12 = call double @pow(double %10, double %11)
%13 = load double, double* %6
%14 = load double, double* %5
%15 = call double @pow(double %13, double %14)
%16 = fadd double %12, %15
%17 = fdiv double %9, %16
%18 = load double, double* %6
%19 = load double, double* %5
%20 = call double @pow(double %18, double %19)
%21 = fadd double 1.000000e+00, %20
%22 = fmul double %17, %21
ret double %22
}

LLVM IR (-O2):
define double @hilln(double %0, double %1, double %2) {
%4 = tail call double @pow(double %0, double %1)
%5 = tail call double @pow(double %0, double %1)
%6 = tail call double @pow(double %2, double %1)
%7 = fadd double %5, %6
%8 = fdiv double %4, %7
%9 = tail call double @pow(double %2, double %1)
%10 = fadd double %9, 1.000000e+00
%11 = fmul double %8, %10
ret double %11
}
const int getANSIColor(const int number) {
  int color = number % 15;
  const int a = color % 8;
  const int b = color / 8;
  int d = 30 + a;
  if (b > 0) {
    d += 60;
  }
  return (d);
}


x86 assembly (clang, -O0):
<getANSIColor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1e,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    114d <getANSIColor+0x4d>
mov    -0x14(%rbp),%eax
add    $0x3c,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getANSIColor>:
movslq %edi,%rcx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x3,%eax
add    %edx,%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ecx
mov    %ecx,%eax
sar    $0x7,%al
shr    $0x5,%al
add    %cl,%al
and    $0xf8,%al
mov    %ecx,%edx
sub    %al,%dl
movsbl %dl,%eax
lea    0x1e(%rax),%edx
add    $0x5a,%eax
cmp    $0x8,%ecx
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @getANSIColor(i32 %0) {
%2 = srem i32 %0, 15
%3 = trunc i32 %2 to i8
%4 = srem i8 %3, 8
%5 = sext i8 %4 to i32
%6 = icmp sgt i32 %2, 7
%7 = select i1 %6, i32 90, i32 30
%8 = add nsw i32 %7, %5
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *Function2PointerUint8(uint8_t *a, uint8_t *b) { return a + 1; }


x86 assembly (clang, -O0):
<Function2PointerUint8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Function2PointerUint8>:
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @Function2PointerUint8(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 = getelementptr inbounds i32, i32* %5, i64 1
ret i32* %6
}

LLVM IR (-O2):
define i32* @Function2PointerUint8(i32* readnone %0, i32* nocapture readnone %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
ret i32* %3
}
/* Variables and functions */
int urandom_open();
int mcfd_random_init(void) { return urandom_open(); }


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

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

LLVM IR (-O0):
define i32 @mcfd_random_init() {
%1 = call i32 (...) @urandom_open()
ret i32 %1
}

LLVM IR (-O2):
define i32 @mcfd_random_init() {
%1 = tail call i32 (...) @urandom_open()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ registerSignals();
void dummySignalHandler(int value) { registerSignals(); }


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

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

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

LLVM IR (-O2):
define void @dummySignalHandler(i32 %0) {
%2 = tail call i32 (...) @registerSignals()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("IDEFile to Disk Copy 4.2 image converter, version 1.1.\n"
         "(C) 2011 Natalia Portillo, All Rights Reserved.\n"
         "libdc32 (C) 2011 Ray Arachelian, All Rights Reserved.\n"
         "Under GPL license.\n\n"
         "Usage: IDEFileToDC42 IDEFile_Image.bin\n\n"
         "This utility will take an IDEFile image and convert it to a Disk "
         "Copy 4.2\n"
         "image suitable to be use on emulators.\n"
         "Filename will be \"idefile.dc42\".\n");
}


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

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

LLVM IR (-O0):
@.str = [364 x i8] c"IDEFile to Disk Copy 4.2 image converter, version 1.1.\0A(C) 2011 Natalia Portillo, All Rights Reserved.\0Alibdc32 (C) 2011 Ray Arachelian, All Rights Reserved.\0AUnder GPL license.\0A\0AUsage: IDEFileToDC42 IDEFile_Image.bin\0A\0AThis utility will take an IDEFile image and convert it to a Disk Copy 4.2\0Aimage suitable to be use on emulators.\0AFilename will be \22idefile.dc42\22.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([364 x i8], [364 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [363 x i8] c"IDEFile to Disk Copy 4.2 image converter, version 1.1.\0A(C) 2011 Natalia Portillo, All Rights Reserved.\0Alibdc32 (C) 2011 Ray Arachelian, All Rights Reserved.\0AUnder GPL license.\0A\0AUsage: IDEFileToDC42 IDEFile_Image.bin\0A\0AThis utility will take an IDEFile image and convert it to a Disk Copy 4.2\0Aimage suitable to be use on emulators.\0AFilename will be \22idefile.dc42\22.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([363 x i8], [363 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgiversion(unsigned int *, unsigned int *);
int cgihasversion(unsigned major, unsigned minor) {
  unsigned vmajor, vminor;
  cgiversion(&vmajor, &vminor);
  return (vmajor > major || (vmajor == major && vminor >= minor));
}


x86 assembly (clang, -O0):
<cgihasversion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <cgiversion@plt>
mov    -0xc(%rbp),%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0x11(%rbp)
ja     115f <cgihasversion+0x4f>
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x12(%rbp)
jne    1159 <cgihasversion+0x49>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
setae  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgihasversion>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <cgiversion@plt>
mov    $0x1,%eax
cmp    %ebp,0x4(%rsp)
ja     113d <cgihasversion+0x2d>
sete   %al
cmp    %ebx,(%rsp)
setae  %cl
and    %al,%cl
movzbl %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cgihasversion(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 @cgiversion(i32* %5, i32* %6)
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp ugt i32 %8, %9
br i1 %10, label %21, label %11
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %3
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i32, i32* %6
%17 = load i32, i32* %4
%18 = icmp uge i32 %16, %17
br label %19
19: ; preds = %15, %11
%20 = phi i1 [ false, %11 ], [ %18, %15 ]
br label %21
21: ; preds = %19, %2
%22 = phi i1 [ true, %2 ], [ %20, %19 ]
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @cgihasversion(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @cgiversion(i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = icmp ugt i32 %8, %0
br i1 %9, label %16, label %10
10: ; preds = %2
%11 = icmp eq i32 %8, %0
%12 = load i32, i32* %4
%13 = icmp uge i32 %12, %1
%14 = select i1 %11, i1 %13, i1 false
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %10, %2
%17 = phi i32 [ 1, %2 ], [ %15, %10 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ PrintWarning();
int /*<<< orphan*/ UpdateOptions();
void DoConnPassword() {
  UpdateOptions();
  PrintWarning();
}


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

x86 assembly (clang, -O2):
<DoConnPassword>:
push   %rax
xor    %eax,%eax
call   1040 <UpdateOptions@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <PrintWarning@plt>

LLVM IR (-O0):
define void @DoConnPassword() {
%1 = call i32 (...) @UpdateOptions()
%2 = call i32 (...) @PrintWarning()
ret void
}

LLVM IR (-O2):
define void @DoConnPassword() {
%1 = tail call i32 (...) @UpdateOptions()
%2 = tail call i32 (...) @PrintWarning()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M320_f(char *s) {
  debug("M320_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M320_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M320_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M320_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M320_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M320_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M320_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int get_line(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ trim_line(char *);
main() {
  int length;
  char line[1000];
  while ((length = get_line(line, 1000)) > 0) {
    trim_line(line);
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1183 <main+0x53>
lea    -0x3f0(%rbp),%rdi
call   1050 <trim_line@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jle    1184 <main+0x54>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1050 <trim_line@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_line(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @trim_line(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32 @get_line(i8* %2, i32 1000)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
int getAreaForLedY(int ind, int areasY) {
  return (int)(((float)ind / (float)((41) + (0) - (0))) * (float)areasY);
}


x86 assembly (clang, -O0):
<getAreaForLedY>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  0xee9(%rip),%xmm1
divss  %xmm1,%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAreaForLedY>:
cvtsi2ss %edi,%xmm0
divss  0xef4(%rip),%xmm0
cvtsi2ss %esi,%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @getAreaForLedY(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 = sitofp i32 %5 to float
%7 = fdiv float %6, 4.100000e+01
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
%10 = fmul float %7, %9
%11 = fptosi float %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @getAreaForLedY(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to float
%4 = fdiv float %3, 4.100000e+01
%5 = sitofp i32 %1 to float
%6 = fmul float %4, %5
%7 = fptosi float %6 to i32
ret i32 %7
}
void pgInitModule(void) {}


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

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

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

LLVM IR (-O2):
define void @pgInitModule() {
ret void
}
void gtk_init_with_args() {}


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

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

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

LLVM IR (-O2):
define void @gtk_init_with_args() {
ret void
}
int HelpItem30(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem30() {
ret i32 0
}
void ft_swap(char *p1, char *p2) {
  char tmp;
  tmp = *p1;
  *p1 = *p2;
  *p2 = tmp;
}


x86 assembly (clang, -O0):
<ft_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_swap>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @ft_swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
void gtk_file_chooser_set_show_hidden() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_set_show_hidden() {
ret void
}
int config_WITH_LB(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @config_WITH_LB() {
ret i32 1
}

LLVM IR (-O2):
define i32 @config_WITH_LB() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ m_message_log_close();
int m_message_term() {
  m_message_log_close();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @m_message_term() {
%1 = call i32 (...) @m_message_log_close()
ret i32 0
}

LLVM IR (-O2):
define i32 @m_message_term() {
%1 = tail call i32 (...) @m_message_log_close()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *curTime() {
  time_t t;
  t = time(NULL);
  return ctime(&t);
}


x86 assembly (clang, -O0):
<curTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curTime>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @curTime() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = call i8* @ctime(i32* %1)
ret i8* %3
}

LLVM IR (-O2):
define i8* @curTime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_version_string() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_version_string>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_version_string() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_version_string() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  for (;;) {
    printf("This loop will run forever.\n");
  }
  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>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [29 x i8] c"This loop will run forever.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@str = [28 x i8] c"This loop will run forever.\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %1
}
int test_imm_68uint16_reg(unsigned short val) {
  return ((val) & (0x68 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_68uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 104
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void dumpDirent() {}


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

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

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

LLVM IR (-O2):
define void @dumpDirent() {
ret void
}
double sq(const double d) { return d * d; }


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

x86 assembly (clang, -O2):
<sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Type definitions */
struct flist {
  int dummy;
};

/* Variables and functions */
bool lempty(const struct flist *fl) { return (NULL == fl); }


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

x86 assembly (clang, -O2):
<lempty>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.flist = type { i32 }
define i32 @lempty(%struct.flist* %0) {
%2 = alloca %struct.flist*
store %struct.flist* %0, %struct.flist** %2
%3 = load %struct.flist*, %struct.flist** %2
%4 = icmp eq %struct.flist* null, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
%struct.flist = type { i32 }
define i32 @lempty(%struct.flist* readnone %0) {
%2 = icmp eq %struct.flist* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}