xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int do_socket(void) { return socket(AF_INET, SOCK_STREAM, 0); }


x86 assembly (clang, -O0):
<do_socket>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_socket>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @do_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @do_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}
/* Type definitions */
struct traversal_algorithm {
  int dummy;
};
struct statement_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ safe_free_impl(struct statement_list *, char *, int);
void ast_safe_free_sl(struct statement_list *ptr,
                      struct traversal_algorithm *algo) {
  (void)(algo);
  safe_free_impl(
      ptr,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fg123/wendy/refs/heads/master/src/ast.c",
      106);
}


x86 assembly (clang, -O0):
<ast_safe_free_sl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x6a,%edx
call   1030 <safe_free_impl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ast_safe_free_sl>:
lea    0xee9(%rip),%rsi
mov    $0x6a,%edx
jmp    1030 <safe_free_impl@plt>

LLVM IR (-O0):
%struct.statement_list = type { i32 }
%struct.traversal_algorithm = type { i32 }
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fg123/wendy/refs/heads/master/src/ast.c\00"
define void @ast_safe_free_sl(%struct.statement_list* %0, %struct.traversal_algorithm* %1) {
%3 = alloca %struct.statement_list*
%4 = alloca %struct.traversal_algorithm*
store %struct.statement_list* %0, %struct.statement_list** %3
store %struct.traversal_algorithm* %1, %struct.traversal_algorithm** %4
%5 = load %struct.traversal_algorithm*, %struct.traversal_algorithm** %4
%6 = load %struct.statement_list*, %struct.statement_list** %3
%7 = call i32 @safe_free_impl(%struct.statement_list* %6, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 106)
ret void
}

LLVM IR (-O2):
%struct.statement_list = type { i32 }
%struct.traversal_algorithm = type { i32 }
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fg123/wendy/refs/heads/master/src/ast.c\00"
define void @ast_safe_free_sl(%struct.statement_list* %0, %struct.traversal_algorithm* nocapture readnone %1) {
%3 = tail call i32 @safe_free_impl(%struct.statement_list* %0, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 106)
ret void
}
void find_visible_ents(int ents[], int *count) {}


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

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

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

LLVM IR (-O2):
define void @find_visible_ents(i32* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_scale(double);
void set_scale_5() { set_scale(1.0 / 5); }


x86 assembly (clang, -O0):
<set_scale_5>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
call   1030 <set_scale@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_scale_5>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <set_scale@plt>

LLVM IR (-O0):
define void @set_scale_5() {
%1 = call i32 @set_scale(double 2.000000e-01)
ret void
}

LLVM IR (-O2):
define void @set_scale_5() {
%1 = tail call i32 @set_scale(double 2.000000e-01)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_bit(int, void *);
void set_bit_le(int nr, void *addr) { set_bit(nr ^ 0, addr); }


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

x86 assembly (clang, -O2):
<set_bit_le>:
jmp    1030 <set_bit@plt>

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

LLVM IR (-O2):
define void @set_bit_le(i32 %0, i8* %1) {
%3 = tail call i32 @set_bit(i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ uuid4_generate(char *);
int /*<<< orphan*/ uuid4_init();
int main(void) {
  char buf[37];
  uuid4_init();
  uuid4_generate(buf);
  printf("%s\n", buf);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <uuid4_init@plt>
lea    -0x30(%rbp),%rdi
call   1030 <uuid4_generate@plt>
lea    -0x30(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
xor    %eax,%eax
call   1050 <uuid4_init@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <uuid4_generate@plt>
lea    0xeb2(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [37 x i8]
store i32 0, i32* %1
%3 = call i32 (...) @uuid4_init()
%4 = getelementptr inbounds [37 x i8], [37 x i8]* %2, i64 0, i64 0
%5 = call i32 @uuid4_generate(i8* %4)
%6 = getelementptr inbounds [37 x i8], [37 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [37 x i8]
%2 = getelementptr inbounds [37 x i8], [37 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @uuid4_init()
%4 = call i32 @uuid4_generate(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(long *, char *, int);
long ntohl(long);
int read(int, char *, int);
long recv_ctr_msg(int ctr_strm, char *ctr_buff) {
  long ctr_code;
  if (read(ctr_strm, ctr_buff, sizeof(long)) != sizeof(long))
    return (-1);
  memcpy(&ctr_code, ctr_buff, sizeof(long));
  return (ntohl(ctr_code));
}


x86 assembly (clang, -O0):
<recv_ctr_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1030 <read@plt>
cltq
cmp    $0x8,%rax
je     1169 <recv_ctr_msg+0x39>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1188 <recv_ctr_msg+0x58>
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rdi
call   1050 <ntohl@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_ctr_msg>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    $0x8,%edx
call   1030 <read@plt>
mov    %eax,%ecx
mov    $0xffffffffffffffff,%rax
cmp    $0x8,%ecx
jne    116c <recv_ctr_msg+0x3c>
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    0x8(%rsp),%rdi
call   1050 <ntohl@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @recv_ctr_msg(i32 %0, i8* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = tail call i32 @read(i32 %0, i8* %1, i32 8)
%6 = icmp eq i32 %5, 8
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = call i32 @memcpy(i64* %3, i8* %1, i32 8)
%9 = load i64, i64* %3
%10 = call i64 @ntohl(i64 %9)
br label %11
11: ; preds = %2, %7
%12 = phi i64 [ %10, %7 ], [ -1, %2 ]
ret i64 %12
}
void XBEE_RX_INT_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @XBEE_RX_INT_Interrupt() {
ret void
}
/* Variables and functions */
char const *tcerrmsg(int);
const char *tcfdberrmsg(int ecode) { return tcerrmsg(ecode); }


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

x86 assembly (clang, -O2):
<tcfdberrmsg>:
jmp    1030 <tcerrmsg@plt>

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

LLVM IR (-O2):
define i8* @tcfdberrmsg(i32 %0) {
%2 = tail call i8* @tcerrmsg(i32 %0)
ret i8* %2
}
void unsigned_char_shr_signed_char_signed_char(unsigned char *LHS,
                                               signed char RHS) {
  (*LHS) >>= RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_shr_signed_char_signed_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
sar    %cl,%edx
mov    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_shr_signed_char_signed_char>:
mov    %esi,%ecx
movzbl (%rdi),%eax
shr    %cl,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @unsigned_char_shr_signed_char_signed_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = ashr i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @unsigned_char_shr_signed_char_signed_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = zext i8 %1 to i32
%6 = lshr i32 %4, %5
%7 = trunc i32 %6 to i8
store i8 %7, i8* %0
ret void
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
__u32 G(__u32 X, __u32 Y, __u32 Z) { return (X & Y) | (X & Z) | (Y & Z); }


x86 assembly (clang, -O0):
<G>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<G>:
mov    %edx,%eax
or     %esi,%eax
and    %edi,%eax
and    %esi,%edx
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @G(i32 %0, i32 %1, i32 %2) {
%4 = or i32 %2, %1
%5 = and i32 %4, %0
%6 = and i32 %2, %1
%7 = or i32 %5, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime_r(int /*<<< orphan*/ const *, struct tm *);
struct tm *gmtime(const time_t *t) {
  static struct tm tmp;
  return gmtime_r(t, &tmp);
}


x86 assembly (clang, -O0):
<gmtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2f05(%rip),%rsi
call   1030 <gmtime_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmtime>:
lea    0x2f15(%rip),%rsi
jmp    1030 <gmtime_r@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@gmtime.tmp = internal global %struct.tm zeroinitializer
define %struct.tm* @gmtime(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call %struct.tm* @gmtime_r(i32* %3, %struct.tm* @gmtime.tmp)
ret %struct.tm* %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@gmtime.tmp = internal global %struct.tm zeroinitializer
define %struct.tm* @gmtime(i32* %0) {
%2 = tail call %struct.tm* @gmtime_r(i32* %0, %struct.tm* @gmtime.tmp)
ret %struct.tm* %2
}
const char *stress_1_get_title(void) {
  return "Create / overwrite a large file";
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"Create / overwrite a large file\00"
define i8* @stress_1_get_title() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [32 x i8] c"Create / overwrite a large file\00"
define i8* @stress_1_get_title() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int /*<<< orphan*/ ungetch(char);
int main() {
  ungetch('x');
  ungetch('a');
  putchar(getch());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x78,%edi
call   1040 <ungetch@plt>
mov    $0x61,%edi
call   1040 <ungetch@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x78,%edi
call   1040 <ungetch@plt>
mov    $0x61,%edi
call   1040 <ungetch@plt>
xor    %eax,%eax
call   1050 <getch@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ungetch(i8 signext 120)
%3 = call i32 @ungetch(i8 signext 97)
%4 = call i32 (...) @getch()
%5 = call i32 @putchar(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ungetch(i8 signext 120)
%2 = tail call i32 @ungetch(i8 signext 97)
%3 = tail call i32 (...) @getch()
%4 = tail call i32 @putchar(i32 %3)
ret i32 0
}
/* Variables and functions */
double RAND_MAX;
double rand();
double randf(double s) { return (1.0 * rand() / (RAND_MAX + 0.1) * s); }


x86 assembly (clang, -O0):
<randf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  0xed9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xec5(%rip),%xmm1
mov    0x2ea6(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randf>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec4(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @randf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @rand()
%4 = fmul double 1.000000e+00, %3
%5 = load double, double* @RAND_MAX
%6 = fadd double %5, 1.000000e-01
%7 = fdiv double %4, %6
%8 = load double, double* %2
%9 = fmul double %7, %8
ret double %9
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @randf(double %0) {
%2 = tail call double (...) @rand()
%3 = load double, double* @RAND_MAX
%4 = fadd double %3, 1.000000e-01
%5 = fdiv double %2, %4
%6 = fmul double %5, %0
ret double %6
}
/* Variables and functions */
void *untag_atom(void *atm) { return (void *)(((size_t)atm) & ~((size_t)0x3)); }


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

x86 assembly (clang, -O2):
<untag_atom>:
mov    %rdi,%rax
and    $0xfffffffffffffffc,%rax
ret

LLVM IR (-O0):
define i8* @untag_atom(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, -4
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @untag_atom(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, -4
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void fc7(int n) {
  goto a;
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
a : {
  typedef int(*f)[n];
  {
    typedef int(*g)[n];
    0;
  };
  {
    typedef int(*h)[n];
    0;
  };
  ;
  typedef int(*i)[n];
  0;
};
  ;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %12
3: ; No predecessors!
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
br label %12
12: ; preds = %3, %1
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc7(i32 %0) {
ret void
}
unsigned long get_cr4(void) {
  unsigned long cr4;
  __asm__ volatile("mov %%cr4, %0" : "=r"(cr4));
  return (cr4);
}


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

x86 assembly (clang, -O2):
<get_cr4>:
mov    %cr4,%rax
ret

LLVM IR (-O0):
define i64 @get_cr4() {
%1 = alloca i64
%2 = call i64 asm sideeffect "mov %cr4, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_cr4() {
%1 = tail call i64 asm sideeffect "mov %cr4, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ EE_Off(void *);
int /*<<< orphan*/ EE_ReadByte(void *, unsigned char *);
int /*<<< orphan*/ EE_WriteByte(void *, int);
int wan_plxctrl_status(void *info, unsigned char *status) {
  EE_WriteByte(info, 0x05);
  EE_ReadByte(info, status);
  EE_Off(info);
  return 0;
}


x86 assembly (clang, -O0):
<wan_plxctrl_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
call   1030 <EE_WriteByte@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <EE_ReadByte@plt>
mov    -0x8(%rbp),%rdi
call   1050 <EE_Off@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wan_plxctrl_status>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x5,%esi
call   1030 <EE_WriteByte@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <EE_ReadByte@plt>
mov    %rbx,%rdi
call   1050 <EE_Off@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @wan_plxctrl_status(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 i32 @EE_WriteByte(i8* %5, i32 5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @EE_ReadByte(i8* %7, i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @EE_Off(i8* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @wan_plxctrl_status(i8* %0, i8* %1) {
%3 = tail call i32 @EE_WriteByte(i8* %0, i32 5)
%4 = tail call i32 @EE_ReadByte(i8* %0, i8* %1)
%5 = tail call i32 @EE_Off(i8* %0)
ret i32 0
}
int foo(int bar) { return bar * 2; }


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

x86 assembly (clang, -O2):
<foo>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
bool check_char_class(char c, char const *class) {
  while (*class)
    if (c == *class ++)
      return true;
  return false;
}


x86 assembly (clang, -O0):
<check_char_class>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <check_char_class+0x4a>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1145 <check_char_class+0x45>
movl   $0x1,-0x4(%rbp)
jmp    1151 <check_char_class+0x51>
jmp    110e <check_char_class+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_char_class>:
movzbl (%rsi),%eax
test   %al,%al
je     1116 <check_char_class+0x16>
add    $0x1,%rsi
cmp    %dil,%al
jne    1100 <check_char_class>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @check_char_class(i8 signext %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp eq i8 %5, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %7
%11 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_get_lifted_point(int n, int i, int j, double *point) {
  int fail;
  fail = _ada_use_c2phc(86, &i, &j, point);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_get_lifted_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x56,%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_get_lifted_point>:
push   %rax
mov    %esi,0x4(%rsp)
mov    %edx,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x56,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @celcon_get_lifted_point(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double* %3, double** %8
%10 = load double*, double** %8
%11 = call i32 @_ada_use_c2phc(i32 86, i32* %6, i32* %7, double* %10)
store i32 %11, i32* %9
%12 = load i32, i32* %9
ret i32 %12
}

LLVM IR (-O2):
define i32 @celcon_get_lifted_point(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @_ada_use_c2phc(i32 86, i32* %5, i32* %6, double* %3)
ret i32 %7
}
void __gnat_init_float() {}


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

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

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

LLVM IR (-O2):
define void @__gnat_init_float() {
ret void
}
/* Type definitions */
struct spaceSaver {
  int dummy;
};
struct spaceNode {
  int dummy;
};

/* Variables and functions */
struct spaceNode *spaceSaverAddOverflowExtended(struct spaceSaver *, int, int,
                                                void *, int,
                                                struct spaceSaver *,
                                                int /*<<< orphan*/);
struct spaceNode *spaceSaverAddOverflow(struct spaceSaver *ss, int start,
                                        int end, void *val, int allowOverflow) {
  return spaceSaverAddOverflowExtended(ss, start, end, val, allowOverflow, ss,
                                       0);
}


x86 assembly (clang, -O0):
<spaceSaverAddOverflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x8(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <spaceSaverAddOverflowExtended@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spaceSaverAddOverflow>:
push   %rax
movl   $0x0,(%rsp)
mov    %rdi,%r9
call   1030 <spaceSaverAddOverflowExtended@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.spaceNode = type { i32 }
%struct.spaceSaver = type { i32 }
define %struct.spaceNode* @spaceSaverAddOverflow(%struct.spaceSaver* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca %struct.spaceSaver*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store %struct.spaceSaver* %0, %struct.spaceSaver** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load %struct.spaceSaver*, %struct.spaceSaver** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = load %struct.spaceSaver*, %struct.spaceSaver** %6
%17 = call %struct.spaceNode* @spaceSaverAddOverflowExtended(%struct.spaceSaver* %11, i32 %12, i32 %13, i8* %14, i32 %15, %struct.spaceSaver* %16, i32 0)
ret %struct.spaceNode* %17
}

LLVM IR (-O2):
%struct.spaceNode = type { i32 }
%struct.spaceSaver = type { i32 }
define %struct.spaceNode* @spaceSaverAddOverflow(%struct.spaceSaver* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call %struct.spaceNode* @spaceSaverAddOverflowExtended(%struct.spaceSaver* %0, i32 %1, i32 %2, i8* %3, i32 %4, %struct.spaceSaver* %0, i32 0)
ret %struct.spaceNode* %6
}
/* Variables and functions */
double _erf(double);
double erf(double x) { return _erf(x); }


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

x86 assembly (clang, -O2):
<erf>:
jmp    1030 <_erf@plt>

LLVM IR (-O0):
define double @erf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @_erf(double %3)
ret double %4
}

LLVM IR (-O2):
define double @erf(double %0) {
%2 = tail call double @_erf(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ c2fstrv(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ f2cstrv(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ kill_trailing(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ num_elem(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ vkill_trailing(int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/);
void __cfortran__notused_dummy() {
  if (0) {
    c2fstrv(0, 0, 0, 0);
    f2cstrv(0, 0, 0, 0);
    kill_trailing(0, 0);
    vkill_trailing(0, 0, 0, 0);
    num_elem(0, 0, 0, 0);
  }
}


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

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

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

LLVM IR (-O2):
define void @__cfortran__notused_dummy() {
ret void
}
int _is_less_than(int cmpResult) { return (cmpResult < 0); }


x86 assembly (clang, -O0):
<_is_less_than>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_less_than>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @_is_less_than(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @_is_less_than(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *show_current_time(char *result) {
  time_t cur_time;
  struct tm split_time;
  cur_time = time(NULL);
  split_time = *localtime(&cur_time);
  strftime(result, 70, "%c", &split_time);
  return result;
}


x86 assembly (clang, -O0):
<show_current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x46,%esi
lea    0xe9a(%rip),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <strftime@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_current_time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
lea    0xea6(%rip),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x46,%esi
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%c\00"
define i8* @show_current_time(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm
store i8* %0, i8** %2
%5 = call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
%7 = bitcast %struct.tm* %4 to i8*
%8 = bitcast %struct.tm* %6 to i8*
%9 = load i8*, i8** %2
%10 = call i32 @strftime(i8* %9, i32 70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%c\00"
define i8* @show_current_time(i8* returned %0) {
%2 = alloca i32
%3 = alloca %struct.tm
%4 = bitcast i32* %2 to i8*
%5 = bitcast %struct.tm* %3 to i8*
%6 = tail call i32 @time(i32* null)
store i32 %6, i32* %2
%7 = call %struct.tm* @localtime(i32* %2)
%8 = getelementptr %struct.tm, %struct.tm* %7, i64 0, i32 0
%9 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
%10 = load i32, i32* %8
store i32 %10, i32* %9
%11 = call i32 @strftime(i8* %0, i32 70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
ret i8* %0
}
void ARGBToYRow_C() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToYRow_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glmASin3f(float *, float const *);
int /*<<< orphan*/ glmDegrees3f_(float *);
void glmASinD3f(float out[3], const float x[3]) {
  glmASin3f(out, x);
  glmDegrees3f_(out);
}


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

x86 assembly (clang, -O2):
<glmASinD3f>:
push   %rbx
mov    %rdi,%rbx
call   1040 <glmASin3f@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <glmDegrees3f_@plt>

LLVM IR (-O0):
define void @glmASinD3f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 @glmASin3f(float* %5, float* %6)
%8 = load float*, float** %3
%9 = call i32 @glmDegrees3f_(float* %8)
ret void
}

LLVM IR (-O2):
define void @glmASinD3f(float* %0, float* %1) {
%3 = tail call i32 @glmASin3f(float* %0, float* %1)
%4 = tail call i32 @glmDegrees3f_(float* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flushall();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
main() {
  char ch;
  printf("Enter a character\n");
  scanf("%c", &ch);
  flushall();
  printf("You entered %c", ch);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1040 <flushall@plt>
movsbl -0x1(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
movsbl 0x7(%rsp),%esi
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter a character\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [15 x i8] c"You entered %c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = call i32 (...) @flushall()
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [15 x i8] c"You entered %c\00"
@str = [18 x i8] c"Enter a character\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = call i32 (...) @flushall()
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
int /*<<< orphan*/ ENODEV;
int /*<<< orphan*/ errno;
off_t lseek(int fd, off_t off, int whence) {
  (void)fd;
  (void)off;
  (void)whence;
  errno = ENODEV;
  return -1;
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec3(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@ENODEV = global i32 0
@errno = global i32 0
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENODEV
store i32 %4, i32* @errno
ret i32 -1
}
int checkSum(char data[], int hash) {
  int realLength = 0;
  int i = 0;
  while (data[i] != '\0' && i < 32) {
    i++;
    realLength++;
  }
  return realLength % 16 == hash;
}


x86 assembly (clang, -O0):
<checkSum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     113d <checkSum+0x3d>
cmpl   $0x20,-0x14(%rbp)
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114d <checkSum+0x4d>
jmp    1164 <checkSum+0x64>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <checkSum+0x19>
mov    -0x10(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    -0xc(%rbp),%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkSum>:
cmpb   $0x0,(%rdi)
je     1129 <checkSum+0x29>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
lea    0x1(%rax),%rcx
cmpb   $0x0,0x1(%rdi,%rax,1)
je     1124 <checkSum+0x24>
cmp    $0x1f,%rax
mov    %rcx,%rax
jb     1110 <checkSum+0x10>
and    $0xf,%ecx
jmp    112b <checkSum+0x2b>
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %esi,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @checkSum(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %7, %5 ], [ 0, %2 ]
%7 = add nuw nsw i64 %6, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
%11 = icmp ult i64 %6, 31
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %5, label %13
13: ; preds = %5
%14 = trunc i64 %7 to i32
%15 = and i32 %14, 15
br label %16
16: ; preds = %13, %2
%17 = phi i32 [ 0, %2 ], [ %15, %13 ]
%18 = icmp eq i32 %17, %1
%19 = zext i1 %18 to i32
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ nsc_assert(int);
void cru2x(void) {
  nsc_assert(0 && "This function is unimplemented.");
  ;
}


x86 assembly (clang, -O0):
<cru2x>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <nsc_assert@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @cru2x() {
%1 = tail call i32 @nsc_assert(i32 0)
ret void
}
/* Variables and functions */
char get_last_char();
int /*<<< orphan*/ set_state(int);
void state_gameover_update() {
  if (get_last_char() == ' ') {
    set_state(2);
  }
}


x86 assembly (clang, -O0):
<state_gameover_update>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get_last_char@plt>
movsbl %al,%eax
cmp    $0x20,%eax
jne    1141 <state_gameover_update+0x21>
mov    $0x2,%edi
call   1030 <set_state@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<state_gameover_update>:
push   %rax
xor    %eax,%eax
call   1040 <get_last_char@plt>
cmp    $0x20,%al
jne    1137 <state_gameover_update+0x17>
mov    $0x2,%edi
pop    %rax
jmp    1030 <set_state@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @state_gameover_update() {
%1 = call signext i8 (...) @get_last_char()
%2 = sext i8 %1 to i32
%3 = icmp eq i32 %2, 32
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @set_state(i32 2)
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @state_gameover_update() {
%1 = tail call signext i8 (...) @get_last_char()
%2 = icmp eq i8 %1, 32
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @set_state(i32 2)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPI_Out(char);
void writedata(int addr, char b) {
  SPI_Out(0x06 | ((addr >> 5) & 0xF8));
  SPI_Out(addr & 0xFF);
  SPI_Out(b);
}


x86 assembly (clang, -O0):
<writedata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x5,%eax
and    $0xf8,%eax
or     $0x6,%eax
movsbl %al,%edi
call   1030 <SPI_Out@plt>
mov    -0x4(%rbp),%eax
and    $0xff,%eax
movsbl %al,%edi
call   1030 <SPI_Out@plt>
movsbl -0x5(%rbp),%edi
call   1030 <SPI_Out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writedata>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
shr    $0x5,%eax
and    $0xf8,%al
or     $0x6,%al
movsbl %al,%edi
call   1030 <SPI_Out@plt>
movsbl %bpl,%edi
call   1030 <SPI_Out@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <SPI_Out@plt>

LLVM IR (-O0):
define void @writedata(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 5
%7 = and i32 %6, 248
%8 = or i32 6, %7
%9 = trunc i32 %8 to i8
%10 = call i32 @SPI_Out(i8 signext %9)
%11 = load i32, i32* %3
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = call i32 @SPI_Out(i8 signext %13)
%15 = load i8, i8* %4
%16 = call i32 @SPI_Out(i8 signext %15)
ret void
}

LLVM IR (-O2):
define void @writedata(i32 %0, i8 signext %1) {
%3 = lshr i32 %0, 5
%4 = trunc i32 %3 to i8
%5 = and i8 %4, -8
%6 = or i8 %5, 6
%7 = tail call i32 @SPI_Out(i8 signext %6)
%8 = trunc i32 %0 to i8
%9 = tail call i32 @SPI_Out(i8 signext %8)
%10 = tail call i32 @SPI_Out(i8 signext %1)
ret void
}
/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("The BUFSIZ is %d\n", BUFSIZ);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"The BUFSIZ is %d\0A\00"
@BUFSIZ = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @BUFSIZ
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"The BUFSIZ is %d\0A\00"
@BUFSIZ = global i32 0
define i32 @main() {
%1 = load i32, i32* @BUFSIZ
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void foo472(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo472(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *fn) {
  printf("usage: %s <input_filename> [output_filename]\n", fn);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"usage: %s <input_filename> [output_filename]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"usage: %s <input_filename> [output_filename]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned long func(unsigned long a, unsigned long b) { return a > (~0UL) / b; }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
mov    %rsi,%rax
xor    %ecx,%ecx
mul    %rdi
seto   %cl
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @func(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = udiv i64 -1, %6
%8 = icmp ugt i64 %5, %7
%9 = zext i1 %8 to i32
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @func(i64 %0, i64 %1) {
%3 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %1, i64 %0)
%4 = extractvalue { i64, i1 } %3, 1
%5 = zext i1 %4 to i64
ret i64 %5
}