xunge/DecIR huggingface dataset:
/* Type definitions */
struct FindjoB {
  int dummy;
};

/* Variables and functions */
int Findjob_set_prop_filter(struct FindjoB *, int, int, int /*<<< orphan*/);
int Findjob_set_damage_filter(struct FindjoB *o, int value, int flag) {
  int ret;
  ret = Findjob_set_prop_filter(o, 3, value, 0);
  return (ret);
}


x86 assembly (clang, -O0):
<Findjob_set_damage_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x3,%esi
xor    %ecx,%ecx
call   1030 <Findjob_set_prop_filter@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Findjob_set_damage_filter>:
mov    %esi,%edx
mov    $0x3,%esi
xor    %ecx,%ecx
jmp    1030 <Findjob_set_prop_filter@plt>

LLVM IR (-O0):
%struct.FindjoB = type { i32 }
define i32 @Findjob_set_damage_filter(%struct.FindjoB* %0, i32 %1, i32 %2) {
%4 = alloca %struct.FindjoB*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.FindjoB* %0, %struct.FindjoB** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.FindjoB*, %struct.FindjoB** %4
%9 = load i32, i32* %5
%10 = call i32 @Findjob_set_prop_filter(%struct.FindjoB* %8, i32 3, i32 %9, i32 0)
store i32 %10, i32* %7
%11 = load i32, i32* %7
ret i32 %11
}

LLVM IR (-O2):
%struct.FindjoB = type { i32 }
define i32 @Findjob_set_damage_filter(%struct.FindjoB* %0, i32 %1, i32 %2) {
%4 = tail call i32 @Findjob_set_prop_filter(%struct.FindjoB* %0, i32 3, i32 %1, i32 0)
ret i32 %4
}
int increase(int *a, int *b, int *c) {
  *a = *a + *c;
  *b = *b + *c;
}


x86 assembly (clang, -O0):
<increase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
add    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
add    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increase>:
mov    (%rdx),%eax
add    %eax,(%rdi)
mov    (%rdx),%eax
add    %eax,(%rsi)
ret

LLVM IR (-O0):
define i32 @increase(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = load i32*, i32** %7
%11 = load i32, i32* %10
%12 = add nsw i32 %9, %11
%13 = load i32*, i32** %5
store i32 %12, i32* %13
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = load i32*, i32** %7
%17 = load i32, i32* %16
%18 = add nsw i32 %15, %17
%19 = load i32*, i32** %6
store i32 %18, i32* %19
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @increase(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
%6 = add nsw i32 %5, %4
store i32 %6, i32* %0
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
store i32 %9, i32* %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ reviseString();
int main(int argc, const char *argv[]) {
  reviseString();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @reviseString()
ret i32 0
}
/* Variables and functions */
void *realloc(void *, size_t);
void *default_reallocator(void *mem, size_t size) {
  void *ret = realloc(mem, size);
  return ret;
}


x86 assembly (clang, -O0):
<default_reallocator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_reallocator>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @default_reallocator(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, ("Usage: %s [ options ] [ <interval> [ <count> ] ]\n"),
          progname);
  fprintf(stderr,
          ("Options are:\n"
           "[ -C <command> ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\n"
           "[ -p { <pid> | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\n"));
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: %s [ options ] [ <interval> [ <count> ] ]\0A\00"
@.str.1 = [140 x i8] c"Options are:\0A[ -C <command> ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\0A[ -p { <pid> | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: %s [ options ] [ <interval> [ <count> ] ]\0A\00"
@.str.1 = [140 x i8] c"Options are:\0A[ -C <command> ] [ -d ] [ -I ] [ -r ] [ -t ] [ -u ] [ -V ] [ -w ]\0A[ -p { <pid> | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
void spin_wait(int n) {
  int tmp = n;
  while (tmp > 0) {
    tmp--;
    asm("" ::: "memory", "cc");
  }
}


x86 assembly (clang, -O0):
<spin_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1125 <spin_wait+0x25>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110d <spin_wait+0xd>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spin_wait>:
test   %edi,%edi
jle    1118 <spin_wait+0x18>
add    $0x1,%edi
nopw   0x0(%rax,%rax,1)
add    $0xffffffff,%edi
cmp    $0x1,%edi
ja     1110 <spin_wait+0x10>
ret

LLVM IR (-O0):
define void @spin_wait(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %3
%10 = add nsw i32 %9, -1
store i32 %10, i32* %3
br label %5
11: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @spin_wait(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
tail call void asm sideeffect "", "~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"()
%6 = icmp ugt i32 %4, 1
br i1 %6, label %3, label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int hm_hash(void const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(void const *);
int string_hash(const void *key) { return hm_hash(key, strlen(key)); }


x86 assembly (clang, -O0):
<string_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <hm_hash@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_hash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <hm_hash@plt>

LLVM IR (-O0):
define i32 @string_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @hm_hash(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @string_hash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @hm_hash(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ clearScreen();
int /*<<< orphan*/ wardialExecute();
void wardial() {
  clearScreen();
  wardialExecute();
}


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

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

LLVM IR (-O0):
define void @wardial() {
%1 = call i32 (...) @clearScreen()
%2 = call i32 (...) @wardialExecute()
ret void
}

LLVM IR (-O2):
define void @wardial() {
%1 = tail call i32 (...) @clearScreen()
%2 = tail call i32 (...) @wardialExecute()
ret void
}
int tcgetattr(int fd, struct termios *t) { return 0; }


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

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

LLVM IR (-O0):
%struct.termios = type opaque
define i32 @tcgetattr(i32 %0, %struct.termios* %1) {
%3 = alloca i32
%4 = alloca %struct.termios*
store i32 %0, i32* %3
store %struct.termios* %1, %struct.termios** %4
ret i32 0
}

LLVM IR (-O2):
%struct.termios = type opaque
define i32 @tcgetattr(i32 %0, %struct.termios* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
#define SIGCHLD 131
#define SIGHUP 130
#define SIGINT 129
#define SIGTERM 128
int /*<<< orphan*/ connection_stop();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sig_handler(int signum) {
  switch (signum) {
  case SIGCHLD:
  case SIGTERM:
  case SIGINT:
  case SIGHUP:
    connection_stop();
    exit(EXIT_SUCCESS);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x3,%eax
ja     1154 <sig_handler+0x34>
jmp    113f <sig_handler+0x1f>
mov    $0x0,%al
call   1030 <connection_stop@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
jmp    1159 <sig_handler+0x39>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
and    $0xfffffffc,%edi
cmp    $0x80,%edi
je     112c <sig_handler+0xc>
ret
push   %rax
xor    %eax,%eax
call   1030 <connection_stop@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 131, label %4
i32 128, label %4
i32 129, label %4
i32 130, label %4
]
4: ; preds = %1, %1, %1, %1
%5 = call i32 (...) @connection_stop()
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
br label %9
9: ; preds = %8
ret void
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @sig_handler(i32 %0) {
%2 = and i32 %0, -4
%3 = icmp eq i32 %2, 128
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (...) @connection_stop()
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
void ff_hevc_put_hevc_pel_pixels48_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels48_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void foo(void) {
  char str[123] = {0};
  enum hoo { NOO = 1 };
  strcat(str, "foo");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x7b,%edx
call   1030 <memset@plt>
lea    -0x80(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1040 <strcat@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x88,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x6b(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xeb8(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcat@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define void @foo() {
%1 = alloca [123 x i8]
%2 = bitcast [123 x i8]* %1 to i8*
%3 = getelementptr inbounds [123 x i8], [123 x i8]* %1, i64 0, i64 0
%4 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define void @foo() {
%1 = alloca [123 x i8]
%2 = getelementptr inbounds [123 x i8], [123 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcat(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, long *);
int main() {
  long n;
  scanf("%ld", &n);
  printf("%ld\n", n * n);
  printf("%ld\n", n * n * n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rsi
imul   -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
imul   -0x10(%rbp),%rsi
imul   -0x10(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%rsi
imul   %rsi,%rsi
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%rax
mov    %rax,%rsi
imul   %rax,%rsi
imul   %rax,%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = mul nsw i64 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %5)
%7 = load i64, i64* %1
%8 = mul nsw i64 %7, %7
%9 = mul nsw i64 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %9)
ret i32 0
}
int sub_fun(char x) {
  ;
  x = x + 1;
  return (x == 10 ? 0 : 1);
}


x86 assembly (clang, -O0):
<sub_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0xa,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_fun>:
xor    %eax,%eax
cmp    $0x9,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @sub_fun(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = add nsw i32 %4, 1
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 10
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 1
ret i32 %11
}

LLVM IR (-O2):
define i32 @sub_fun(i8 signext %0) {
%2 = icmp ne i8 %0, 9
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ bzero(char *, unsigned int);
int /*<<< orphan*/ exit(int);
char *malloc(unsigned int);
int /*<<< orphan*/ report(int /*<<< orphan*/, char *);
char *smalloc(unsigned int nbytes) {
  char *retvalue;
  retvalue = malloc(nbytes);
  if (!retvalue) {
    report(LOG_ERR, "malloc() failure -- exiting");
    exit(1);
  }
  bzero(retvalue, nbytes);
  return retvalue;
}


x86 assembly (clang, -O0):
<smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1181 <smalloc+0x41>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xe8e(%rip),%rsi
call   1060 <report@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <bzero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <malloc@plt>
test   %rax,%rax
je     1166 <smalloc+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <bzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
lea    0xe8a(%rip),%rsi
call   1060 <report@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [28 x i8] c"malloc() failure -- exiting\00"
define i8* @smalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @LOG_ERR
%10 = call i32 @report(i32 %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = load i32, i32* %2
%15 = call i32 @bzero(i8* %13, i32 %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [28 x i8] c"malloc() failure -- exiting\00"
define noalias i8* @smalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @LOG_ERR
%6 = tail call i32 @report(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = tail call i32 @bzero(i8* %2, i32 %0)
ret i8* %2
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
void restore_ui_state(void *old_state) {
  tcsetattr(STDIN_FILENO, TCSANOW, (struct termios *)old_state);
  free(old_state);
}


x86 assembly (clang, -O0):
<restore_ui_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
call   1040 <tcsetattr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_ui_state>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdx
call   1040 <tcsetattr@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
@TCSANOW = global i32 0
define void @restore_ui_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @STDIN_FILENO
%4 = load i32, i32* @TCSANOW
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to %struct.termios*
%7 = call i32 @tcsetattr(i32 %3, i32 %4, %struct.termios* %6)
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
@TCSANOW = global i32 0
define void @restore_ui_state(i8* %0) {
%2 = load i32, i32* @STDIN_FILENO
%3 = load i32, i32* @TCSANOW
%4 = bitcast i8* %0 to %struct.termios*
%5 = tail call i32 @tcsetattr(i32 %2, i32 %3, %struct.termios* %4)
%6 = tail call i32 @free(i8* %0)
ret void
}
__attribute__((always_)) float drmp3_mix_f32(float x, float y, float a) {
  return x * (1 - a) + y * a;
}


x86 assembly (clang, -O0):
<drmp3_mix_f32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee0(%rip),%xmm2
subss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drmp3_mix_f32>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm2,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @drmp3_mix_f32(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fsub float 1.000000e+00, %8
%10 = load float, float* %5
%11 = load float, float* %6
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %7, float %9, float %12)
ret float %13
}

LLVM IR (-O2):
define float @drmp3_mix_f32(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %1, %2
%6 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %5)
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void BLE_GEN_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @BLE_GEN_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @BLE_GEN_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
/* Variables and functions */
char *strncpy(char *s, const char *t, int n) {
  while (n > 0 && (*s++ = *t++) != 0)
    n--;
  return s;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jle    114c <strncpy+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    115c <strncpy+0x5c>
jmp    116a <strncpy+0x6a>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <strncpy+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %rdi,%rax
test   %edx,%edx
jle    112b <strncpy+0x2b>
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
mov    %cl,(%rax)
add    $0x1,%rax
test   %cl,%cl
je     112b <strncpy+0x2b>
add    $0x1,%rsi
lea    -0x1(%rdx),%ecx
cmp    $0x1,%edx
mov    %ecx,%edx
ja     1110 <strncpy+0x10>
ret

LLVM IR (-O0):
define i8* @strncpy(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
br label %7
7: ; preds = %20, %3
%8 = load i32, i32* %6
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %5
%13 = load i8, i8* %11
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
store i8 %13, i8* %14
%16 = sext i8 %13 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %10, %7
%19 = phi i1 [ false, %7 ], [ %17, %10 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i32, i32* %6
%22 = add nsw i32 %21, -1
store i32 %22, i32* %6
br label %7
23: ; preds = %18
%24 = load i8*, i8** %4
ret i8* %24
}

LLVM IR (-O2):
define i8* @strncpy(i8* writeonly %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %16
5: ; preds = %3, %5
%6 = phi i32 [ %13, %5 ], [ %2, %3 ]
%7 = phi i8* [ %12, %5 ], [ %1, %3 ]
%8 = phi i8* [ %10, %5 ], [ %0, %3 ]
%9 = load i8, i8* %7
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %9, i8* %8
%11 = icmp ne i8 %9, 0
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = add nsw i32 %6, -1
%14 = icmp ugt i32 %6, 1
%15 = select i1 %11, i1 %14, i1 false
br i1 %15, label %5, label %16
16: ; preds = %5, %3
%17 = phi i8* [ %0, %3 ], [ %10, %5 ]
ret i8* %17
}
/* Variables and functions */
int rand();
short tetriminoNumberGenerator() { return rand() % 7; }


x86 assembly (clang, -O0):
<tetriminoNumberGenerator>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %dx,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<tetriminoNumberGenerator>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
shr    $0x2,%eax
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @tetriminoNumberGenerator() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 7
%3 = trunc i32 %2 to i16
ret i16 %3
}

LLVM IR (-O2):
define signext i16 @tetriminoNumberGenerator() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 7
%3 = trunc i32 %2 to i16
ret i16 %3
}
void RTLogRelSetBuffering(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogRelSetBuffering() {
ret void
}
void content_ssl_toserver(struct TCPRECORD *sess, struct TCP_STREAM *stream,
                          struct NetFrame *frame, const unsigned char *px,
                          unsigned length) {}


x86 assembly (clang, -O0):
<content_ssl_toserver>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TCPRECORD = type opaque
%struct.TCP_STREAM = type opaque
%struct.NetFrame = type opaque
define void @content_ssl_toserver(%struct.TCPRECORD* %0, %struct.TCP_STREAM* %1, %struct.NetFrame* %2, i8* %3, i32 %4) {
%6 = alloca %struct.TCPRECORD*
%7 = alloca %struct.TCP_STREAM*
%8 = alloca %struct.NetFrame*
%9 = alloca i8*
%10 = alloca i32
store %struct.TCPRECORD* %0, %struct.TCPRECORD** %6
store %struct.TCP_STREAM* %1, %struct.TCP_STREAM** %7
store %struct.NetFrame* %2, %struct.NetFrame** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.TCPRECORD = type opaque
%struct.TCP_STREAM = type opaque
%struct.NetFrame = type opaque
define void @content_ssl_toserver(%struct.TCPRECORD* nocapture %0, %struct.TCP_STREAM* nocapture %1, %struct.NetFrame* nocapture %2, i8* nocapture %3, i32 %4) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t uminus(uint64_t x, uint64_t y) {
  if (x > y)
    return x - y;
  return y - x;
}


x86 assembly (clang, -O0):
<uminus>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    112b <uminus+0x2b>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1137 <uminus+0x37>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uminus>:
mov    %rdi,%rax
sub    %rsi,%rax
neg    %rax
sub    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @uminus(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = sub nsw i64 %0, %1
%5 = sub nsw i64 %1, %0
%6 = select i1 %3, i64 %4, i64 %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void p_log(char *message, int severity) { fprintf(stderr, "%s\n", message); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @p_log(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @p_log(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float repl3(float varz, float vara, float varb) {
  if (varz > vara)
    return vara;
  else if (varz < varb)
    return varb;
  else
    return varz;
}


x86 assembly (clang, -O0):
<repl3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1131 <repl3+0x31>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <repl3+0x5d>
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1153 <repl3+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <repl3+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<repl3>:
maxss  %xmm0,%xmm2
movaps %xmm1,%xmm3
cmpltss %xmm0,%xmm3
movaps %xmm3,%xmm0
andnps %xmm2,%xmm0
andps  %xmm1,%xmm3
orps   %xmm0,%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @repl3(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp ogt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %6
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %5
%15 = load float, float* %7
%16 = fcmp olt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %7
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %5
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @repl3(float %0, float %1, float %2) {
%4 = fcmp ogt float %0, %1
%5 = fcmp olt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int ans = 1;
  int tmp = 1;
  for (tmp = 1; ans != 0x375f00; tmp++) {
    ans *= tmp;
  }
  printf("%d \n", tmp - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x375f00,-0x8(%rbp)
je     1159 <main+0x49>
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
add    $0x1,%esi
imul   %esi,%eax
cmp    $0x375f00,%eax
jne    1120 <main+0x10>
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %5, %1 ]
%3 = phi i32 [ 1, %0 ], [ %4, %1 ]
%4 = mul nsw i32 %2, %3
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %4, 3628800
br i1 %6, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
int wpas_p2p_group_remove(struct wpa_supplicant *wpa_s, const char *ifname) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
define i32 @wpas_p2p_group_remove(%struct.wpa_supplicant* %0, i8* %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca i8*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define i32 @wpas_p2p_group_remove(%struct.wpa_supplicant* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int nicintel_ee_write(struct flashrom_flashctx *, int /*<<< orphan*/ *,
                      unsigned int, unsigned int);
int nicintel_ee_erase(struct flashrom_flashctx *flash, unsigned int addr,
                      unsigned int len) {
  return nicintel_ee_write(flash, NULL, addr, len);
}


x86 assembly (clang, -O0):
<nicintel_ee_erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nicintel_ee_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nicintel_ee_erase>:
mov    %edx,%ecx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <nicintel_ee_write@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @nicintel_ee_erase(%struct.flashrom_flashctx* %0, i32 %1, i32 %2) {
%4 = alloca %struct.flashrom_flashctx*
%5 = alloca i32
%6 = alloca i32
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @nicintel_ee_write(%struct.flashrom_flashctx* %7, i32* null, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @nicintel_ee_erase(%struct.flashrom_flashctx* %0, i32 %1, i32 %2) {
%4 = tail call i32 @nicintel_ee_write(%struct.flashrom_flashctx* %0, i32* null, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ GetTimeStampInMs();
int64_t GetCurrentTime() { return GetTimeStampInMs(); }


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

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

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

LLVM IR (-O2):
define i32 @GetCurrentTime() {
%1 = tail call i32 (...) @GetTimeStampInMs()
ret i32 %1
}
/* Variables and functions */
int RoundDown(int, int);
int RoundUp(int val, int modulus) {
  if (val % modulus != 0)
    val = RoundDown(val, modulus) + modulus;
  return (val);
}


x86 assembly (clang, -O0):
<RoundUp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
je     113f <RoundUp+0x2f>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <RoundDown@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RoundUp>:
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1126 <RoundUp+0x16>
push   %rbx
mov    %esi,%ebx
call   1030 <RoundDown@plt>
mov    %eax,%edi
add    %ebx,%edi
pop    %rbx
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @RoundUp(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 = srem i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @RoundDown(i32 %10, i32 %11)
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
store i32 %14, i32* %3
br label %15
15: ; preds = %9, %2
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @RoundUp(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @RoundDown(i32 %0, i32 %1)
%7 = add nsw i32 %6, %1
br label %8
8: ; preds = %5, %2
%9 = phi i32 [ %7, %5 ], [ %0, %2 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ rand();
float ranf(void) { return ((double)rand() + 1.0) / ((double)32767 + 2.0); }


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

x86 assembly (clang, -O2):
<ranf>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
addsd  0xedb(%rip),%xmm0
divsd  0xedb(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ranf() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double %3, 3.276900e+04
%5 = fptrunc double %4 to float
ret float %5
}

LLVM IR (-O2):
define float @ranf() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double %3, 3.276900e+04
%5 = fptrunc double %4 to float
ret float %5
}
int main() {
  unsigned long t1 = -1;
  return t1 >> 62;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
shr    $0x3e,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 -1, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 62
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void gen_scan_tal(FILE *outfile, int num) {
  fprintf(outfile, "_scan_tally[%d]", num);
}


x86 assembly (clang, -O0):
<gen_scan_tal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_scan_tal>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"_scan_tally[%d]\00"
define void @gen_scan_tal(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 @fprintf(i32* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"_scan_tally[%d]\00"
define void @gen_scan_tal(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x9d() {
  Assert_real((isspace(157) == 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_isspace.c",
              790, ("isspace should be 0 for 0x9d"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x9d>:
push   %rax
mov    $0x9d,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x316,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x9d\00"
define void @t_isspace_0x9d() {
%1 = call i64 @isspace(i32 157)
%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 790, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x9d\00"
define void @t_isspace_0x9d() {
%1 = tail call i64 @isspace(i32 157)
%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 790, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
void print_state(char *str, __m128i st) {}


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

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

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

LLVM IR (-O2):
define void @print_state(i8* nocapture %0, i32 %1) {
ret void
}
int os_acquire_spinlock(unsigned int *lock) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @os_acquire_spinlock(i32* nocapture readnone %0) {
ret i32 -1
}