xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ is_hex(char *);
char *is_hex_02b() {
  char phrase[] = "0xBEINGSNEAKY";
  do {
    if (!(!is_hex(phrase)))
      return "return false for non-hex strings that start with 0x";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<is_hex_02b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x16(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0xe(%rbp)
mov    0xed9(%rip),%ax
mov    %ax,-0xa(%rbp)
lea    -0x16(%rbp),%rdi
call   1030 <is_hex@plt>
cmp    $0x0,%eax
je     1159 <is_hex_02b+0x49>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1166 <is_hex_02b+0x56>
jmp    115e <is_hex_02b+0x4e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex_02b>:
sub    $0x18,%rsp
movabs $0x594b41454e5347,%rax
mov    %rax,0xe(%rsp)
movabs $0x53474e4945427830,%rax
4e 47 53
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <is_hex@plt>
xor    %ecx,%ecx
test   %eax,%eax
lea    0xec7(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.is_hex_02b.phrase = [14 x i8] c"0xBEINGSNEAKY\00"
@.str = [52 x i8] c"return false for non-hex strings that start with 0x\00"
define i8* @is_hex_02b() {
%1 = alloca i8*
%2 = alloca [14 x i8]
%3 = bitcast [14 x i8]* %2 to i8*
br label %4
4: ; preds = %0
%5 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%6 = call i32 @is_hex(i8* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
store i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8** %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %1
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@__const.is_hex_02b.phrase = [14 x i8] c"0xBEINGSNEAKY\00"
@.str = [52 x i8] c"return false for non-hex strings that start with 0x\00"
define i8* @is_hex_02b() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = call i32 @is_hex(i8* %2)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* null, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0)
ret i8* %5
}
/* Variables and functions */
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void read_stdin() {
  char c;
  for (;;) {
    if (read(0, &c, sizeof(char)) == 1)
      write(4, &c, sizeof(char));
  }
}


x86 assembly (clang, -O0):
<read_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
jne    1154 <read_stdin+0x34>
mov    $0x4,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    1128 <read_stdin+0x8>

x86 assembly (clang, -O2):
<read_stdin>:
push   %rbx
sub    $0x10,%rsp
lea    0xf(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x1,%eax
jne    1130 <read_stdin+0x10>
mov    $0x4,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    1130 <read_stdin+0x10>

LLVM IR (-O0):
define void @read_stdin() {
%1 = alloca i8
br label %2
2: ; preds = %7, %0
%3 = call i32 @read(i32 0, i8* %1, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = call i32 @write(i32 4, i8* %1, i32 1)
br label %7
7: ; preds = %5, %2
br label %2
}

LLVM IR (-O2):
define void @read_stdin() {
%1 = alloca i8
br label %2
2: ; preds = %7, %0
%3 = call i32 @read(i32 0, i8* %1, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = call i32 @write(i32 4, i8* %1, i32 1)
br label %7
7: ; preds = %5, %2
br label %2
}
/* Variables and functions */
float fscan_float(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
float scan_float() { return fscan_float(stdin); }


x86 assembly (clang, -O0):
<scan_float>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <fscan_float@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_float>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fscan_float@plt>

LLVM IR (-O0):
@stdin = global i32 0
define float @scan_float() {
%1 = load i32, i32* @stdin
%2 = call float @fscan_float(i32 %1)
ret float %2
}

LLVM IR (-O2):
@stdin = global i32 0
define float @scan_float() {
%1 = load i32, i32* @stdin
%2 = tail call float @fscan_float(i32 %1)
ret float %2
}
int devfs_mk_dir(const char *fmt, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @devfs_mk_dir(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t *getaddress2(void) {
  static int64_t ret;
  return &ret;
}


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

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

LLVM IR (-O0):
@getaddress2.ret = internal global i32 0
define i32* @getaddress2() {
ret i32* @getaddress2.ret
}

LLVM IR (-O2):
@getaddress2.ret = internal global i32 0
define i32* @getaddress2() {
ret i32* @getaddress2.ret
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ntlmv2_create_response(int /*<<< orphan*/ const *,
                                          char const *, char const *,
                                          int /*<<< orphan*/ const *,
                                          int /*<<< orphan*/ *,
                                          int /*<<< orphan*/ *);
void lmv2_create_response(const uint8_t ntlm[16], const char *username,
                          const char *domain, const uint8_t challenge[8],
                          uint8_t *result, uint8_t *result_size) {
  ntlmv2_create_response(ntlm, username, domain, challenge, result,
                         result_size);
}


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

x86 assembly (clang, -O2):
<lmv2_create_response>:
jmp    1030 <ntlmv2_create_response@plt>

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

LLVM IR (-O2):
define void @lmv2_create_response(i32* %0, i8* %1, i8* %2, i32* %3, i32* %4, i32* %5) {
%7 = tail call i32 @ntlmv2_create_response(i32* %0, i8* %1, i8* %2, i32* %3, i32* %4, i32* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ *makefd_xprt(int, int /*<<< orphan*/, int /*<<< orphan*/);
SVCXPRT *svcfd_create(int fd, u_int sendsize, u_int recvsize) {
  return makefd_xprt(fd, sendsize, recvsize);
}


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

x86 assembly (clang, -O2):
<svcfd_create>:
jmp    1030 <makefd_xprt@plt>

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

LLVM IR (-O2):
define i32* @svcfd_create(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32* @makefd_xprt(i32 %0, i32 %1, i32 %2)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int stringFormatting() {
  char characterName[] = "John";
  int characterAge = 35;
  printf("There was once a man named %s.\n", characterName);
  printf("He was %d years old.\n", characterAge);
  return 0;
}


x86 assembly (clang, -O0):
<stringFormatting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xedd(%rip),%al
mov    %al,-0x1(%rbp)
movl   $0x23,-0xc(%rbp)
lea    -0x5(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringFormatting>:
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0x6e686f4a,(%rsp)
lea    0xee1(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x23,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.stringFormatting.characterName = [5 x i8] c"John\00"
@.str = [32 x i8] c"There was once a man named %s.\0A\00"
@.str.1 = [22 x i8] c"He was %d years old.\0A\00"
define i32 @stringFormatting() {
%1 = alloca [5 x i8]
%2 = alloca i32
%3 = bitcast [5 x i8]* %1 to i8*
store i32 35, i32* %2
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.stringFormatting.characterName = [5 x i8] c"John\00"
@.str = [32 x i8] c"There was once a man named %s.\0A\00"
@.str.1 = [22 x i8] c"He was %d years old.\0A\00"
define i32 @stringFormatting() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 35)
ret i32 0
}
int clockevent_probe(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @clockevent_probe() {
ret i32 0
}
int execute_listxattr() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_listxattr() {
ret i32 0
}
unsigned int modulo_unsigned(unsigned int a, unsigned int b) { return a % b; }


x86 assembly (clang, -O0):
<modulo_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo_unsigned>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @modulo_unsigned(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 = urem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @modulo_unsigned(i32 %0, i32 %1) {
%3 = urem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void assert2() { printf(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @assert2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @assert2() {
ret void
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main(int argc, char *argv[]) {
  int id = 0;
  int i = 0;
  int m = 0;
  int x = 2;
#pragma omp parallel private(id, i) shared(m) default(shared)
  {
    id = omp_get_thread_num();
    if (id == 0) {
      i = 3;
      m = 17;
      x++;
    }
    printf("Thread %d: %d %d %d\n", id, i, m, x);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x2,-0x20(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    117d <main+0x5d>
movl   $0x3,-0x18(%rbp)
movl   $0x11,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
xor    %r8d,%r8d
test   %eax,%eax
sete   %r8b
lea    (%r8,%r8,2),%edx
mov    $0x11,%ecx
cmovne %ebx,%ecx
or     $0x2,%r8d
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"Thread %d: %d %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 3, i32 0
%6 = select i1 %4, i32 17, i32 0
%7 = select i1 %4, i32 3, i32 2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %6, i32 %7)
ret i32 0
}
void bld_track_load_deactivate(struct rq *rq) {}


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

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

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

LLVM IR (-O2):
%struct.rq = type opaque
define void @bld_track_load_deactivate(%struct.rq* nocapture %0) {
ret void
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  int /*<<< orphan*/ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
unsigned int sleep(unsigned int seconds) {
  struct timespec treq = {.tv_sec = seconds, .tv_nsec = 0};
  struct timespec trem = {.tv_sec = 0, .tv_nsec = 0};
  nanosleep(&treq, &trem);
  return (unsigned int)trem.tv_sec;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <nanosleep@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
sub    $0x18,%rsp
mov    %edi,0x10(%rsp)
movl   $0x0,0x14(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <nanosleep@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @sleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
store i32 %0, i32* %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%6 = load i32, i32* %2
store i32 %6, i32* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 0, i32* %7
%8 = bitcast %struct.timespec* %4 to i8*
%9 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %4)
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca i64
%4 = bitcast i64* %3 to %struct.timespec*
%5 = bitcast %struct.timespec* %2 to i8*
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %0, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 0, i32* %7
%8 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%9 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %4)
%10 = bitcast i64* %3 to i32*
%11 = load i32, i32* %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Course: EG1302 - Spring 2014\n");
  printf("Name: Sultan Mabrouk\n");
  printf("Date Created: %d/%d/%d\n", 01, 28, 2014);
  printf("Assignment: Assignment.05 \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x1,%esi
mov    $0x1c,%edx
mov    $0x7de,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeed(%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    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x1,%esi
mov    $0x1c,%edx
mov    $0x7de,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Course: EG1302 - Spring 2014\0A\00"
@.str.1 = [22 x i8] c"Name: Sultan Mabrouk\0A\00"
@.str.2 = [24 x i8] c"Date Created: %d/%d/%d\0A\00"
@.str.3 = [28 x i8] c"Assignment: Assignment.05 \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 2014)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [24 x i8] c"Date Created: %d/%d/%d\0A\00"
@str = [29 x i8] c"Course: EG1302 - Spring 2014\00"
@str.4 = [21 x i8] c"Name: Sultan Mabrouk\00"
@str.5 = [27 x i8] c"Assignment: Assignment.05 \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 2014)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
int isNum(char ch) { return '0' <= ch && ch <= '9'; }


x86 assembly (clang, -O0):
<isNum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <isNum+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNum>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isNum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isNum(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *calloc(int, unsigned int);
int /*<<< orphan*/ fatal(char *);
void *xmalloc(unsigned int sz) {
  void *n = calloc(1, sz);
  if (n == NULL) {
    fatal("Out of memeory");
  }
  return n;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <xmalloc+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1141 <xmalloc+0x21>
lea    0xec4(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memeory\00"
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @calloc(i32 1, i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ bal();
int /*<<< orphan*/ fel();
int /*<<< orphan*/ jobbra();
int /*<<< orphan*/ le();
void mozgas_beker(int ch) {
  switch (ch) {
  case 'w':
    fel();
    break;
  case 'd':
    jobbra();
    break;
  case 'a':
    bal();
    break;
  case 's':
    le();
    break;
  }
}


x86 assembly (clang, -O0):
<mozgas_beker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x16,%eax
ja     119f <mozgas_beker+0x5f>
mov    -0x10(%rbp),%rax
lea    0xe95(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1050 <fel@plt>
jmp    119f <mozgas_beker+0x5f>
mov    $0x0,%al
call   1060 <jobbra@plt>
jmp    119f <mozgas_beker+0x5f>
mov    $0x0,%al
call   1030 <bal@plt>
jmp    119f <mozgas_beker+0x5f>
mov    $0x0,%al
call   1040 <le@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mozgas_beker>:
add    $0xffffff9f,%edi
cmp    $0x16,%edi
ja     115f <mozgas_beker+0x1f>
lea    0xeb1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %eax,%eax
jmp    1030 <bal@plt>
ret
xor    %eax,%eax
jmp    1060 <jobbra@plt>
xor    %eax,%eax
jmp    1040 <le@plt>
xor    %eax,%eax
jmp    1050 <fel@plt>

LLVM IR (-O0):
define void @mozgas_beker(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %12 [
i32 119, label %4
i32 100, label %6
i32 97, label %8
i32 115, label %10
]
4: ; preds = %1
%5 = call i32 (...) @fel()
br label %12
6: ; preds = %1
%7 = call i32 (...) @jobbra()
br label %12
8: ; preds = %1
%9 = call i32 (...) @bal()
br label %12
10: ; preds = %1
%11 = call i32 (...) @le()
br label %12
12: ; preds = %1, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
define void @mozgas_beker(i32 %0) {
switch i32 %0, label %10 [
i32 119, label %2
i32 100, label %4
i32 97, label %6
i32 115, label %8
]
2: ; preds = %1
%3 = tail call i32 (...) @fel()
br label %10
4: ; preds = %1
%5 = tail call i32 (...) @jobbra()
br label %10
6: ; preds = %1
%7 = tail call i32 (...) @bal()
br label %10
8: ; preds = %1
%9 = tail call i32 (...) @le()
br label %10
10: ; preds = %1, %8, %6, %4, %2
ret void
}
int linearSearch(int *a, int n, int key) {
  int i;
  for (i = 0; i <= n - 1; i++) {
    if (a[i] == key)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<linearSearch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1158 <linearSearch+0x58>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1145 <linearSearch+0x45>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <linearSearch+0x5f>
jmp    114a <linearSearch+0x4a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <linearSearch+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearSearch>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <linearSearch+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <linearSearch+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <linearSearch+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @linearSearch(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %25, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = sub nsw i32 %11, 1
%13 = icmp sle i32 %10, %12
br i1 %13, label %14, label %28
14: ; preds = %9
%15 = load i32*, i32** %5
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %7
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %14
%23 = load i32, i32* %8
store i32 %23, i32* %4
br label %29
24: ; preds = %14
br label %25
25: ; preds = %24
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
br label %9
28: ; preds = %9
store i32 -1, i32* %4
br label %29
29: ; preds = %28, %22
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @linearSearch(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
int xmlUCSIsHiragana(int code) {
  return (((code >= 0x3040) && (code <= 0x309F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsHiragana>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x3040,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsHiragana+0x26>
cmpl   $0x309f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsHiragana>:
add    $0xffffcfc0,%edi
xor    %eax,%eax
cmp    $0x60,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsHiragana(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 12352
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 12447
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsHiragana(i32 %0) {
%2 = add i32 %0, -12352
%3 = icmp ult i32 %2, 96
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int isnan(float f) {
  unsigned long *pl = (unsigned long *)&f;
  return (*pl & 0x7fffffff) > 0x7f800000;
}


x86 assembly (clang, -O0):
<isnan>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
and    $0x7fffffff,%rax
cmp    $0x7f800000,%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnan>:
movss  %xmm0,-0x8(%rsp)
mov    $0x7fffffff,%ecx
and    -0x8(%rsp),%ecx
xor    %eax,%eax
cmp    $0x7f800001,%ecx
setae  %al
ret

LLVM IR (-O0):
define i32 @isnan(float %0) {
%2 = alloca float
%3 = alloca i64*
store float %0, float* %2
%4 = bitcast float* %2 to i64*
store i64* %4, i64** %3
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = and i64 %6, 2147483647
%8 = icmp ugt i64 %7, 2139095040
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @isnan(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = bitcast float* %2 to i64*
%4 = load i64, i64* %3
%5 = and i64 %4, 2147483647
%6 = icmp ugt i64 %5, 2139095040
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float, int, float);
f(int i, float f, int j, float g) { printf("%d %.2f %d %.2f\n", i, f, j, g); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
mov    -0x10(%rbp),%edx
movss  -0x14(%rbp),%xmm1
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%d %.2f %d %.2f\0A\00"
define i32 @f(i32 %0, float %1, i32 %2, float %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca i32
%9 = alloca float
store i32 %0, i32* %6
store float %1, float* %7
store i32 %2, i32* %8
store float %3, float* %9
%10 = load i32, i32* %6
%11 = load float, float* %7
%12 = load i32, i32* %8
%13 = load float, float* %9
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10, float %11, i32 %12, float %13)
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [17 x i8] c"%d %.2f %d %.2f\0A\00"
define i32 @f(i32 %0, float %1, i32 %2, float %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0, float %1, i32 %2, float %3)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_OK;
int scmUnlock(sqlite3_file *pFile, int eLock) { return SQLITE_OK; }


x86 assembly (clang, -O0):
<scmUnlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scmUnlock>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@SQLITE_OK = global i32 0
define i32 @scmUnlock(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @SQLITE_OK
ret i32 %3
}
/* Variables and functions */
unsigned int pow(int, unsigned int);
unsigned int checkN(unsigned int n) {
  unsigned int i = 0;
  for (i = 0;; i++) {
    if (n <= pow(2, i))
      return (pow(2, i) - n);
  }
}


x86 assembly (clang, -O0):
<checkN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
ja     115f <checkN+0x4f>
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
call   1030 <pow@plt>
sub    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1164 <checkN+0x54>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <checkN+0x19>

x86 assembly (clang, -O2):
<checkN>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xffffffff,%ebp
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    $0x2,%edi
mov    %ebp,%esi
call   1030 <pow@plt>
cmp    %ebx,%eax
jb     1120 <checkN+0x10>
mov    $0x2,%edi
mov    %ebp,%esi
call   1030 <pow@plt>
sub    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @checkN(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = tail call i32 @pow(i32 2, i32 %3)
%5 = icmp ult i32 %4, %0
%6 = add i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
%8 = tail call i32 @pow(i32 2, i32 %3)
%9 = sub i32 %8, %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ atexit(int /*<<< orphan*/);
void nullPointer_atexit(void) { (void)atexit(0); }


x86 assembly (clang, -O0):
<nullPointer_atexit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1120 <atexit>
pop    %rbp
ret
nopl   (%rax)

x86 assembly (clang, -O2):
<nullPointer_atexit>:
xor    %edi,%edi
jmp    1120 <atexit>
nopw   0x0(%rax,%rax,1)

LLVM IR (-O0):
define void @nullPointer_atexit() {
%1 = call i32 @atexit(i32 0)
ret void
}

LLVM IR (-O2):
define void @nullPointer_atexit() {
%1 = tail call i32 @atexit(i32 0)
ret void
}
void av_pix_fmt_get_chroma_sub_sample() {}


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

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

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

LLVM IR (-O2):
define void @av_pix_fmt_get_chroma_sub_sample() {
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ vmwos_core_poke(int);
int main(int argc, char **argv) {
  int which = 0;
  if (argc > 1) {
    which = atoi(argv[1]);
  }
  printf("Poking core%d\n", which);
  vmwos_core_poke(which);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1167 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <vmwos_core_poke@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cmp    $0x2,%edi
jl     1143 <main+0x13>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <vmwos_core_poke@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Poking core%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
%10 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = tail call i32 @vmwos_core_poke(i32 %9)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long visualid;
};
typedef TYPE_1__ Visual;

/* Variables and functions */
void set_Visual_visualid(void *_p, unsigned long _v) {
  ((Visual *)_p)->visualid = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_Visual_visualid(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_Visual_visualid(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
struct tm *get_time() {
  time_t timestamp;
  struct tm *date;
  time(&timestamp);
  date = gmtime(&timestamp);
  return date;
}


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

x86 assembly (clang, -O2):
<get_time>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <time@plt>
mov    %rbx,%rdi
call   1040 <gmtime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @get_time() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @gmtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
ret %struct.tm* %5
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @get_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @gmtime(i32* %1)
ret %struct.tm* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void I2CMasterDisable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(0x40002000 + 0x00000804))) = 0;
  (*((volatile unsigned long
          *)(((unsigned long)(0x40002000 + 0x00000820) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x40002000 + 0x00000820) & 0x000FFFFF) << 5) |
             ((4) << 2)))) = 0;
}


x86 assembly (clang, -O0):
<I2CMasterDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x40002804,%eax
movq   $0x0,(%rax)
mov    $0x42050410,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterDisable>:
movq   $0x0,0x40002804
movq   $0x0,0x42050410
ret

LLVM IR (-O0):
define void @I2CMasterDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store volatile i64 0, i64* inttoptr (i64 1073752068 to i64*)
store volatile i64 0, i64* inttoptr (i64 1107624976 to i64*)
ret void
}

LLVM IR (-O2):
define void @I2CMasterDisable(i32 %0) {
store volatile i64 0, i64* inttoptr (i64 1073752068 to i64*)
store volatile i64 0, i64* inttoptr (i64 1107624976 to i64*)
ret void
}
void vo_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @vo_lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, char);
void t3() {
  char *c = "ab" + 1;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/"
          "pointer.c",
          18, 98, *c);
  ;
}


x86 assembly (clang, -O0):
<t3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xed1(%rip),%rdi
mov    $0x12,%esi
mov    $0x62,%edx
movsbl (%rax),%ecx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t3>:
lea    0xee9(%rip),%rdi
mov    $0x12,%esi
mov    $0x62,%edx
mov    $0x62,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ab\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/pointer.c\00"
define void @t3() {
%1 = alloca i8*
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 1), i8** %1
%2 = load i8*, i8** %1
%3 = load i8, i8* %2
%4 = call i32 @fexpect(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 18, i32 98, i8 signext %3)
ret void
}

LLVM IR (-O2):
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/pointer.c\00"
define void @t3() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 18, i32 98, i8 signext 98)
ret void
}
unsigned xrop3_36_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk1 = S ^ T;
  stk2 = D ^ S;
  stk1 = stk1 & stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_36_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_36_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
xor    %eax,%ecx
xor    $0xff,%eax
and    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_36_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %8
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = xor i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_36_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, %4
%8 = xor i32 %4, 255
%9 = and i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ add_prog_1(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *host;
  if (argc < 2) {
    printf("usage: %s server_host\n", argv[0]);
    exit(1);
  }
  host = argv[1];
  add_prog_1(host);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    116d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <add_prog_1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     114f <main+0x1f>
mov    (%rsi),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x8(%rsi),%rdi
call   1040 <add_prog_1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"usage: %s server_host\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = call i32 @add_prog_1(i8* %19)
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"usage: %s server_host\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @add_prog_1(i8* %10)
%12 = tail call i32 @exit(i32 0)
unreachable
}