xunge/DecIR huggingface dataset:
void vectorAdd(int *input1, int *input2, int *output) {
  int i;
  for (i = 0; i < 3; i++) {
    output[i] = input1[i] + input2[i];
  }
}


x86 assembly (clang, -O0):
<vectorAdd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1150 <vectorAdd+0x50>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <vectorAdd+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorAdd>:
mov    (%rsi),%eax
add    (%rdi),%eax
mov    %eax,(%rdx)
mov    0x4(%rsi),%eax
add    0x4(%rdi),%eax
mov    %eax,0x4(%rdx)
mov    0x8(%rsi),%eax
add    0x8(%rdi),%eax
mov    %eax,0x8(%rdx)
ret

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

LLVM IR (-O2):
define void @vectorAdd(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, %4
store i32 %6, i32* %2
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %1, i64 1
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
%12 = getelementptr inbounds i32, i32* %2, i64 1
store i32 %11, i32* %12
%13 = getelementptr inbounds i32, i32* %0, i64 2
%14 = load i32, i32* %13
%15 = getelementptr inbounds i32, i32* %1, i64 2
%16 = load i32, i32* %15
%17 = add nsw i32 %16, %14
%18 = getelementptr inbounds i32, i32* %2, i64 2
store i32 %17, i32* %18
ret void
}
unsigned char inc_node_version(unsigned char version) {
  (version == 255) ? version = 0 : ++version;
  return version;
}


x86 assembly (clang, -O0):
<inc_node_version>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xff,%eax
jne    1122 <inc_node_version+0x22>
movb   $0x0,-0x1(%rbp)
jmp    112d <inc_node_version+0x2d>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
movzbl %al,%eax
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @inc_node_version(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 255
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 0, i8* %2
br label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = add i8 %8, 1
store i8 %9, i8* %2
%10 = zext i8 %9 to i32
br label %11
11: ; preds = %7, %6
%12 = phi i32 [ 0, %6 ], [ %10, %7 ]
%13 = load i8, i8* %2
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @inc_node_version(i8 zeroext %0) {
%2 = add i8 %0, 1
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
void usage(void) {
  printf(
      "options:\n"
      "    -d <database file>        this option is mandatory\n"
      "    -ip <host>                connect to given IP address (default %s)\n"
      "    -p <port>                 connect to given port (default %d)\n",
      "127.0.0.1", 2021);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xf97(%rip),%rsi
mov    $0x7e5,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf9a(%rip),%rsi
mov    $0x7e5,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [201 x i8] c"options:\0A -d <database file> this option is mandatory\0A -ip <host> connect to given IP address (default %s)\0A -p <port> connect to given port (default %d)\0A\00"
@.str.1 = [10 x i8] c"127.0.0.1\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 2021)
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [201 x i8] c"options:\0A -d <database file> this option is mandatory\0A -ip <host> connect to given IP address (default %s)\0A -p <port> connect to given port (default %d)\0A\00"
@.str.1 = [10 x i8] c"127.0.0.1\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 2021)
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *foo(void *arg) {
  printf("Foobar!\n");
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Foobar!\0A\00"
define i8* @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pthread_exit(i32* null)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@str = [8 x i8] c"Foobar!\00"
define noalias i8* @foo(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
unsigned char TstActMov_OFILM(int);
unsigned char RunHea_OFILM(void) {
  unsigned char UcRst_OFILM;
  UcRst_OFILM = 0x02;
  UcRst_OFILM |= TstActMov_OFILM(0x00);
  UcRst_OFILM |= TstActMov_OFILM(0x01);
  ;
  return (UcRst_OFILM);
}


x86 assembly (clang, -O0):
<RunHea_OFILM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x2,-0x1(%rbp)
xor    %edi,%edi
call   1030 <TstActMov_OFILM@plt>
movzbl %al,%ecx
movzbl -0x1(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
call   1030 <TstActMov_OFILM@plt>
movzbl %al,%ecx
movzbl -0x1(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RunHea_OFILM>:
push   %rbx
xor    %edi,%edi
call   1030 <TstActMov_OFILM@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <TstActMov_OFILM@plt>
or     %bl,%al
or     $0x2,%al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @RunHea_OFILM() {
%1 = alloca i8
store i8 2, i8* %1
%2 = call zeroext i8 @TstActMov_OFILM(i32 0)
%3 = zext i8 %2 to i32
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = or i32 %5, %3
%7 = trunc i32 %6 to i8
store i8 %7, i8* %1
%8 = call zeroext i8 @TstActMov_OFILM(i32 1)
%9 = zext i8 %8 to i32
%10 = load i8, i8* %1
%11 = zext i8 %10 to i32
%12 = or i32 %11, %9
%13 = trunc i32 %12 to i8
store i8 %13, i8* %1
%14 = load i8, i8* %1
ret i8 %14
}

LLVM IR (-O2):
define zeroext i8 @RunHea_OFILM() {
%1 = tail call zeroext i8 @TstActMov_OFILM(i32 0)
%2 = tail call zeroext i8 @TstActMov_OFILM(i32 1)
%3 = or i8 %1, %2
%4 = or i8 %3, 2
ret i8 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int gf_mul(int, int);
uint8_t gf_pow(uint8_t a, int power) {
  uint8_t result = 1;
  int i;
  for (i = 0; i < power; ++i) {
    result = gf_mul(result, a);
  }
  return result;
}


x86 assembly (clang, -O0):
<gf_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1154 <gf_pow+0x44>
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <gf_mul@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112c <gf_pow+0x1c>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf_pow>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1130 <gf_pow+0x20>
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1,%eax
mov    %eax,%edi
mov    %ebp,%esi
call   1030 <gf_mul@plt>
add    $0xffffffff,%ebx
jne    1120 <gf_pow+0x10>
jmp    1135 <gf_pow+0x25>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @gf_pow(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = phi i32 [ %7, %4 ], [ 1, %2 ]
%7 = tail call i32 @gf_mul(i32 %6, i32 %0)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i32 [ 1, %2 ], [ %7, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void atexit_func2(void) { printf("atexit function 2 called\n"); }


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"atexit function 2 called\00"
define void @atexit_func2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
int C_Utils_compare_long(const long item1, const long item2) {
  if (item1 == item2)
    return 0;
  return item1 < item2 ? -1 : 1;
}


x86 assembly (clang, -O0):
<C_Utils_compare_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1126 <C_Utils_compare_long+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1141 <C_Utils_compare_long+0x41>
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rsi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_compare_long>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %rsi,%rdi
setge  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @C_Utils_compare_long(i64 %0, i64 %1) {
%3 = alloca i32
%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 eq i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %16
10: ; preds = %2
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = icmp slt i64 %11, %12
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 -1, i32 1
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @C_Utils_compare_long(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = icmp slt i64 %0, %1
%5 = select i1 %4, i32 -1, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t smpte_fec_get_length_rec(const uint8_t *p_fec) {
  return (p_fec[2] << 8) | p_fec[3];
}


x86 assembly (clang, -O0):
<smpte_fec_get_length_rec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_get_length_rec>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @smpte_fec_get_length_rec(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @smpte_fec_get_length_rec(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
void strreverse(char *begin, char *end) {
  char aux;
  while (end > begin)
    aux = *end, *end-- = *begin, *begin++ = aux;
}


x86 assembly (clang, -O0):
<strreverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1153 <strreverse+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strreverse+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strreverse>:
cmp    %rdi,%rsi
jbe    112c <strreverse+0x2c>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax)
movzbl 0x1(%rsi),%eax
movzbl (%rdi),%ecx
mov    %cl,0x1(%rsi)
mov    %al,(%rdi)
add    $0x1,%rdi
lea    -0x1(%rsi),%rax
cmp    %rdi,%rsi
mov    %rax,%rsi
ja     1110 <strreverse+0x10>
ret

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

LLVM IR (-O2):
define void @strreverse(i8* %0, i8* %1) {
%3 = icmp ugt i8* %1, %0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i8* [ %9, %4 ], [ %1, %2 ]
%7 = load i8, i8* %6
%8 = load i8, i8* %5
%9 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 %8, i8* %6
%10 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%11 = icmp ugt i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
char *trueFalseString(int b) { return (b ? "true" : "false"); }


x86 assembly (clang, -O0):
<trueFalseString>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef4(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trueFalseString>:
test   %edi,%edi
lea    0xefc(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @trueFalseString(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i8* @trueFalseString(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ _merge_sort(int *, int /*<<< orphan*/, int);
void merge_sort(int *v, int len) { _merge_sort(v, 0, len); }


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

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

LLVM IR (-O0):
define void @merge_sort(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 @_merge_sort(i32* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1) {
%3 = tail call i32 @_merge_sort(i32* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int refresh_qlut_kcal_display();
int refresh_kcal_display(void) { return refresh_qlut_kcal_display(); }


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

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

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

LLVM IR (-O2):
define i32 @refresh_kcal_display() {
%1 = tail call i32 (...) @refresh_qlut_kcal_display()
ret i32 %1
}
/* Variables and functions */
unsigned long sysfs_get_freq_transitions(unsigned int);
unsigned long cpufreq_get_transitions(unsigned int cpu) {
  return sysfs_get_freq_transitions(cpu);
}


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

x86 assembly (clang, -O2):
<cpufreq_get_transitions>:
jmp    1030 <sysfs_get_freq_transitions@plt>

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

LLVM IR (-O2):
define i64 @cpufreq_get_transitions(i32 %0) {
%2 = tail call i64 @sysfs_get_freq_transitions(i32 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void printchar(char c, size_t n) {
  size_t i;
  for (i = 0; i < n; i++)
    fputc(c, stdout);
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115d <printchar+0x4d>
mov    -0x1(%rbp),%al
mov    0x2e9e(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112a <printchar+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
push   %rbp
push   %r14
push   %rbx
test   %rsi,%rsi
je     1140 <printchar+0x30>
mov    %rsi,%rbx
mov    0x2ebd(%rip),%r14
movsbl %dil,%ebp
nopw   0x0(%rax,%rax,1)
mov    (%r14),%esi
mov    %ebp,%edi
call   1030 <fputc@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <printchar+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32 0
define void @printchar(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
%5 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %14, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8, i8* %3
%12 = load i32, i32* @stdout
%13 = call i32 @fputc(i8 signext %11, i32 %12)
br label %14
14: ; preds = %10
%15 = load i64, i64* %5
%16 = add i64 %15, 1
store i64 %16, i64* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @printchar(i8 signext %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = load i32, i32* @stdout
%7 = tail call i32 @fputc(i8 signext %0, i32 %6)
%8 = add nuw i64 %5, 1
%9 = icmp eq i64 %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncmp(char *, char const *, int);
void bufferAccessOutOfBounds_strncmp(void) {
  const char src[3] = "abc";
  char dest[1] = "a";
  (void)strncmp(dest, src, 1);
  (void)strncmp(dest, src, 2);
  (void)strncmp(dest, src, 3);
}


x86 assembly (clang, -O0):
<bufferAccessOutOfBounds_strncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xed9(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xed1(%rip),%al
mov    %al,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x3(%rbp),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
lea    -0x4(%rbp),%rdi
lea    -0x3(%rbp),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
lea    -0x4(%rbp),%rdi
lea    -0x3(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufferAccessOutOfBounds_strncmp>:
push   %r14
push   %rbx
push   %rax
movb   $0x63,0x6(%rsp)
movw   $0x6261,0x4(%rsp)
movb   $0x61,0x3(%rsp)
lea    0x3(%rsp),%rbx
lea    0x4(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.bufferAccessOutOfBounds_strncmp.src = [3 x i8] c"abc"
@__const.bufferAccessOutOfBounds_strncmp.dest = [1 x i8] c"a"
define void @bufferAccessOutOfBounds_strncmp() {
%1 = alloca [3 x i8]
%2 = alloca [1 x i8]
%3 = bitcast [3 x i8]* %1 to i8*
%4 = bitcast [1 x i8]* %2 to i8*
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%7 = call i32 @strncmp(i8* %5, i8* %6, i32 1)
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%10 = call i32 @strncmp(i8* %8, i8* %9, i32 2)
%11 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%13 = call i32 @strncmp(i8* %11, i8* %12, i32 3)
ret void
}

LLVM IR (-O2):
@__const.bufferAccessOutOfBounds_strncmp.src = [3 x i8] c"abc"
define void @bufferAccessOutOfBounds_strncmp() {
%1 = alloca [3 x i8]
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
store i8 97, i8* %4
%5 = call i32 @strncmp(i8* %4, i8* %3, i32 1)
%6 = call i32 @strncmp(i8* %4, i8* %3, i32 2)
%7 = call i32 @strncmp(i8* %4, i8* %3, i32 3)
ret void
}
int foo(int n) {
  char *p, *q;
  if (1) {
    char i[n];
    p = __builtin_alloca(8);
    p[0] = 1;
  }
  q = __builtin_alloca(64);
  __builtin_memset(q, 0, 64);
  return !p[0];
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
lea    -0x70(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = alloca i8, i64 8
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 1, i8* %13
%14 = load i8*, i8** %5
%15 = alloca i8, i64 64
store i8* %15, i8** %4
%16 = load i8*, i8** %4
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = icmp ne i8 %19, 0
%21 = xor i1 %20, true
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clearLastError();
int getBoardType();
scalar_t__ initPinGPIO(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ setLastError(char *);
int boardInit() {
  clearLastError();
  int board = getBoardType();
  printf("BoardType:%d\n", board);
  if (initPinGPIO(board))
    setLastError("Fail to initPinGPIO");
  return board;
}


x86 assembly (clang, -O0):
<boardInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <clearLastError@plt>
mov    $0x0,%al
call   1070 <getBoardType@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <initPinGPIO@plt>
cmp    $0x0,%rax
je     1196 <boardInit+0x46>
lea    0xe7d(%rip),%rdi
call   1060 <setLastError@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<boardInit>:
push   %rbx
xor    %eax,%eax
call   1050 <clearLastError@plt>
xor    %eax,%eax
call   1070 <getBoardType@plt>
mov    %eax,%ebx
lea    0xe98(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1030 <initPinGPIO@plt>
test   %rax,%rax
je     1187 <boardInit+0x37>
lea    0xe8c(%rip),%rdi
call   1060 <setLastError@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"BoardType:%d\0A\00"
@.str.1 = [20 x i8] c"Fail to initPinGPIO\00"
define i32 @boardInit() {
%1 = alloca i32
%2 = call i32 (...) @clearLastError()
%3 = call i32 (...) @getBoardType()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i64 @initPinGPIO(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @setLastError(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"BoardType:%d\0A\00"
@.str.1 = [20 x i8] c"Fail to initPinGPIO\00"
define i32 @boardInit() {
%1 = tail call i32 (...) @clearLastError()
%2 = tail call i32 (...) @getBoardType()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i64 @initPinGPIO(i32 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i32 @setLastError(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret i32 %2
}
void SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond = [61 x i8] c"SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond\00"
define void @SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @__func__.SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond = [61 x i8] c"SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond\00"
define void @SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @__func__.SteamAPI_ISteamMatchmakingPingResponse_ServerFailedToRespond, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct point {
  int dummy;
};

/* Variables and functions */
int input_double(char *);
struct point *point_new(char, int, int);
int /*<<< orphan*/ printf(char *, char);
struct point *input_point(char point) {
  int x, y;
  printf("Please enter the coordinates for point %c:\n", point);
  x = input_double("  x");
  y = input_double("  y");
  return point_new(point, x, y);
}


x86 assembly (clang, -O0):
<input_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xebb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
call   1040 <input_double@plt>
mov    %eax,-0x8(%rbp)
lea    0xecc(%rip),%rdi
call   1040 <input_double@plt>
mov    %eax,-0xc(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movsbl %al,%edi
call   1050 <point_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_point>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
call   1040 <input_double@plt>
mov    %eax,%ebp
lea    0xed8(%rip),%rdi
call   1040 <input_double@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <point_new@plt>

LLVM IR (-O0):
%struct.point = type { i32 }
@.str = [44 x i8] c"Please enter the coordinates for point %c:\0A\00"
@.str.1 = [4 x i8] c" x\00"
@.str.2 = [4 x i8] c" y\00"
define %struct.point* @input_point(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = call i32 @input_double(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 %7, i32* %3
%8 = call i32 @input_double(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
store i32 %8, i32* %4
%9 = load i8, i8* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call %struct.point* @point_new(i8 signext %9, i32 %10, i32 %11)
ret %struct.point* %12
}

LLVM IR (-O2):
%struct.point = type { i32 }
@.str = [44 x i8] c"Please enter the coordinates for point %c:\0A\00"
@.str.1 = [4 x i8] c" x\00"
@.str.2 = [4 x i8] c" y\00"
define %struct.point* @input_point(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = tail call i32 @input_double(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @input_double(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call %struct.point* @point_new(i8 signext %0, i32 %3, i32 %4)
ret %struct.point* %5
}
int fun1265() { return 1265; }


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

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

LLVM IR (-O0):
define i32 @fun1265() {
ret i32 1265
}

LLVM IR (-O2):
define i32 @fun1265() {
ret i32 1265
}
/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ var(double *, double);
double stddev(double *x, double n) { return sqrt(var(x, n)); }


x86 assembly (clang, -O0):
<stddev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1030 <var@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stddev>:
push   %rax
call   1030 <var@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @stddev(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %4
%7 = call i32 @var(double* %5, double %6)
%8 = call double @sqrt(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @stddev(double* %0, double %1) {
%3 = tail call i32 @var(double* %0, double %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
float fwrap(float x) { return x - (long)x; }


x86 assembly (clang, -O0):
<fwrap>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvttss2si -0x4(%rbp),%rax
cvtsi2ss %rax,%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwrap>:
cvttss2si %xmm0,%rax
cvtsi2ss %rax,%xmm1
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fwrap(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i64
%6 = sitofp i64 %5 to float
%7 = fsub float %3, %6
ret float %7
}

LLVM IR (-O2):
define float @fwrap(float %0) {
%2 = fptosi float %0 to i64
%3 = sitofp i64 %2 to float
%4 = fsub float %0, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
void set_blocking(int s) {
  int flags;
  flags = fcntl(s, F_GETFL);
  if (flags >= 0) {
    fcntl(s, F_SETFL, flags & ~O_NONBLOCK);
  }
}


x86 assembly (clang, -O0):
<set_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     115f <set_blocking+0x4f>
mov    -0x4(%rbp),%edi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_blocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
test   %eax,%eax
js     1149 <set_blocking+0x39>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%ecx
not    %ecx
and    %ecx,%eax
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_blocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %3
%13 = load i32, i32* @O_NONBLOCK
%14 = xor i32 %13, -1
%15 = and i32 %12, %14
%16 = call i32 (i32, i32, ...) @fcntl(i32 %10, i32 %11, i32 %15)
br label %17
17: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_blocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = xor i32 %7, -1
%9 = and i32 %3, %8
%10 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %9)
br label %11
11: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(void *, size_t, int, int /*<<< orphan*/ *);
void write_to_file_pointer(void *fp, void *mem, size_t s) {
  fwrite(mem, s, 1, (FILE *)fp);
}


x86 assembly (clang, -O0):
<write_to_file_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_to_file_pointer>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define void @write_to_file_pointer(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fwrite(i8* %1, i64 %2, i32 1, i32* %4)
ret void
}
struct _Locale_name_hint *
_Locale_get_monetary_hint(struct _Locale_monetary *monetary
                          __attribute__((__unused__))) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct._Locale_name_hint = type opaque
%struct._Locale_monetary = type opaque
define %struct._Locale_name_hint* @_Locale_get_monetary_hint(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
ret %struct._Locale_name_hint* null
}

LLVM IR (-O2):
%struct._Locale_name_hint = type opaque
%struct._Locale_monetary = type opaque
define noalias %struct._Locale_name_hint* @_Locale_get_monetary_hint(%struct._Locale_monetary* nocapture readnone %0) {
ret %struct._Locale_name_hint* null
}
int getSeed(int i, int j) {
  int seed, x;
  seed = 0;
  for (x = 0; x < 4; x++)
    seed |= (1 << (x * 4 + j));
  for (x = 0; x < 4; x++)
    seed |= (1 << (x + i * 4));
  return seed;
}


x86 assembly (clang, -O0):
<getSeed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1146 <getSeed+0x46>
mov    -0x10(%rbp),%ecx
shl    $0x2,%ecx
add    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1118 <getSeed+0x18>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    117d <getSeed+0x7d>
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114d <getSeed+0x4d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSeed>:
lea    0x4(%rsi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
bts    %esi,%eax
lea    0x8(%rsi),%ecx
bts    %ecx,%eax
add    $0xc,%sil
bts    %esi,%eax
shl    $0x2,%edi
bts    %edi,%eax
lea    0x1(%rdi),%ecx
bts    %ecx,%eax
lea    0x2(%rdi),%ecx
bts    %ecx,%eax
or     $0x3,%dil
bts    %edi,%eax
ret

LLVM IR (-O0):
define i32 @getSeed(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32, i32* %6
%12 = mul nsw i32 %11, 4
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = shl i32 1, %14
%16 = load i32, i32* %5
%17 = or i32 %16, %15
store i32 %17, i32* %5
br label %18
18: ; preds = %10
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
store i32 0, i32* %6
br label %22
22: ; preds = %33, %21
%23 = load i32, i32* %6
%24 = icmp slt i32 %23, 4
br i1 %24, label %25, label %36
25: ; preds = %22
%26 = load i32, i32* %6
%27 = load i32, i32* %3
%28 = mul nsw i32 %27, 4
%29 = add nsw i32 %26, %28
%30 = shl i32 1, %29
%31 = load i32, i32* %5
%32 = or i32 %31, %30
store i32 %32, i32* %5
br label %33
33: ; preds = %25
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %22
36: ; preds = %22
%37 = load i32, i32* %5
ret i32 %37
}

LLVM IR (-O2):
define i32 @getSeed(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = add nsw i32 %1, 4
%5 = shl nuw i32 1, %4
%6 = or i32 %5, %3
%7 = add nsw i32 %1, 8
%8 = shl nuw i32 1, %7
%9 = or i32 %8, %6
%10 = add nsw i32 %1, 12
%11 = shl nuw i32 1, %10
%12 = or i32 %11, %9
%13 = shl nsw i32 %0, 2
%14 = shl nuw i32 1, %13
%15 = or i32 %14, %12
%16 = or i32 %13, 1
%17 = shl nuw i32 1, %16
%18 = or i32 %17, %15
%19 = or i32 %13, 2
%20 = shl nuw i32 1, %19
%21 = or i32 %20, %18
%22 = or i32 %13, 3
%23 = shl nuw i32 1, %22
%24 = or i32 %23, %21
ret i32 %24
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct rudp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ noWarnAbort();
struct rudp *rudpOpenBound(struct sockaddr_in *);
struct rudp *rudpMustOpenBound(struct sockaddr_in *sai) {
  struct rudp *ru = rudpOpenBound(sai);
  if (ru == NULL)
    noWarnAbort();
  return ru;
}


x86 assembly (clang, -O0):
<rudpMustOpenBound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rudpOpenBound@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <rudpMustOpenBound+0x2b>
mov    $0x0,%al
call   1040 <noWarnAbort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rudpMustOpenBound>:
push   %rbx
call   1030 <rudpOpenBound@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <rudpMustOpenBound+0x15>
xor    %eax,%eax
call   1040 <noWarnAbort@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.rudp = type { i32 }
%struct.sockaddr_in = type { i32 }
define %struct.rudp* @rudpMustOpenBound(%struct.sockaddr_in* %0) {
%2 = alloca %struct.sockaddr_in*
%3 = alloca %struct.rudp*
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %2
%4 = load %struct.sockaddr_in*, %struct.sockaddr_in** %2
%5 = call %struct.rudp* @rudpOpenBound(%struct.sockaddr_in* %4)
store %struct.rudp* %5, %struct.rudp** %3
%6 = load %struct.rudp*, %struct.rudp** %3
%7 = icmp eq %struct.rudp* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @noWarnAbort()
br label %10
10: ; preds = %8, %1
%11 = load %struct.rudp*, %struct.rudp** %3
ret %struct.rudp* %11
}

LLVM IR (-O2):
%struct.rudp = type { i32 }
%struct.sockaddr_in = type { i32 }
define %struct.rudp* @rudpMustOpenBound(%struct.sockaddr_in* %0) {
%2 = tail call %struct.rudp* @rudpOpenBound(%struct.sockaddr_in* %0)
%3 = icmp eq %struct.rudp* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @noWarnAbort()
br label %6
6: ; preds = %4, %1
ret %struct.rudp* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadu_si128(int /*<<< orphan*/ *);
__m128i loadu(const void *p) { return _mm_loadu_si128((__m128i *)p); }


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

x86 assembly (clang, -O2):
<loadu>:
jmp    1030 <_mm_loadu_si128@plt>

LLVM IR (-O0):
define i32 @loadu(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @_mm_loadu_si128(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @loadu(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @_mm_loadu_si128(i32* %2)
ret i32 %3
}
void early_init_dt_scan_reserved_mem(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ReadWord(char *, int /*<<< orphan*/ *);
int SearchVocab(char *);
scalar_t__ feof(int /*<<< orphan*/ *);
int ReadWordIndex(FILE *fin) {
  char word[180];
  ReadWord(word, fin);
  if (feof(fin))
    return -1;
  return SearchVocab(word);
}


x86 assembly (clang, -O0):
<ReadWordIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ReadWord@plt>
mov    -0x10(%rbp),%rdi
call   1030 <feof@plt>
cmp    $0x0,%rax
je     116e <ReadWordIndex+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <ReadWordIndex+0x4d>
lea    -0xd0(%rbp),%rdi
call   1050 <SearchVocab@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadWordIndex>:
push   %rbx
sub    $0xc0,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1040 <ReadWord@plt>
mov    %rbx,%rdi
call   1030 <feof@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1163 <ReadWordIndex+0x33>
mov    %rsp,%rdi
call   1050 <SearchVocab@plt>
add    $0xc0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ReadWordIndex(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca [180 x i8]
store i32* %0, i32** %3
%5 = getelementptr inbounds [180 x i8], [180 x i8]* %4, i64 0, i64 0
%6 = load i32*, i32** %3
%7 = call i32 @ReadWord(i8* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = call i64 @feof(i32* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %15
12: ; preds = %1
%13 = getelementptr inbounds [180 x i8], [180 x i8]* %4, i64 0, i64 0
%14 = call i32 @SearchVocab(i8* %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @ReadWordIndex(i32* %0) {
%2 = alloca [180 x i8]
%3 = getelementptr inbounds [180 x i8], [180 x i8]* %2, i64 0, i64 0
%4 = call i32 @ReadWord(i8* %3, i32* %0)
%5 = call i64 @feof(i32* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @SearchVocab(i8* %3)
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ %8, %7 ], [ -1, %1 ]
ret i32 %10
}