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

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *,
                            char const *, char const *);
int phAddAuthInfo(const char *username, const char *userid, const char *passwd,
                  const char *ha1, const char *realm) {
  char reqbuf[1000];
  snprintf(reqbuf, sizeof(reqbuf), "AUTH U=%s ID=%s P=%s R=%s", username,
           userid, passwd, realm);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phAddAuthInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x28(%rbp),%rax
mov    $0x3e8,%esi
lea    0xe9e(%rip),%rdx
mov    %rax,(%rsp)
call   1030 <snprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phAddAuthInfo>:
push   %rbx
sub    $0x400,%rsp
mov    %rdx,%r9
mov    %rsi,%rax
mov    %rdi,%rcx
mov    %r8,(%rsp)
lea    0xec4(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
mov    %rax,%r8
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"AUTH U=%s ID=%s P=%s R=%s\00"
define i32 @phAddAuthInfo(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca [1000 x i8]
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = load i8*, i8** %10
%17 = call i32 @snprintf(i8* %12, i32 1000, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14, i8* %15, i8* %16)
%18 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%19 = call i32 @ph_rpc(i8* %18)
ret i32 %19
}

LLVM IR (-O2):
@.str = [26 x i8] c"AUTH U=%s ID=%s P=%s R=%s\00"
define i32 @phAddAuthInfo(i8* %0, i8* %1, i8* %2, i8* nocapture readnone %3, i8* %4) {
%6 = alloca [1000 x i8]
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%8 = call i32 @snprintf(i8* %7, i32 1000, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i8* %4)
%9 = call i32 @ph_rpc(i8* %7)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void getString(char *a) {
  char *c = a - 1;
  while (*(++c) != '\0')
    putchar(*c);
  return;
}


x86 assembly (clang, -O0):
<getString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1155 <getString+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    1128 <getString+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <getString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <getString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @getString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(unsigned char *, char *);
int hbtestupdate(unsigned char *buf, int len) { strcpy(buf, "OKSERVER"); }


x86 assembly (clang, -O0):
<hbtestupdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hbtestupdate>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"OKSERVER\00"
define i32 @hbtestupdate(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"OKSERVER\00"
define i32 @hbtestupdate(i8* %0, i32 %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ RAND_MAX;

/* Variables and functions */
scalar_t__ rand();
double drand48(void) { return (double)rand() / ((double)(RAND_MAX) + 1.0); }


x86 assembly (clang, -O0):
<drand48>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drand48>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @drand48() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 1.000000e+00
ret double %3
}

LLVM IR (-O2):
define double @drand48() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ acid_shutdown(int /*<<< orphan*/);
void handler(int CANTUSE_sig __attribute__((unused))) { acid_shutdown(0); }


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

x86 assembly (clang, -O2):
<handler>:
xor    %edi,%edi
jmp    1030 <acid_shutdown@plt>

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

LLVM IR (-O2):
define void @handler(i32 %0) {
%2 = tail call i32 @acid_shutdown(i32 0)
ret void
}
const char *vedis_lib_signature(void) { return "vedis/1.2.6"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"vedis/1.2.6\00"
define i8* @vedis_lib_signature() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"vedis/1.2.6\00"
define i8* @vedis_lib_signature() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void addps(char *instring, char *outstring, int eps) {
  strcpy(outstring, instring);
  if (eps) {
    strcat(outstring, ".eps");
  } else {
    strcat(outstring, ".ps");
  }
}


x86 assembly (clang, -O0):
<addps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
cmpl   $0x0,-0x14(%rbp)
je     115f <addps+0x3f>
mov    -0x10(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1040 <strcat@plt>
jmp    116f <addps+0x4f>
mov    -0x10(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1040 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addps>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
test   %ebp,%ebp
lea    0xec9(%rip),%rax
lea    0xebd(%rip),%rsi
cmove  %rax,%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c".eps\00"
@.str.1 = [4 x i8] c".ps\00"
define void @addps(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %18
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = call i32 @strcat(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".eps\00"
@.str.1 = [4 x i8] c".ps\00"
define void @addps(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strcpy(i8* %1, i8* %0)
%5 = icmp eq i32 %2, 0
%6 = select i1 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @strcat(i8* %1, i8* %6)
ret void
}
int do_140() { return 140; }


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

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

LLVM IR (-O0):
define i32 @do_140() {
ret i32 140
}

LLVM IR (-O2):
define i32 @do_140() {
ret i32 140
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int read(int, char *, int);
int /*<<< orphan*/ stderr;
void getRequest(int cliFd, char *buff, int buffSize) {
  int c = read(cliFd, buff, buffSize);
  if (c < 0) {
    fprintf(stderr, "Error while reading socket\n");
  }
}


x86 assembly (clang, -O0):
<getRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1163 <getRequest+0x43>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRequest>:
push   %rax
call   1030 <read@plt>
test   %eax,%eax
js     112c <getRequest+0xc>
pop    %rax
ret
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Error while reading socket\0A\00"
define void @getRequest(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @read(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %14, %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Error while reading socket\0A\00"
define void @getRequest(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t z80_cb_a8_res_5(uint8_t value) { return value & 0xdf; }


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

x86 assembly (clang, -O2):
<z80_cb_a8_res_5>:
mov    %edi,%eax
and    $0xdf,%eax
ret

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

LLVM IR (-O2):
define i32 @z80_cb_a8_res_5(i32 %0) {
%2 = and i32 %0, 223
ret i32 %2
}
/* Variables and functions */
scalar_t__ clock();
double Clock_Clicks(void) {
  double ans;
  ans = (double)clock();
  return ans;
}


x86 assembly (clang, -O0):
<Clock_Clicks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Clock_Clicks>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Clock_Clicks() {
%1 = alloca double
%2 = call i64 (...) @clock()
%3 = sitofp i64 %2 to double
store double %3, double* %1
%4 = load double, double* %1
ret double %4
}

LLVM IR (-O2):
define double @Clock_Clicks() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  double d;
  d = 4.4;
  printf("%f\n", d);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 4.400000e+00, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 4.400000e+00)
ret i32 0
}
/* Variables and functions */
char *split_chr(char *, char);
char *split(char *s) { return split_chr(s, ','); }


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

x86 assembly (clang, -O2):
<split>:
mov    $0x2c,%esi
jmp    1030 <split_chr@plt>

LLVM IR (-O0):
define i8* @split(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @split_chr(i8* %3, i8 signext 44)
ret i8* %4
}

LLVM IR (-O2):
define i8* @split(i8* %0) {
%2 = tail call i8* @split_chr(i8* %0, i8 signext 44)
ret i8* %2
}
int _cd30005_1(int Value) { return Value + 1; }


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

x86 assembly (clang, -O2):
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @_cd30005_1(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int anotherFunction5() { return 5; }


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

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

LLVM IR (-O0):
define i32 @anotherFunction5() {
ret i32 5
}

LLVM IR (-O2):
define i32 @anotherFunction5() {
ret i32 5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int /*<<< orphan*/);
extern void oosmos_DelayUS(uint32_t US) { usleep(US); }


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

x86 assembly (clang, -O2):
<oosmos_DelayUS>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @oosmos_DelayUS(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void Swap(uint64_t *x, uint64_t *y) {
  uint64_t t = *x;
  *x = *y;
  *y = t;
}


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

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

LLVM IR (-O0):
define void @Swap(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
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @Swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ find_token_at_string_from(char *, char *,
                                             int /*<<< orphan*/);
int find_token_at_string(char *in, char *pattern) {
  find_token_at_string_from(in, pattern, 0);
}


x86 assembly (clang, -O0):
<find_token_at_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <find_token_at_string_from@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_token_at_string>:
xor    %edx,%edx
jmp    1030 <find_token_at_string_from@plt>

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

LLVM IR (-O2):
define i32 @find_token_at_string(i8* %0, i8* %1) {
%3 = tail call i32 @find_token_at_string_from(i8* %0, i8* %1, i32 0)
ret i32 undef
}
void do_n_m_times_nested(int n, int m) {
  int k = n;
  int p = m;
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < p; j++) {
    }
  }
}


x86 assembly (clang, -O0):
<do_n_m_times_nested>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1162 <do_n_m_times_nested+0x62>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    114f <do_n_m_times_nested+0x4f>
jmp    1141 <do_n_m_times_nested+0x41>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1130 <do_n_m_times_nested+0x30>
jmp    1154 <do_n_m_times_nested+0x54>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111d <do_n_m_times_nested+0x1d>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @do_n_m_times_nested(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
void *EVP_MD_CTX_create();
void *evpmd_new(void *aux) { return EVP_MD_CTX_create(); }


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

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

LLVM IR (-O0):
define i8* @evpmd_new(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* (...) @EVP_MD_CTX_create()
ret i8* %3
}

LLVM IR (-O2):
define i8* @evpmd_new(i8* nocapture readnone %0) {
%2 = tail call i8* (...) @EVP_MD_CTX_create()
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ demo_func();
int demo_test_coredump(void) {
  demo_func();
  return 0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ IntDisable(int /*<<< orphan*/);
int /*<<< orphan*/ IntUnregister(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTIntNumberGet(int /*<<< orphan*/);
void UARTIntUnregister(uint32_t ui32Base) {
  uint32_t ui32Int;
  ;
  ui32Int = _UARTIntNumberGet(ui32Base);
  ;
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<UARTIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_UARTIntNumberGet@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <IntDisable@plt>
mov    -0x8(%rbp),%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntUnregister>:
push   %rbx
call   1040 <_UARTIntNumberGet@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <IntDisable@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @UARTIntUnregister(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @_UARTIntNumberGet(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @IntDisable(i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @IntUnregister(i32 %8)
ret void
}

LLVM IR (-O2):
define void @UARTIntUnregister(i32 %0) {
%2 = tail call i32 @_UARTIntNumberGet(i32 %0)
%3 = tail call i32 @IntDisable(i32 %2)
%4 = tail call i32 @IntUnregister(i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, scalar_t__, int);
scalar_t__ waitpid(int, int *, int /*<<< orphan*/);
void deadChild(int signal) {
  pid_t ret;
  int status;
  do {
    ret = waitpid(-1, &status, WNOHANG);
    printf("Child has died: pid=%i status=%i\n", ret, status);
  } while (ret > 0);
}


x86 assembly (clang, -O0):
<deadChild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x14(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
jg     112b <deadChild+0xb>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deadChild>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    0x2eb9(%rip),%r12
lea    0x4(%rsp),%r14
lea    0xec5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r12),%edx
mov    $0xffffffff,%edi
mov    %r14,%rsi
call   1040 <waitpid@plt>
mov    %rax,%rbx
mov    0x4(%rsp),%edx
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
test   %rbx,%rbx
jg     1140 <deadChild+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [34 x i8] c"Child has died: pid=%i status=%i\0A\00"
define void @deadChild(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %11, %1
%6 = load i32, i32* @WNOHANG
%7 = call i64 @waitpid(i32 -1, i32* %4, i32 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %8, i32 %9)
br label %11
11: ; preds = %5
%12 = load i64, i64* %3
%13 = icmp sgt i64 %12, 0
br i1 %13, label %5, label %14
14: ; preds = %11
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [34 x i8] c"Child has died: pid=%i status=%i\0A\00"
define void @deadChild(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = load i32, i32* @WNOHANG
%6 = call i64 @waitpid(i32 -1, i32* %2, i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %6, i32 %7)
%9 = icmp sgt i64 %6, 0
br i1 %9, label %4, label %10
10: ; preds = %4
ret void
}
/* Variables and functions */
scalar_t__ f(int);
int main(void) {
  int x = 0;
  while (1)
    x += f(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <f@plt>
add    %ebx,%eax
mov    %eax,%ebx
jmp    1120 <main+0x10>

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 = %0, %3
%4 = load i32, i32* %2
%5 = call i64 @f(i32 %4)
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = add nsw i64 %7, %5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i64 @f(i32 %2)
%4 = trunc i64 %3 to i32
%5 = add i32 %2, %4
br label %1
}
/* Variables and functions */
double pow(double, int);
double f4(double x) { return pow(x - 2, 2) + 1; }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xec0(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
push   %rax
addsd  0xee7(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
addsd  0xedd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 2.000000e+00
%5 = call double @pow(double %4, i32 2)
%6 = fadd double %5, 1.000000e+00
ret double %6
}

LLVM IR (-O2):
define double @f4(double %0) {
%2 = fadd double %0, -2.000000e+00
%3 = tail call double @pow(double %2, i32 2)
%4 = fadd double %3, 1.000000e+00
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ gensintbl();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf(
      "/*\n * This file is automatically generated by %s, DO NOT EDIT!\n*/\n\n",
      argv[0]);
  gensintbl();
  exit(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    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <gensintbl@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <gensintbl@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"/*\0A * This file is automatically generated by %s, DO NOT EDIT!\0A*/\0A\0A\00"
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 (...) @gensintbl()
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [68 x i8] c"/*\0A * This file is automatically generated by %s, DO NOT EDIT!\0A*/\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 (...) @gensintbl()
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int a = 10, b = 20;
  printf("The old values: a = %d; b = %d.\n", a, b);
  swap(&a, &b);
  printf("The new values: a = %d; b = %d.\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
movl   $0x14,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"The old values: a = %d; b = %d.\0A\00"
@.str.1 = [33 x i8] c"The new values: a = %d; b = %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = call i32 @swap(i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"The old values: a = %d; b = %d.\0A\00"
@.str.1 = [33 x i8] c"The new values: a = %d; b = %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 20, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void AESReset(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000084))) |= 0x00000002;
  while (((*((volatile uint32_t *)(ui32Base + 0x00000088))) & 0x00000001) ==
         0) {
  }
}


x86 assembly (clang, -O0):
<AESReset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x84,%eax
cltq
mov    (%rax),%ecx
or     $0x2,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x88,%eax
cltq
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1135 <AESReset+0x35>
jmp    1118 <AESReset+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESReset>:
movslq %edi,%rax
orl    $0x2,0x84(%rax)
nopw   0x0(%rax,%rax,1)
testl  $0x1,0x88(%rax)
je     1110 <AESReset+0x10>
ret

LLVM IR (-O0):
define void @AESReset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 132
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 2
store volatile i32 %8, i32* %6
br label %9
9: ; preds = %17, %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 136
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, 1
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %9
br label %9
18: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @AESReset(i32 %0) {
%2 = add nsw i32 %0, 132
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 2
store volatile i32 %6, i32* %4
%7 = add nsw i32 %0, 136
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
br label %10
10: ; preds = %10, %1
%11 = load volatile i32, i32* %9
%12 = and i32 %11, 1
%13 = icmp eq i32 %12, 0
br i1 %13, label %10, label %14
14: ; preds = %10
ret void
}
char NESCombineBits(int a, int b, int n) {
  return ((a >> n) & 1) | (((b >> n) & 1) << 1);
}


x86 assembly (clang, -O0):
<NESCombineBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    $0x1,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NESCombineBits>:
mov    %edx,%ecx
shr    %cl,%edi
shr    %cl,%esi
and    $0x1,%edi
and    $0x1,%esi
lea    (%rdi,%rsi,2),%eax
ret

LLVM IR (-O0):
define signext i8 @NESCombineBits(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* %6
%9 = ashr i32 %7, %8
%10 = and i32 %9, 1
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = ashr i32 %11, %12
%14 = and i32 %13, 1
%15 = shl i32 %14, 1
%16 = or i32 %10, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @NESCombineBits(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %0, %2
%5 = and i32 %4, 1
%6 = lshr i32 %1, %2
%7 = shl i32 %6, 1
%8 = and i32 %7, 2
%9 = or i32 %8, %5
%10 = trunc i32 %9 to i8
ret i8 %10
}
/* Type definitions */
struct cusp_extension {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_object(int, short *);
void free_cusp_extension(struct cusp_extension *cex) {
  free_object(92, (short *)cex);
}


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

x86 assembly (clang, -O2):
<free_cusp_extension>:
mov    %rdi,%rsi
mov    $0x5c,%edi
jmp    1030 <free_object@plt>

LLVM IR (-O0):
%struct.cusp_extension = type { i32 }
define void @free_cusp_extension(%struct.cusp_extension* %0) {
%2 = alloca %struct.cusp_extension*
store %struct.cusp_extension* %0, %struct.cusp_extension** %2
%3 = load %struct.cusp_extension*, %struct.cusp_extension** %2
%4 = bitcast %struct.cusp_extension* %3 to i16*
%5 = call i32 @free_object(i32 92, i16* %4)
ret void
}

LLVM IR (-O2):
%struct.cusp_extension = type { i32 }
define void @free_cusp_extension(%struct.cusp_extension* %0) {
%2 = bitcast %struct.cusp_extension* %0 to i16*
%3 = tail call i32 @free_object(i32 92, i16* %2)
ret void
}
/* Variables and functions */
int fact(int);
int main() { return fact(6); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x6,%edi
jmp    1030 <fact@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fact(i32 6)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void Exit(int rc) { exit(rc); }


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

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

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

LLVM IR (-O2):
define void @Exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
void sys_sanitize(char *s) { (void)s; }


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

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

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

LLVM IR (-O2):
define void @sys_sanitize(i8* nocapture %0) {
ret void
}
void rect(int *p, int w, int h) { *p = (w + h) * 2; }


x86 assembly (clang, -O0):
<rect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rect(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* %5
%8 = load i32, i32* %6
%9 = add nsw i32 %7, %8
%10 = mul nsw i32 %9, 2
%11 = load i32*, i32** %4
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @rect(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
%5 = shl nsw i32 %4, 1
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int getSize(int *);
int *malloc(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int *array;
  array = malloc(sizeof(int) * 5);
  memset(array, 0, 5 * sizeof(int));
  array[4] = -1;
  printf("\nsize = %d\n", getSize(array));
  free(array);
  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)
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1050 <memset@plt>
mov    -0x18(%rbp),%rax
movl   $0xffffffff,0x10(%rax)
mov    -0x18(%rbp),%rdi
call   1070 <getSize@plt>
mov    %eax,%esi
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1050 <memset@plt>
movl   $0xffffffff,0x10(%rbx)
mov    %rbx,%rdi
call   1070 <getSize@plt>
lea    0xe7d(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"\0Asize = %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
%7 = call i32* @malloc(i32 20)
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = call i32 @memset(i32* %8, i32 0, i32 20)
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 4
store i32 -1, i32* %11
%12 = load i32*, i32** %6
%13 = call i32 @getSize(i32* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32*, i32** %6
%16 = call i32 @free(i32* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"\0Asize = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 20)
%4 = tail call i32 @memset(i32* %3, i32 0, i32 20)
%5 = getelementptr inbounds i32, i32* %3, i64 4
store i32 -1, i32* %5
%6 = tail call i32 @getSize(i32* %3)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @free(i32* %3)
ret i32 0
}
__attribute__((unused)) void elock_acquire(volatile int *lock) {
  asm volatile("1:\n\t"
               "movl $1, %%eax\n\t"
               "XACQUIRE LOCK xchg %%eax, %0\n\t"
               "cmpl $0, %%eax\n\t"
               "jz 3f\n\t"
               "2:\n\t"
               "cmpl $0, %0\n\t"
               "jnz 2b\n\t"
               "jmp 1b\n\t"
               "3:\n\t"
               :
               : "m"(*lock)
               : "%eax", "memory");
}


x86 assembly (clang, -O0):
<elock_acquire>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
xacquire lock xchg %eax,(%rcx)
cmp    $0x0,%eax
je     112c <elock_acquire+0x2c>
cmpl   $0x0,(%rcx)
jne    111e <elock_acquire+0x1e>
jmp    110c <elock_acquire+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<elock_acquire>:
mov    $0x1,%eax
xacquire lock xchg %eax,(%rdi)
cmp    $0x0,%eax
je     1115 <elock_acquire+0x15>
cmpl   $0x0,(%rdi)
jne    110e <elock_acquire+0xe>
jmp    1100 <elock_acquire>
ret

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

LLVM IR (-O2):
define void @elock_acquire(i32* %0) {
tail call void asm sideeffect "1:\0A\09movl $$1, %eax\0A\09XACQUIRE LOCK xchg %eax, $0\0A\09cmpl $$0, %eax\0A\09jz 3f\0A\092:\0A\09cmpl $$0, $0\0A\09jnz 2b\0A\09jmp 1b\0A\093:\0A\09", "*m,~{eax},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int syscall(int /*<<< orphan*/);
int gettid() { return syscall(SYS_gettid); }


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

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

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i32 @gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = call i32 @syscall(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i32 @gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i32 @syscall(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x82() {
  Assert_real((ispunct(130) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              655, ("ispunct should be 0 for 0x82"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x82\00"
define void @t_ispunct_0x82() {
%1 = tail call i64 @ispunct(i32 130)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool eth_addr_is_local(const uint8_t ea[6]) { return ea[0] & 2; }


x86 assembly (clang, -O0):
<eth_addr_is_local>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eth_addr_is_local>:
mov    (%rdi),%eax
and    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @eth_addr_is_local(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @eth_addr_is_local(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 2
ret i32 %3
}