xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ _geteuid();
uid_t geteuid(void) { return _geteuid(); }


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

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

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

LLVM IR (-O2):
define i32 @geteuid() {
%1 = tail call i32 (...) @_geteuid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr,
          "Usage: %s [-d] "
          "[-s server] [-p port] [-k keyfile] [-l logfile] [-u user] [-N dir] "
          "-e pid/eid\n",
          progname);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [94 x i8] c"Usage: %s [-d] [-s server] [-p port] [-k keyfile] [-l logfile] [-u user] [-N dir] -e pid/eid\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [94 x i8] c"Usage: %s [-d] [-s server] [-p port] [-k keyfile] [-l logfile] [-u user] [-N dir] -e pid/eid\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
void got_tok_objNoWs(const char *yytext) {
  FUNC_STATFN_PRN(__PRETTY_FUNCTION__, " (%s)", yytext);
}


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

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

LLVM IR (-O0):
@__PRETTY_FUNCTION__.got_tok_objNoWs = [35 x i8] c"void got_tok_objNoWs(const char *)\00"
@.str = [6 x i8] c" (%s)\00"
define void @got_tok_objNoWs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @FUNC_STATFN_PRN to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__PRETTY_FUNCTION__.got_tok_objNoWs, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@__PRETTY_FUNCTION__.got_tok_objNoWs = [35 x i8] c"void got_tok_objNoWs(const char *)\00"
@.str = [6 x i8] c" (%s)\00"
define void @got_tok_objNoWs(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @FUNC_STATFN_PRN to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__PRETTY_FUNCTION__.got_tok_objNoWs, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void funct1(int a, int b) {
  int c = a * b;
  int d = (a * b) / 5;
  int e = 500 / (a * b);
  printf("The results are c=%d  d=%d  e=%d\n", c, d, e);
}


x86 assembly (clang, -O0):
<funct1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    $0x1f4,%eax
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funct1>:
imul   %esi,%edi
movslq %edi,%rsi
imul   $0x66666667,%rsi,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x21,%rcx
add    %eax,%ecx
mov    $0x1f4,%eax
xor    %edx,%edx
idiv   %esi
lea    0xec6(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"The results are c=%d d=%d e=%d\0A\00"
define void @funct1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = mul nsw i32 %11, %12
%14 = sdiv i32 %13, 5
store i32 %14, i32* %6
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
%18 = sdiv i32 500, %17
store i32 %18, i32* %7
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"The results are c=%d d=%d e=%d\0A\00"
define void @funct1(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sdiv i32 %3, 5
%5 = sdiv i32 500, %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
ret void
}
void flush_dcache_page(struct page *page) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @flush_dcache_page(%struct.page* nocapture %0) {
ret void
}
void cpu_id_info_core_release() { return; }


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

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

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

LLVM IR (-O2):
define void @cpu_id_info_core_release() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nxtDisplayCenteredTextLine(int, char *, int);
void displayNumberCentre(int num) { nxtDisplayCenteredTextLine(3, "%d", num); }


x86 assembly (clang, -O0):
<displayNumberCentre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x3,%edi
lea    0xed6(%rip),%rsi
call   1030 <nxtDisplayCenteredTextLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayNumberCentre>:
mov    %edi,%edx
lea    0xee7(%rip),%rsi
mov    $0x3,%edi
jmp    1030 <nxtDisplayCenteredTextLine@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @displayNumberCentre(i32 %0) {
%2 = tail call i32 @nxtDisplayCenteredTextLine(i32 3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void signal_error(int64_t errn) {
  switch (errn) {
  case 0:
    printf("array bounds error\n");
    break;
  case 1:
    printf("null pointer dereference\n");
    break;
  default:
    printf("unknown runtime error\n");
    break;
  }
  exit(1);
}


x86 assembly (clang, -O0):
<signal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     114f <signal_error+0x2f>
jmp    113e <signal_error+0x1e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1160 <signal_error+0x40>
jmp    1171 <signal_error+0x51>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <signal_error+0x5d>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <signal_error+0x5d>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<signal_error>:
push   %rax
cmp    $0x1,%edi
lea    0xed5(%rip),%rax
lea    0xefa(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xeda(%rip),%rdi
cmovne %rcx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"array bounds error\0A\00"
@.str.1 = [26 x i8] c"null pointer dereference\0A\00"
@.str.2 = [23 x i8] c"unknown runtime error\0A\00"
define void @signal_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 0, label %4
i32 1, label %6
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6, %4
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [25 x i8] c"null pointer dereference\00"
@str.3 = [19 x i8] c"array bounds error\00"
@str.4 = [22 x i8] c"unknown runtime error\00"
define void @signal_error(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str.4, i64 0, i64 0)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0), i8* %3
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned long gp2x_joystick_read(int);
void gp2x_joystick_wait(int joystick, unsigned long combination) {
  while (gp2x_joystick_read(joystick) != combination)
    ;
  while (gp2x_joystick_read(joystick) == combination)
    ;
}


x86 assembly (clang, -O0):
<gp2x_joystick_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <gp2x_joystick_read@plt>
cmp    -0x10(%rbp),%rax
je     1136 <gp2x_joystick_wait+0x26>
jmp    111f <gp2x_joystick_wait+0xf>
jmp    113b <gp2x_joystick_wait+0x2b>
mov    -0x4(%rbp),%edi
call   1030 <gp2x_joystick_read@plt>
cmp    -0x10(%rbp),%rax
jne    1152 <gp2x_joystick_wait+0x42>
jmp    113b <gp2x_joystick_wait+0x2b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gp2x_joystick_wait>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <gp2x_joystick_read@plt>
cmp    %rbx,%rax
jne    1120 <gp2x_joystick_wait+0x10>
nopl   0x0(%rax)
mov    %ebp,%edi
call   1030 <gp2x_joystick_read@plt>
cmp    %rbx,%rax
je     1130 <gp2x_joystick_wait+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @gp2x_joystick_wait(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
br label %5
5: ; preds = %10, %2
%6 = load i32, i32* %3
%7 = call i64 @gp2x_joystick_read(i32 %6)
%8 = load i64, i64* %4
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %5
br label %5
11: ; preds = %5
br label %12
12: ; preds = %17, %11
%13 = load i32, i32* %3
%14 = call i64 @gp2x_joystick_read(i32 %13)
%15 = load i64, i64* %4
%16 = icmp eq i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %12
br label %12
18: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @gp2x_joystick_wait(i32 %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @gp2x_joystick_read(i32 %0)
%5 = icmp eq i64 %4, %1
br i1 %5, label %6, label %3
6: ; preds = %3, %6
%7 = tail call i64 @gp2x_joystick_read(i32 %0)
%8 = icmp eq i64 %7, %1
br i1 %8, label %6, label %9
9: ; preds = %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ listifaces();
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  listifaces();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <listifaces@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @listifaces()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint64_t;

/* Variables and functions */
uint64_t getblock(const uint64_t *p, int i) { return p[i]; }


x86 assembly (clang, -O0):
<getblock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getblock>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @getblock(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @getblock(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
void halt() { __asm__ volatile("hlt"); }


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

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

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

LLVM IR (-O2):
define void @halt() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t si470x_seekdown() {}


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

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

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

LLVM IR (-O2):
define i32 @si470x_seekdown() {
ret i32 undef
}
int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.snd_info_buffer = type opaque
define i32 @snd_info_get_line(%struct.snd_info_buffer* %0, i8* %1, i32 %2) {
%4 = alloca %struct.snd_info_buffer*
%5 = alloca i8*
%6 = alloca i32
store %struct.snd_info_buffer* %0, %struct.snd_info_buffer** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.snd_info_buffer = type opaque
define i32 @snd_info_get_line(%struct.snd_info_buffer* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "Summary: %s [-help] [-version] [options] [FILE]...\n",
          progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Summary: %s [-help] [-version] [options] [FILE]...\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Summary: %s [-help] [-version] [options] [FILE]...\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void ft_ultimate_div_mod(int *a, int *b) {
  int c;
  c = *a / *b;
  *b = *a % *b;
  *a = c;
}


x86 assembly (clang, -O0):
<ft_ultimate_div_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cltd
idivl  (%rcx)
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cltd
idivl  (%rcx)
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ultimate_div_mod>:
mov    (%rdi),%eax
cltd
idivl  (%rsi)
mov    %edx,(%rsi)
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @ft_ultimate_div_mod(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** %3
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = sdiv i32 %7, %9
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = srem i32 %12, %14
%16 = load i32*, i32** %4
store i32 %15, i32* %16
%17 = load i32, i32* %5
%18 = load i32*, i32** %3
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @ft_ultimate_div_mod(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sdiv i32 %3, %4
%6 = srem i32 %3, %4
store i32 %6, i32* %1
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outop2str(char *);
void outleasp() { outop2str("LEAS\t"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"LEAS\09\00"
define void @outleasp() {
%1 = call i32 @outop2str(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"LEAS\09\00"
define void @outleasp() {
%1 = tail call i32 @outop2str(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void GPMCNANDAddrWrite(unsigned int baseAddr, unsigned int csNum,
                       unsigned int addr) {
  (*((volatile unsigned int *)(baseAddr + (0x80 + (csNum * (0x30)))))) = addr;
}


x86 assembly (clang, -O0):
<GPMCNANDAddrWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%edx
add    $0x80,%edx
add    %edx,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCNANDAddrWrite>:
lea    (%rsi,%rsi,2),%eax
shl    $0x4,%eax
add    %edi,%eax
add    $0x80,%eax
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPMCNANDAddrWrite(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* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = mul i32 %9, 48
%11 = add i32 128, %10
%12 = add i32 %8, %11
%13 = zext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %7, i32* %14
ret void
}

LLVM IR (-O2):
define void @GPMCNANDAddrWrite(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 48
%5 = add i32 %0, 128
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %2, i32* %8
ret void
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_52(int Salt, int Parameter) {
  unsigned b = Salt ^ 0x10DF1038;
  return yahoo_M1Common(b, Parameter);
}


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

x86 assembly (clang, -O2):
<yahoo_f01_52>:
xor    $0x10df1038,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_52(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* %3
%7 = xor i32 %6, 283054136
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @yahoo_M1Common(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @yahoo_f01_52(i32 %0, i32 %1) {
%3 = xor i32 %0, 283054136
%4 = tail call i32 @yahoo_M1Common(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ kputs(char *);
int /*<<< orphan*/ kterpri();
__attribute__((regparm(0))) void kernelMain(void) {
  kputs("kputs!");
  kterpri();
  kputs("and again");
}


x86 assembly (clang, -O0):
<kernelMain>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <kputs@plt>
mov    $0x0,%al
call   1030 <kterpri@plt>
lea    0xec9(%rip),%rdi
call   1040 <kputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernelMain>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <kputs@plt>
xor    %eax,%eax
call   1030 <kterpri@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <kputs@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"kputs!\00"
@.str.1 = [10 x i8] c"and again\00"
define void @kernelMain() {
%1 = call i32 @kputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @kterpri()
%3 = call i32 @kputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"kputs!\00"
@.str.1 = [10 x i8] c"and again\00"
define void @kernelMain() {
%1 = tail call i32 @kputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @kterpri()
%3 = tail call i32 @kputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void HandleSigTerm(int s) { exit(0); }


x86 assembly (clang, -O0):
<HandleSigTerm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<HandleSigTerm>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @HandleSigTerm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @HandleSigTerm(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  unsigned int x = 0;
  while (x < 0x0fffffff) {
    if (x < 0xfff0) {
      x++;
    } else {
      x += 2;
    }
  }
  __VERIFIER_assert(!(x % 2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xfffffff,-0x8(%rbp)
jae    115c <main+0x4c>
cmpl   $0xfff0,-0x8(%rbp)
jae    114e <main+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1157 <main+0x47>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0xfff0,%edi
sbb    $0x0,%edi
add    $0x2,%edi
cmp    $0xfffffff,%edi
jb     1120 <main+0x10>
push   %rax
not    %edi
and    $0x1,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %15, %0
%4 = load i32, i32* %2
%5 = icmp ult i32 %4, 268435455
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp ult i32 %7, 65520
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add i32 %10, 1
store i32 %11, i32* %2
br label %15
12: ; preds = %6
%13 = load i32, i32* %2
%14 = add i32 %13, 2
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %9
br label %3
16: ; preds = %3
%17 = load i32, i32* %2
%18 = urem i32 %17, 2
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
%22 = call i32 @__VERIFIER_assert(i32 %21)
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = icmp ult i32 %2, 65520
%4 = select i1 %3, i32 1, i32 2
%5 = add nuw nsw i32 %4, %2
%6 = icmp ult i32 %5, 268435455
br i1 %6, label %1, label %7
7: ; preds = %1
%8 = and i32 %5, 1
%9 = xor i32 %8, 1
%10 = tail call i32 @__VERIFIER_assert(i32 %9)
ret i32 0
}
/* Variables and functions */
scalar_t__ INT32_MAX;
scalar_t__ rand();
int rand_sign() {
  return (float)rand() / ((float)INT32_MAX / 2.0f) <= 0.5 ? -1 : 1;
}


x86 assembly (clang, -O0):
<rand_sign>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2eb9(%rip),%rax
cvtsi2ssq (%rax),%xmm1
movss  0xed4(%rip),%xmm2
divss  %xmm2,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb8(%rip),%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmovae %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_sign>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ebc(%rip),%rax
cvtsi2ssq (%rax),%xmm1
movss  0xecf(%rip),%xmm2
mulss  %xmm2,%xmm1
divss  %xmm1,%xmm0
xor    %eax,%eax
ucomiss %xmm0,%xmm2
setb   %al
add    %eax,%eax
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@INT32_MAX = global i64 0
define i32 @rand_sign() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load i64, i64* @INT32_MAX
%4 = sitofp i64 %3 to float
%5 = fdiv float %4, 2.000000e+00
%6 = fdiv float %2, %5
%7 = fpext float %6 to double
%8 = fcmp ole double %7, 5.000000e-01
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 1
ret i32 %10
}

LLVM IR (-O2):
@INT32_MAX = global i64 0
define i32 @rand_sign() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load i64, i64* @INT32_MAX
%4 = sitofp i64 %3 to float
%5 = fmul float %4, 5.000000e-01
%6 = fdiv float %2, %5
%7 = fcmp ole float %6, 5.000000e-01
%8 = select i1 %7, i32 -1, i32 1
ret i32 %8
}
int compara_long(void *key1, void *key2) {
  long *c1 = (long *)key1;
  long *c2 = (long *)key2;
  if (*c1 == *c2) {
    return (0);
  } else if (*c1 > *c2) {
    return -1;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<compara_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jne    113c <compara_long+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1163 <compara_long+0x63>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jle    115c <compara_long+0x5c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <compara_long+0x63>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compara_long>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setle  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compara_long(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = icmp sgt i64 %5, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
extern void sleepms(int ms) {
  struct timespec ts;
  if (ms <= 0) {
    return;
  }
  ts.tv_sec = (time_t)(ms / 1000);
  ts.tv_nsec = (long)(ms % 1000 * 1000000);
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<sleepms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     112a <sleepms+0x1a>
jmp    115f <sleepms+0x4f>
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
cltq
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleepms>:
test   %edi,%edi
jle    114d <sleepms+0x3d>
sub    $0x18,%rsp
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
mov    %rax,0x10(%rsp)
imul   $0x3e8,%eax,%eax
sub    %eax,%edi
imul   $0xf4240,%edi,%eax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @sleepms(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %18
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %10, i64* %11
%12 = load i32, i32* %2
%13 = srem i32 %12, 1000
%14 = mul nsw i32 %13, 1000000
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %15, i64* %16
%17 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
br label %18
18: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @sleepms(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = icmp slt i32 %0, 1
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = udiv i32 %0, 1000
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %7, i64* %8
%9 = urem i32 %0, 1000
%10 = mul nuw nsw i32 %9, 1000000
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %11, i64* %12
%13 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
br label %14
14: ; preds = %1, %5
ret void
}
void Interp7(unsigned char *pc, int c1, int c2, int c3) {
  c1 &= 0xf8f8f8;
  c2 &= 0xf8f8f8;
  c3 &= 0xf8f8f8;
  *((int *)pc) = (c1 * 6 + c2 + c3) >> 3;
}


x86 assembly (clang, -O0):
<Interp7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    $0xf8f8f8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0xf8f8f8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
and    $0xf8f8f8,%eax
mov    %eax,-0x14(%rbp)
imul   $0x6,-0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
sar    $0x3,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp7>:
and    $0xf8f8f8,%esi
and    $0xf8f8f8,%edx
and    $0xf8f8f8,%ecx
lea    (%rsi,%rsi,2),%eax
lea    (%rdx,%rax,2),%eax
add    %ecx,%eax
shr    $0x3,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @Interp7(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = and i32 %9, 16316664
store i32 %10, i32* %6
%11 = load i32, i32* %7
%12 = and i32 %11, 16316664
store i32 %12, i32* %7
%13 = load i32, i32* %8
%14 = and i32 %13, 16316664
store i32 %14, i32* %8
%15 = load i32, i32* %6
%16 = mul nsw i32 %15, 6
%17 = load i32, i32* %7
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %8
%20 = add nsw i32 %18, %19
%21 = ashr i32 %20, 3
%22 = load i8*, i8** %5
%23 = bitcast i8* %22 to i32*
store i32 %21, i32* %23
ret void
}

LLVM IR (-O2):
define void @Interp7(i8* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %1, 16316664
%6 = and i32 %2, 16316664
%7 = and i32 %3, 16316664
%8 = mul nuw nsw i32 %5, 6
%9 = add nuw nsw i32 %8, %6
%10 = add nuw nsw i32 %9, %7
%11 = lshr exact i32 %10, 3
%12 = bitcast i8* %0 to i32*
store i32 %11, i32* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OUT(int, char);
void uartWrite(char data) { OUT(0x00, data); }


x86 assembly (clang, -O0):
<uartWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
movsbl -0x1(%rbp),%esi
call   1030 <OUT@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uartWrite>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <OUT@plt>

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

LLVM IR (-O2):
define void @uartWrite(i8 signext %0) {
%2 = tail call i32 @OUT(i32 0, i8 signext %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ADCComparatorIntDisable(uint32_t ui32Base, uint32_t ui32SequenceNum) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) &=
      ~(0x10000 << ui32SequenceNum);
}


x86 assembly (clang, -O0):
<ADCComparatorIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x10000,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCComparatorIntDisable>:
mov    %esi,%ecx
mov    $0x10000,%eax
shl    %cl,%eax
not    %eax
movslq %edi,%rcx
and    %eax,0x8(%rcx)
ret

LLVM IR (-O0):
define void @ADCComparatorIntDisable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 65536, %5
%7 = xor i32 %6, -1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = and i32 %12, %7
store volatile i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @ADCComparatorIntDisable(i32 %0, i32 %1) {
%3 = shl i32 65536, %1
%4 = xor i32 %3, -1
%5 = add nsw i32 %0, 8
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, %4
store volatile i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tzset(void) { printf(">>> tzset\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c">>> tzset\00"
define void @tzset() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
void pto_hex(unsigned char data, char *hex) {
  if (data < 10)
    hex[0] = '0' + data;
  else
    hex[0] = 'A' + data - 10;
}


x86 assembly (clang, -O0):
<pto_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jge    112f <pto_hex+0x2f>
movzbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    1141 <pto_hex+0x41>
movzbl -0x1(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pto_hex>:
cmp    $0xa,%dil
mov    $0x30,%eax
mov    $0x37,%ecx
cmovb  %eax,%ecx
add    %dil,%cl
mov    %cl,(%rsi)
ret

LLVM IR (-O0):
define void @pto_hex(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = add nsw i32 48, %10
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 %12, i8* %14
br label %23
15: ; preds = %2
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = add nsw i32 65, %17
%19 = sub nsw i32 %18, 10
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 0
store i8 %20, i8* %22
br label %23
23: ; preds = %15, %8
ret void
}

LLVM IR (-O2):
define void @pto_hex(i8 zeroext %0, i8* nocapture writeonly %1) {
%3 = icmp ult i8 %0, 10
%4 = select i1 %3, i8 48, i8 55
%5 = add i8 %4, %0
store i8 %5, i8* %1
ret void
}
void _Unwind_GetIPInfo() {}


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

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

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

LLVM IR (-O2):
define void @_Unwind_GetIPInfo() {
ret void
}
int fn1(int n) { return ((1 << n) & 1) != 0; }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @fn1(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int pm_vasprintf_knows_float();
int pm_have_float_format(void) { return pm_vasprintf_knows_float(); }


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

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

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

LLVM IR (-O2):
define i32 @pm_have_float_format() {
%1 = tail call i32 (...) @pm_vasprintf_knows_float()
ret i32 %1
}
/* Variables and functions */
scalar_t__ strncmp(char const *const, char const *const, size_t const);
unsigned short xmlrpc_strneq(const char *const a, const char *const b,
                             size_t const len) {
  return (strncmp(a, b, len) == 0);
}


x86 assembly (clang, -O0):
<xmlrpc_strneq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movzwl %ax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @xmlrpc_strneq(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @strncmp(i8* %7, i8* %8, i64 %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @xmlrpc_strneq(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i16
ret i16 %6
}
void XGetNormalHints() {}


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

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

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

LLVM IR (-O2):
define void @XGetNormalHints() {
ret void
}
int DayWeek(long JulianD) {
  int Dy;
  Dy = (JulianD + 1) % 7;
  return (Dy);
}


x86 assembly (clang, -O0):
<DayWeek>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    $0x7,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DayWeek>:
lea    0x1(%rdi),%rcx
movabs $0x4924924924924925,%rdx
92 24 49
mov    %rcx,%rax
imul   %rdx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    %rdx
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %edx,%eax
add    %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @DayWeek(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add nsw i64 %4, 1
%6 = srem i64 %5, 7
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @DayWeek(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = srem i64 %2, 7
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
void traitement_signal(int sig) { waitpid(-1, &sig, WNOHANG); }


x86 assembly (clang, -O0):
<traitement_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x4(%rbp),%rsi
call   1030 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traitement_signal>:
push   %rax
mov    %edi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rsi
mov    $0xffffffff,%edi
call   1030 <waitpid@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @traitement_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @WNOHANG
%4 = call i32 @waitpid(i32 -1, i32* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cmdBindAwkHelp() {
  printf("listens for a connection & spawns shell via awk\n");
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"listens for a connection & spawns shell via awk\0A\00"
define void @cmdBindAwkHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [48 x i8] c"listens for a connection & spawns shell via awk\00"
define void @cmdBindAwkHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret void
}
int nbl_is_empty(struct node_backlog *top, struct node_backlog *bottom) {
  return top == bottom;
}


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

x86 assembly (clang, -O2):
<nbl_is_empty>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.node_backlog = type opaque
define i32 @nbl_is_empty(%struct.node_backlog* %0, %struct.node_backlog* %1) {
%3 = alloca %struct.node_backlog*
%4 = alloca %struct.node_backlog*
store %struct.node_backlog* %0, %struct.node_backlog** %3
store %struct.node_backlog* %1, %struct.node_backlog** %4
%5 = load %struct.node_backlog*, %struct.node_backlog** %3
%6 = load %struct.node_backlog*, %struct.node_backlog** %4
%7 = icmp eq %struct.node_backlog* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.node_backlog = type opaque
define i32 @nbl_is_empty(%struct.node_backlog* readnone %0, %struct.node_backlog* readnone %1) {
%3 = icmp eq %struct.node_backlog* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct clad_test {
  int dummy;
};

/* Variables and functions */
struct clad_test *clad_test_assert(struct clad_test *, int, char *, int, int,
                                   char const *);
struct clad_test *clad_test_inteq(struct clad_test *test, int i1, int i2,
                                  const char *explain) {
  return clad_test_assert(
      test, i1 == i2, "Integers should be equal: %d %d; %s ", i1, i2, explain);
}


x86 assembly (clang, -O0):
<clad_test_inteq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x18(%rbp),%r9
lea    0xeb6(%rip),%rdx
call   1030 <clad_test_assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_test_inteq>:
mov    %rcx,%r9
mov    %edx,%r8d
mov    %esi,%ecx
xor    %esi,%esi
cmp    %edx,%ecx
sete   %sil
lea    0xed9(%rip),%rdx
jmp    1030 <clad_test_assert@plt>

LLVM IR (-O0):
%struct.clad_test = type { i32 }
@.str = [37 x i8] c"Integers should be equal: %d %d; %s \00"
define %struct.clad_test* @clad_test_inteq(%struct.clad_test* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.clad_test*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.clad_test* %0, %struct.clad_test** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load %struct.clad_test*, %struct.clad_test** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = load i8*, i8** %8
%17 = call %struct.clad_test* @clad_test_assert(%struct.clad_test* %9, i32 %13, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i8* %16)
ret %struct.clad_test* %17
}

LLVM IR (-O2):
%struct.clad_test = type { i32 }
@.str = [37 x i8] c"Integers should be equal: %d %d; %s \00"
define %struct.clad_test* @clad_test_inteq(%struct.clad_test* %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp eq i32 %1, %2
%6 = zext i1 %5 to i32
%7 = tail call %struct.clad_test* @clad_test_assert(%struct.clad_test* %0, i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i8* %3)
ret %struct.clad_test* %7
}