xunge/DecIR huggingface dataset:
bn_div_words_abort(int i) {}


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

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

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

LLVM IR (-O2):
define i32 @bn_div_words_abort(i32 %0) {
ret i32 undef
}
void closeExec(int fd) {}


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

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

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

LLVM IR (-O2):
define void @closeExec(i32 %0) {
ret void
}
void *xcalloc(nblocks, nbytes)
int nblocks, nbytes;
{
  void *tmp = (void *)xmalloc(nblocks * nbytes);
  bzero(tmp, nblocks * nbytes);
  return tmp;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <xmalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
movslq %eax,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
mov    %edi,%ebx
imul   %esi,%ebx
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <xmalloc@plt>
movslq %eax,%rdi
movslq %ebx,%rdx
xor    %esi,%esi
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @xcalloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 %8)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = mul nsw i32 %13, %14
%16 = sext i32 %15 to i64
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @xcalloc(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = sext i32 %3 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %6, i8 0, i64 %7, i1 false)
ret i8* %6
}
/* Variables and functions */
scalar_t__ iswspace(char);
char *SkipWhiteSpace(char *p) {
  if (p != NULL) {
    while (iswspace(*p)) {
      if (*p != 0) {
        p++;
      } else {
        break;
      }
    };
  }
  return p;
}


x86 assembly (clang, -O0):
<SkipWhiteSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1172 <SkipWhiteSpace+0x62>
jmp    112c <SkipWhiteSpace+0x1c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <iswspace@plt>
cmp    $0x0,%rax
je     116d <SkipWhiteSpace+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1163 <SkipWhiteSpace+0x53>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <SkipWhiteSpace+0x58>
jmp    116d <SkipWhiteSpace+0x5d>
jmp    112c <SkipWhiteSpace+0x1c>
jmp    1172 <SkipWhiteSpace+0x62>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipWhiteSpace>:
push   %rbx
test   %rdi,%rdi
je     1139 <SkipWhiteSpace+0x29>
mov    %rdi,%rbx
movsbl (%rdi),%edi
nopl   0x0(%rax)
call   1030 <iswspace@plt>
test   %rax,%rax
je     113b <SkipWhiteSpace+0x2b>
cmpb   $0x0,(%rbx)
je     113b <SkipWhiteSpace+0x2b>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1120 <SkipWhiteSpace+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @SkipWhiteSpace(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = tail call i64 @iswspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %3, %11
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %7
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = tail call i64 @iswspace(i8 signext %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %11, %3, %1
%17 = phi i8* [ null, %1 ], [ %0, %3 ], [ %8, %7 ], [ %12, %11 ]
ret i8* %17
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void give_date() { system("/bin/date"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"/bin/date\00"
define void @give_date() {
%1 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"/bin/date\00"
define void @give_date() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int main() {
  print("Hello static library!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Hello static library!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Hello static library!\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void expecti(int a, int b) {
  if (a != b) {
    printf(" [ERROR]\n");
    printf("    Expected: %d\n", b);
    printf("    Result:   %d\n", a);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<expecti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1174 <expecti+0x54>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expecti>:
cmp    %esi,%edi
jne    1135 <expecti+0x5>
ret
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb1(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c" [ERROR]\0A\00"
@.str.1 = [18 x i8] c" Expected: %d\0A\00"
@.str.2 = [18 x i8] c" Result: %d\0A\00"
define void @expecti(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 = icmp ne i32 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c" Expected: %d\0A\00"
@.str.2 = [18 x i8] c" Result: %d\0A\00"
@str = [9 x i8] c" [ERROR]\00"
define void @expecti(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
int ftw_cpup(const char *fname, const struct stat *st, int flags,
             struct FTW *ftw) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.stat = type opaque
%struct.FTW = type opaque
define i32 @ftw_cpup(i8* %0, %struct.stat* %1, i32 %2, %struct.FTW* %3) {
%5 = alloca i8*
%6 = alloca %struct.stat*
%7 = alloca i32
%8 = alloca %struct.FTW*
store i8* %0, i8** %5
store %struct.stat* %1, %struct.stat** %6
store i32 %2, i32* %7
store %struct.FTW* %3, %struct.FTW** %8
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type opaque
%struct.FTW = type opaque
define i32 @ftw_cpup(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1, i32 %2, %struct.FTW* nocapture readnone %3) {
ret i32 0
}
int isDM3txt(char *filename) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @isDM3txt(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_simulation_completed(void) {
  puts("The simulation completed");
  puts("-------------------------");
}


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

x86 assembly (clang, -O2):
<print_simulation_completed>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"The simulation completed\00"
@.str.1 = [26 x i8] c"-------------------------\00"
define void @print_simulation_completed() {
%1 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"The simulation completed\00"
@.str.1 = [26 x i8] c"-------------------------\00"
define void @print_simulation_completed() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int gg_pubdir50_handle_reply(struct gg_event *e, const char *packet,
                             int length) {
  return -1;
}


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

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

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

LLVM IR (-O2):
%struct.gg_event = type opaque
define i32 @gg_pubdir50_handle_reply(%struct.gg_event* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
void util_perror(const char *msg) { perror(msg); }


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

x86 assembly (clang, -O2):
<util_perror>:
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
define void @util_perror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void verif_arg(int argc) {
  if (argc != 1) {
    perror("Usage : ./Client.exe");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<verif_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     114b <verif_arg+0x2b>
lea    0xec4(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verif_arg>:
cmp    $0x1,%edi
jne    1126 <verif_arg+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Usage : ./Client.exe\00"
define void @verif_arg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage : ./Client.exe\00"
define void @verif_arg(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
ret void
}
void cmt_exit(n) int n;
{
  cu_cleanup();
  exit(n);
}


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

x86 assembly (clang, -O2):
<cmt_exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <cu_cleanup@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @cmt_exit(i32 %0) {
%2 = tail call i32 (...) @cu_cleanup()
tail call void @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_svarianceyc(int, float, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_svarianceyc(N, 1.0f, x, stride);
  printf("sample variance: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
movss  0xe8c(%rip),%xmm0
call   1040 <stdlib_strided_svarianceyc@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movss  0xebd(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_svarianceyc@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [21 x i8] c"sample variance: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_svarianceyc(i32 %6, float 1.000000e+00, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [21 x i8] c"sample variance: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_svarianceyc(i32 4, float 1.000000e+00, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("usage: getscom [-c|--chip chip-id] addr\n");
  printf("       getscom -l|--list-chips\n");
  printf("       getscom -v|--version\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf04(%rip),%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"usage: getscom [-c|--chip chip-id] addr\0A\00"
@.str.1 = [32 x i8] c" getscom -l|--list-chips\0A\00"
@.str.2 = [29 x i8] c" getscom -v|--version\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"usage: getscom [-c|--chip chip-id] addr\00"
@str.3 = [31 x i8] c" getscom -l|--list-chips\00"
@str.4 = [28 x i8] c" getscom -v|--version\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0))
ret void
}
void busy_wait(void) { __builtin_ia32_pause(); }


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

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

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

LLVM IR (-O2):
define void @busy_wait() {
tail call void @llvm.x86.sse2.pause()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ArgItem();
int Cnd_IsTied(void) {
  ArgItem();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @Cnd_IsTied() {
%1 = tail call i32 (...) @ArgItem()
ret i32 0
}
void BN_mod_mul(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_mod_mul() {
ret void
}
void sys_addreferencepath(void) { char sbuf[1000]; }


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

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

LLVM IR (-O0):
define void @sys_addreferencepath() {
%1 = alloca [1000 x i8]
ret void
}

LLVM IR (-O2):
define void @sys_addreferencepath() {
ret void
}
void ECDSA_do_sign(void) {}


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

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

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

LLVM IR (-O2):
define void @ECDSA_do_sign() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ putint(int);
int f(int x) {
  int s;
  s = 0;
  int i;
  i = 0;
  while (i < x) {
    i = i + 1;
    s = s + x * i;
    putint(s);
    putchar(10);
  }
  return s;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1174 <f+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1139 <f+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    115e <f+0x3e>
mov    %edi,%r14d
xor    %ebx,%ebx
mov    %edi,%ebp
mov    %edi,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
add    %ebp,%ebx
mov    %ebx,%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    %r14d,%ebp
add    $0xffffffff,%r15d
jne    1140 <f+0x20>
jmp    1160 <f+0x40>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = mul nsw i32 %6, %0
%8 = add nsw i32 %7, %5
%9 = tail call i32 @putint(i32 %8)
%10 = tail call i32 @putchar(i32 10)
%11 = icmp eq i32 %6, %0
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
void show_help() {
  printf(
      "Usage: tyrd [OPTIONS]...\n\n    -p, --port       specify server port\n");
  abort();
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<show_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"Usage: tyrd [OPTIONS]...\0A\0A -p, --port specify server port\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@str = [67 x i8] c"Usage: tyrd [OPTIONS]...\0A\0A -p, --port specify server port\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
char *strchr(const char *s, int c) {
  char ch = (char)c;
  while (*s) {
    if (*s == ch)
      return (char *)s;
    s++;
  }
  if (!ch)
    return (char *)s;
  return 0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <strchr+0x4f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <strchr+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <strchr+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1111 <strchr+0x11>
cmpb   $0x0,-0x15(%rbp)
jne    1166 <strchr+0x66>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <strchr+0x6e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
movsbl %sil,%edx
nopl   (%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
je     112c <strchr+0x2c>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %ecx,%ecx
test   %sil,%sil
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %2
%7 = shl i32 %1, 24
%8 = ashr exact i32 %7, 24
br label %9
9: ; preds = %6, %14
%10 = phi i8 [ %4, %6 ], [ %16, %14 ]
%11 = phi i8* [ %0, %6 ], [ %15, %14 ]
%12 = sext i8 %10 to i32
%13 = icmp eq i32 %8, %12
br i1 %13, label %22, label %14
14: ; preds = %9
%15 = getelementptr inbounds i8, i8* %11, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %9
18: ; preds = %14, %2
%19 = phi i8* [ %0, %2 ], [ %15, %14 ]
%20 = icmp eq i8 %3, 0
%21 = select i1 %20, i8* %19, i8* null
br label %22
22: ; preds = %9, %18
%23 = phi i8* [ %21, %18 ], [ %11, %9 ]
ret i8* %23
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int __stop_trace(int fd) {
  ioctl(fd, _IO(0x12, 117));
  return ioctl(fd, _IO(0x12, 118));
}


x86 assembly (clang, -O0):
<__stop_trace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x12,%edi
mov    $0x75,%esi
call   1030 <_IO@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x12,%edi
mov    $0x76,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stop_trace>:
push   %rbx
mov    %edi,%ebx
mov    $0x12,%edi
mov    $0x75,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
mov    $0x12,%edi
mov    $0x76,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @__stop_trace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 18, i32 117)
%5 = call i32 @ioctl(i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @_IO(i32 18, i32 118)
%8 = call i32 @ioctl(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @__stop_trace(i32 %0) {
%2 = tail call i32 @_IO(i32 18, i32 117)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
%4 = tail call i32 @_IO(i32 18, i32 118)
%5 = tail call i32 @ioctl(i32 %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello, world\k"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello, worldk\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello, worldk\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void rsync_delta_free(struct rsync_delta *rd) { rd = rd; }


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

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

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

LLVM IR (-O2):
%struct.rsync_delta = type opaque
define void @rsync_delta_free(%struct.rsync_delta* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpu_halt();
int /*<<< orphan*/ outw(int, int);
int /*<<< orphan*/ platform_puts(char *, int);
void platform_exit(int status __attribute__((unused)),
                   void *cookie __attribute__((unused))) {
  outw(0x501, 41);
  platform_puts("Solo5: Halted\n", 14);
  cpu_halt();
}


x86 assembly (clang, -O0):
<platform_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x501,%edi
mov    $0x29,%esi
call   1050 <outw@plt>
lea    0xeab(%rip),%rdi
mov    $0xe,%esi
call   1030 <platform_puts@plt>
mov    $0x0,%al
call   1040 <cpu_halt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_exit>:
push   %rax
mov    $0x501,%edi
mov    $0x29,%esi
call   1050 <outw@plt>
lea    0xeb9(%rip),%rdi
mov    $0xe,%esi
call   1030 <platform_puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cpu_halt@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Solo5: Halted\0A\00"
define void @platform_exit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @outw(i32 1281, i32 41)
%6 = call i32 @platform_puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
%7 = call i32 (...) @cpu_halt()
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Solo5: Halted\0A\00"
define void @platform_exit(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @outw(i32 1281, i32 41)
%4 = tail call i32 @platform_puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
%5 = tail call i32 (...) @cpu_halt()
ret void
}
int main(void) {
  int x;
  int y;
  if (x)
    while (y)
      x = 42;
  while (x)
    if (y)
      x = 42;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1135 <main+0x35>
jmp    111a <main+0x1a>
cmpl   $0x0,-0xc(%rbp)
je     1130 <main+0x30>
movl   $0x2a,-0x8(%rbp)
jmp    111a <main+0x1a>
jmp    1135 <main+0x35>
jmp    113a <main+0x3a>
cmpl   $0x0,-0x8(%rbp)
je     115a <main+0x5a>
cmpl   $0x0,-0xc(%rbp)
je     1155 <main+0x55>
movl   $0x2a,-0x8(%rbp)
jmp    113a <main+0x3a>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ a_swap(int volatile *, int);
void a_store(volatile int *p, int x) { a_swap(p, x); }


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

x86 assembly (clang, -O2):
<a_store>:
jmp    1030 <a_swap@plt>

LLVM IR (-O0):
define void @a_store(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @a_swap(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @a_store(i32* %0, i32 %1) {
%3 = tail call i32 @a_swap(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
char *strcpy(int /*<<< orphan*/, char const *);
scalar_t__ strlen(char const *);
int /*<<< orphan*/ xmalloc(scalar_t__);
char *xstrdup(const char *string) {
  if (!string)
    return NULL;
  return strcpy(xmalloc(strlen(string) + 1), string);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1178 <xstrdup+0x48>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
test   %rdi,%rdi
je     1152 <xstrdup+0x22>
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %14
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = call i32 @xmalloc(i64 %10)
%12 = load i8*, i8** %3
%13 = call i8* @strcpy(i32 %11, i8* %12)
store i8* %13, i8** %2
br label %14
14: ; preds = %7, %6
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i32 @xmalloc(i64 %5)
%7 = tail call i8* @strcpy(i32 %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ do_output_pros(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ unknown_com();
void setSavePros(char *rel, char *filename) {
  if (strcmp(rel, "=") == 0) {
    do_output_pros(filename);
  } else {
    unknown_com();
  }
}


x86 assembly (clang, -O0):
<setSavePros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <setSavePros+0x38>
mov    -0x10(%rbp),%rdi
call   1030 <do_output_pros@plt>
jmp    116f <setSavePros+0x3f>
mov    $0x0,%al
call   1040 <unknown_com@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setSavePros>:
push   %rbx
mov    %rsi,%rbx
lea    0xec5(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     114d <setSavePros+0x1d>
xor    %eax,%eax
pop    %rbx
jmp    1040 <unknown_com@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <do_output_pros@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
define void @setSavePros(i8* %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 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @do_output_pros(i8* %9)
br label %13
11: ; preds = %2
%12 = call i32 (...) @unknown_com()
br label %13
13: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
define void @setSavePros(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @do_output_pros(i8* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @unknown_com()
br label %9
9: ; preds = %7, %5
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t rotate_left(uint32_t x, uint8_t n) {
  return ((x << n) | (x >> (32 - n)));
}


x86 assembly (clang, -O0):
<rotate_left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_left>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotate_left(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotate_left(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, void const *, size_t);
ssize_t txc_libc_write(int fd, const void *buf, size_t nbyte) {
  return write(fd, buf, nbyte);
}


x86 assembly (clang, -O0):
<txc_libc_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txc_libc_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @txc_libc_write(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
void av_dict_get_string() {}


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

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

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

LLVM IR (-O2):
define void @av_dict_get_string() {
ret void
}
/* Variables and functions */
size_t fread(void *, int, size_t, void *);
size_t default_fread(void *buf, size_t size, void *f) {
  return fread(buf, 1, size, f);
}


x86 assembly (clang, -O0):
<default_fread>:
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),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_fread>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i64 @default_fread(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = tail call i64 @fread(i8* %0, i32 1, i64 %1, i8* %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ DAY_1;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_day_1() { return nl_langinfo(DAY_1); }


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

x86 assembly (clang, -O2):
<langinfo_day_1>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@DAY_1 = global i32 0
define i8* @langinfo_day_1() {
%1 = load i32, i32* @DAY_1
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@DAY_1 = global i32 0
define i8* @langinfo_day_1() {
%1 = load i32, i32* @DAY_1
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
const char *query_type(uint16_t qtype) {
  switch (qtype) {
  case 1:
    return "A";
  case 28:
    return "AAAA";
  case 255:
    return "ANY";
  default:
    return "<unknown>";
  }
}


x86 assembly (clang, -O0):
<query_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     113f <query_type+0x3f>
jmp    111b <query_type+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x1c,%eax
je     114f <query_type+0x4f>
jmp    112c <query_type+0x2c>
mov    -0x10(%rbp),%eax
sub    $0xff,%eax
je     115f <query_type+0x5f>
jmp    116f <query_type+0x6f>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117a <query_type+0x7a>
lea    0xeaa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117a <query_type+0x7a>
lea    0xe9f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117a <query_type+0x7a>
lea    0xe93(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_type>:
cmp    $0x1,%edi
je     111a <query_type+0x1a>
cmp    $0xff,%edi
je     1122 <query_type+0x22>
cmp    $0x1c,%edi
jne    112a <query_type+0x2a>
lea    0xee7(%rip),%rax
ret
lea    0xee2(%rip),%rax
ret
lea    0xedc(%rip),%rax
ret
lea    0xed8(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
@.str.1 = [5 x i8] c"AAAA\00"
@.str.2 = [4 x i8] c"ANY\00"
@.str.3 = [10 x i8] c"<unknown>\00"
define i8* @query_type(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 1, label %5
i32 28, label %6
i32 255, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
@.str.1 = [5 x i8] c"AAAA\00"
@.str.2 = [4 x i8] c"ANY\00"
@.str.3 = [10 x i8] c"<unknown>\00"
define i8* @query_type(i32 %0) {
switch i32 %0, label %4 [
i32 1, label %5
i32 28, label %2
i32 255, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
void luaCreateFunction(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               90, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<luaCreateFunction>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x5a,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaCreateFunction>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x5a,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.luaCreateFunction = [18 x i8] c"luaCreateFunction\00"
define void @luaCreateFunction() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 90, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.luaCreateFunction, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.luaCreateFunction = [18 x i8] c"luaCreateFunction\00"
define void @luaCreateFunction() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 90, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.luaCreateFunction, i64 0, i64 0))
ret void
}