xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strccat(char *, char *);
int strlen(char *);
char *path_str(char *path, char *sub) {
  char *retval;
  if (path[strlen(path) - 1] != '/') {
    retval = strccat(path, "/");
  } else {
    retval = path;
  }
  retval = strccat(retval, sub);
  return retval;
}


x86 assembly (clang, -O0):
<path_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     1173 <path_str+0x53>
mov    -0x8(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1040 <strccat@plt>
mov    %rax,-0x18(%rbp)
jmp    117b <path_str+0x5b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strccat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0x2f,-0x1(%rax,%rbx,1)
je     114a <path_str+0x2a>
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strccat@plt>
mov    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strccat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i8* @path_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 47
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = call i8* @strccat(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %17, i8** %5
br label %20
18: ; preds = %2
%19 = load i8*, i8** %3
store i8* %19, i8** %5
br label %20
20: ; preds = %18, %15
%21 = load i8*, i8** %5
%22 = load i8*, i8** %4
%23 = call i8* @strccat(i8* %21, i8* %22)
store i8* %23, i8** %5
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i8* @path_str(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 47
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i8* @strccat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %2, %9
%12 = phi i8* [ %10, %9 ], [ %0, %2 ]
%13 = tail call i8* @strccat(i8* %12, i8* %1)
ret i8* %13
}
int a_twist_f_on_corner(corner)
int corner;
{
  int temp_arr[8];
  a_corner_unpack(corner, temp_arr);
  four_cycle(temp_arr, 5, 4, 0, 3);
  adjust_corner(temp_arr, 5, 4, 0, 3);
  return a_corner_pack(temp_arr);
}


x86 assembly (clang, -O0):
<a_twist_f_on_corner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1030 <a_corner_unpack@plt>
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
mov    $0x0,%al
call   1050 <four_cycle@plt>
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
mov    $0x0,%al
call   1040 <adjust_corner@plt>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1060 <a_corner_pack@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_twist_f_on_corner>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <a_corner_unpack@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
xor    %eax,%eax
call   1050 <four_cycle@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
xor    %eax,%eax
call   1040 <adjust_corner@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <a_corner_pack@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @a_twist_f_on_corner(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @a_corner_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 5, i32 4, i32 0, i32 3)
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @adjust_corner to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %9, i32 5, i32 4, i32 0, i32 3)
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%12 = call i32 (i32*, ...) bitcast (i32 (...)* @a_corner_pack to i32 (i32*, ...)*)(i32* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @a_twist_f_on_corner(i32 %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @a_corner_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 5, i32 4, i32 0, i32 3)
%7 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @adjust_corner to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 5, i32 4, i32 0, i32 3)
%8 = call i32 (i32*, ...) bitcast (i32 (...)* @a_corner_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %8
}
unsigned int hash_func(const char *str, unsigned int table_size) {
  unsigned int hash_value;
  unsigned int a = 127;
  for (hash_value = 0; *str != 0; ++str)
    hash_value = (a * hash_value + *str) % table_size;
  return hash_value;
}


x86 assembly (clang, -O0):
<hash_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x7f,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1152 <hash_func+0x52>
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1119 <hash_func+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_func>:
mov    (%rdi),%al
test   %al,%al
je     112e <hash_func+0x2e>
add    $0x1,%rdi
xor    %edx,%edx
nopl   0x0(%rax)
movsbl %al,%ecx
mov    %edx,%eax
shl    $0x7,%eax
sub    %edx,%eax
add    %ecx,%eax
xor    %edx,%edx
div    %esi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash_func+0x10>
mov    %edx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_func(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 i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i8* [ %13, %5 ], [ %0, %2 ]
%8 = phi i32 [ %12, %5 ], [ 0, %2 ]
%9 = sext i8 %6 to i32
%10 = mul i32 %8, 127
%11 = add i32 %10, %9
%12 = urem i32 %11, %1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dummy_printer(FILE *file __attribute__((unused)),
                  const char *format __attribute__((unused)), ...) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @dummy_printer(i32* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nrerror(char *);
void usage(void) {
  nrerror("usage: RNApdist [-Xpmfc] [-B [file]] [-T temp] [-4] [-d] [-noGU]\n"
          "                [-noCloseGU] [-noLP] [-e e_set] [-P paramfile] "
          "[-nsp pairs]");
}


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

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

LLVM IR (-O0):
@.str = [141 x i8] c"usage: RNApdist [-Xpmfc] [-B [file]] [-T temp] [-4] [-d] [-noGU]\0A [-noCloseGU] [-noLP] [-e e_set] [-P paramfile] [-nsp pairs]\00"
define void @usage() {
%1 = call i32 @nrerror(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [141 x i8] c"usage: RNApdist [-Xpmfc] [-B [file]] [-T temp] [-4] [-d] [-noGU]\0A [-noCloseGU] [-noLP] [-e e_set] [-P paramfile] [-nsp pairs]\00"
define void @usage() {
%1 = tail call i32 @nrerror(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0))
ret void
}
char *strerror$UNIX2003(int errnum) { return strerror(errnum); }


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

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

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

LLVM IR (-O2):
define i8* @"strerror$UNIX2003"(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
/* Variables and functions */
int modpow(int, int, int);
int encode(int m, int e, int n) { return modpow(m, e, n); }


x86 assembly (clang, -O0):
<encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <modpow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode>:
jmp    1030 <modpow@plt>

LLVM IR (-O0):
define i32 @encode(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 = call i32 @modpow(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @encode(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @modpow(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int int8_t;

/* Variables and functions */
void GPIO_clr(uint8_t pin) {
  ;
  int8_t set1 = pin - 32;
  if (set1 < 0)
    (*((volatile uint32_t *)(0x00200028))) = (1 << pin);
  else
    (*((volatile uint32_t *)(0x0020002C))) = (1 << set1);
}


x86 assembly (clang, -O0):
<GPIO_clr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1132 <GPIO_clr+0x32>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x200028,%eax
mov    %ecx,(%rax)
jmp    1145 <GPIO_clr+0x45>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x20002c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_clr>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    $0x1f,%edi
jg     1116 <GPIO_clr+0x16>
mov    %eax,0x200028
ret
mov    %eax,0x20002c
ret

LLVM IR (-O0):
define void @GPIO_clr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = shl i32 1, %9
store volatile i32 %10, i32* inttoptr (i64 2097192 to i32*)
br label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = shl i32 1, %12
store volatile i32 %13, i32* inttoptr (i64 2097196 to i32*)
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
define void @GPIO_clr(i32 %0) {
%2 = icmp slt i32 %0, 32
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = shl nuw i32 1, %0
store volatile i32 %4, i32* inttoptr (i64 2097192 to i32*)
br label %8
5: ; preds = %1
%6 = add nsw i32 %0, -32
%7 = shl nuw i32 1, %6
store volatile i32 %7, i32* inttoptr (i64 2097196 to i32*)
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, unsigned int, int);
int set_watchdog(int pi, unsigned user_gpio, unsigned timeout) {
  return pigpio_command(pi, 9, user_gpio, timeout, 1);
}


x86 assembly (clang, -O0):
<set_watchdog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x9,%esi
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_watchdog>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x9,%esi
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @set_watchdog(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 = call i32 @pigpio_command(i32 %7, i32 9, i32 %8, i32 %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @set_watchdog(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pigpio_command(i32 %0, i32 9, i32 %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("2004"
         "-"
         "2009"
         " "
         "Frontier Kernel Project");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"2004-2009 Frontier Kernel Project\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"2004-2009 Frontier Kernel Project\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, char const *, struct timespec const *, int);
int utimensat(int fd, const char *path, const struct timespec times[2],
              int flags) {
  return syscall(348, fd, path, times, flags);
}


x86 assembly (clang, -O0):
<utimensat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x15c,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utimensat>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x15c,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @utimensat(i32 %0, i8* %1, %struct.timespec* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.timespec*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.timespec* %2, %struct.timespec** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load %struct.timespec*, %struct.timespec** %7
%12 = load i32, i32* %8
%13 = call i32 @syscall(i32 348, i32 %9, i8* %10, %struct.timespec* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @utimensat(i32 %0, i8* %1, %struct.timespec* %2, i32 %3) {
%5 = tail call i32 @syscall(i32 348, i32 %0, i8* %1, %struct.timespec* %2, i32 %3)
ret i32 %5
}
double rgbToXyzZ(int rin, int gin, int bin) {
  double r = ((double)rin / 255.0);
  double g = ((double)gin / 255.0);
  double b = ((double)bin / 255.0);
  return (r * 0.019334) + (g * 0.119193) + (b * 0.950227);
}


x86 assembly (clang, -O0):
<rgbToXyzZ>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xefe(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xee8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  0xeb4(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  0xe82(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgbToXyzZ>:
cvtsi2sd %edi,%xmm1
movsd  0xef4(%rip),%xmm2
divsd  %xmm2,%xmm1
cvtsi2sd %esi,%xmm3
divsd  %xmm2,%xmm3
cvtsi2sd %edx,%xmm0
divsd  %xmm2,%xmm0
mulsd  0xee0(%rip),%xmm3
mulsd  0xee0(%rip),%xmm1
addsd  %xmm3,%xmm1
mulsd  0xedc(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @rgbToXyzZ(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 2.550000e+02
store double %12, double* %7
%13 = load i32, i32* %5
%14 = sitofp i32 %13 to double
%15 = fdiv double %14, 2.550000e+02
store double %15, double* %8
%16 = load i32, i32* %6
%17 = sitofp i32 %16 to double
%18 = fdiv double %17, 2.550000e+02
store double %18, double* %9
%19 = load double, double* %7
%20 = load double, double* %8
%21 = fmul double %20, 1.191930e-01
%22 = call double @llvm.fmuladd.f64(double %19, double 1.933400e-02, double %21)
%23 = load double, double* %9
%24 = call double @llvm.fmuladd.f64(double %23, double 9.502270e-01, double %22)
ret double %24
}

LLVM IR (-O2):
define double @rgbToXyzZ(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to double
%5 = fdiv double %4, 2.550000e+02
%6 = sitofp i32 %1 to double
%7 = fdiv double %6, 2.550000e+02
%8 = sitofp i32 %2 to double
%9 = fdiv double %8, 2.550000e+02
%10 = fmul double %7, 1.191930e-01
%11 = tail call double @llvm.fmuladd.f64(double %5, double 1.933400e-02, double %10)
%12 = tail call double @llvm.fmuladd.f64(double %9, double 9.502270e-01, double %11)
ret double %12
}
/* Type definitions */
typedef char tree;

/* Variables and functions */
scalar_t__ malloc(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
struct tree *cusstrdup(char *s) {
  char *p;
  p = (char *)malloc(strlen(s));
  if (p != NULL) {
    strcpy(p, s);
  }
  return p;
}


x86 assembly (clang, -O0):
<cusstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <cusstrdup+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cusstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1156 <cusstrdup+0x26>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tree = type opaque
define %struct.tree* @cusstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
%16 = bitcast i8* %15 to %struct.tree*
ret %struct.tree* %16
}

LLVM IR (-O2):
%struct.tree = type opaque
define %struct.tree* @cusstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = inttoptr i64 %3 to i8*
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %8
8: ; preds = %5, %1
%9 = inttoptr i64 %3 to %struct.tree*
ret %struct.tree* %9
}
void swap(int a, int b) {
  int temp;
  temp = a;
  a = b;
  b = temp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int get_sp();
int /*<<< orphan*/ printf(char *, int);
int main() { printf("Stack pointer (ESP):0x%x\n", get_sp()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get_sp@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"Stack pointer (ESP):0x%x\0A\00"
define i32 @main() {
%1 = call i32 (...) @get_sp()
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Stack pointer (ESP):0x%x\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @get_sp()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
__attribute__((no, noclone)) unsigned short foo15(unsigned short arg) {
  unsigned short ret = 1;
  if (arg + 1 < ((!1) ? -(1L << (sizeof(char) * 8 - 1)) : 0) + 1 ||
      arg + 1 > ((!1) ? ((1L << (sizeof(char) * 8 - 1)) - 1)
                      : ((1L << (sizeof(char) * 8)) - 1)) -
                    1)
    return ret;
  arg = arg + 1;
  ret = (char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo15>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0x1,%rax
jl     1139 <foo15+0x39>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0xfe,%rax
jle    1146 <foo15+0x46>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1164 <foo15+0x64>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movsbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo15>:
lea    0x1(%rdi),%ecx
cmp    $0xfe,%edi
mov    $0x1,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @foo15(i16 zeroext %0) {
%2 = add i16 %0, 1
%3 = icmp ugt i16 %0, 253
%4 = select i1 %3, i16 1, i16 %2
ret i16 %4
}
indreg0adrreg1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((*p0) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl (%rax),%eax
mov    -0x20(%rbp),%rcx
movzwl 0x87a22(%rcx),%ecx
cmp    %ecx,%eax
jg     1145 <indreg0adrreg1+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <indreg0adrreg1+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adrreg1>:
movzwl (%r8),%ecx
xor    %eax,%eax
cmp    0x87a22(%r9),%cx
setbe  %al
ret

LLVM IR (-O0):
define i32 @indreg0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = load i16, i16* %16
%18 = zext i16 %17 to i32
%19 = load i16*, i16** %13
%20 = getelementptr inbounds i16, i16* %19, i64 277777
%21 = load i16, i16* %20
%22 = zext i16 %21 to i32
%23 = icmp sle i32 %18, %22
br i1 %23, label %24, label %25
24: ; preds = %6
store i32 1, i32* %7
br label %26
25: ; preds = %6
store i32 0, i32* %7
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @indreg0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = load i16, i16* %4
%8 = getelementptr inbounds i16, i16* %5, i64 277777
%9 = load i16, i16* %8
%10 = icmp ule i16 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ passwd;

/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int /*<<< orphan*/ explicit_bzero(char *, int);
scalar_t__ strlen(char *);
void explicit_bzero2_clear_mypassword() {
  char passwd[7] = "passwd";
  explicit_bzero(passwd, sizeof(passwd));
  clang_analyzer_eval(strlen(passwd) == 0);
  clang_analyzer_eval(passwd[0] == '\0');
}


x86 assembly (clang, -O0):
<explicit_bzero2_clear_mypassword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x7(%rbp),%rdi
mov    $0x7,%esi
call   1040 <explicit_bzero@plt>
lea    -0x7(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
movsbl -0x7(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<explicit_bzero2_clear_mypassword>:
push   %rax
movl   $0x647773,0x3(%rsp)
movl   $0x73736170,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <explicit_bzero@plt>
xor    %edi,%edi
cmpb   $0x0,(%rsp)
sete   %dil
call   1040 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmpb   $0x0,(%rsp)
sete   %dil
call   1040 <clang_analyzer_eval@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.explicit_bzero2_clear_mypassword.passwd = [7 x i8] c"passwd\00"
define void @explicit_bzero2_clear_mypassword() {
%1 = alloca [7 x i8]
%2 = bitcast [7 x i8]* %1 to i8*
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = call i32 @explicit_bzero(i8* %3, i32 7)
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%6 = call i64 @strlen(i8* %5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @clang_analyzer_eval(i32 %8)
%10 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @clang_analyzer_eval(i32 %14)
ret void
}

LLVM IR (-O2):
@__const.explicit_bzero2_clear_mypassword.passwd = [7 x i8] c"passwd\00"
define void @explicit_bzero2_clear_mypassword() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @explicit_bzero(i8* %2, i32 7)
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @clang_analyzer_eval(i32 %6)
%8 = load i8, i8* %2
%9 = icmp eq i8 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @clang_analyzer_eval(i32 %10)
ret void
}
__attribute__((optnone)) int foo1(int a) { return a + 1; }


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

x86 assembly (clang, -O2):
<foo1>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @foo1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}
void VecSelfAdd3iv(int v[3], const int a[3]) {
  v[0] += a[0];
  v[1] += a[1];
  v[2] += a[2];
}


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

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

LLVM IR (-O0):
define void @VecSelfAdd3iv(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %7
store i32 %11, i32* %9
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = add nsw i32 %17, %14
store i32 %18, i32* %16
%19 = load i32*, i32** %4
%20 = getelementptr inbounds i32, i32* %19, i64 2
%21 = load i32, i32* %20
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 2
%24 = load i32, i32* %23
%25 = add nsw i32 %24, %21
store i32 %25, i32* %23
ret void
}

LLVM IR (-O2):
define void @VecSelfAdd3iv(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = add nsw i32 %4, %3
store i32 %5, i32* %0
%6 = getelementptr inbounds i32, i32* %1, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = add nsw i32 %9, %7
store i32 %10, i32* %8
%11 = getelementptr inbounds i32, i32* %1, i64 2
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %0, i64 2
%14 = load i32, i32* %13
%15 = add nsw i32 %14, %12
store i32 %15, i32* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FreeShare(void *);
void DeleteArray(void *pMem) { FreeShare(pMem); }


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

x86 assembly (clang, -O2):
<DeleteArray>:
jmp    1030 <FreeShare@plt>

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

LLVM IR (-O2):
define void @DeleteArray(i8* %0) {
%2 = tail call i32 @FreeShare(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ binary_encodemap();
int main() {
  binary_encodemap();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @binary_encodemap()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hi!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"hi!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct nn_epbase {
  int dummy;
};

/* Variables and functions */
int nn_cinproc_create(void *, struct nn_epbase **);
int nn_inproc_connect(void *hint, struct nn_epbase **epbase) {
  return nn_cinproc_create(hint, epbase);
}


x86 assembly (clang, -O0):
<nn_inproc_connect>:
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   1030 <nn_cinproc_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_inproc_connect>:
jmp    1030 <nn_cinproc_create@plt>

LLVM IR (-O0):
%struct.nn_epbase = type { i32 }
define i32 @nn_inproc_connect(i8* %0, %struct.nn_epbase** %1) {
%3 = alloca i8*
%4 = alloca %struct.nn_epbase**
store i8* %0, i8** %3
store %struct.nn_epbase** %1, %struct.nn_epbase*** %4
%5 = load i8*, i8** %3
%6 = load %struct.nn_epbase**, %struct.nn_epbase*** %4
%7 = call i32 @nn_cinproc_create(i8* %5, %struct.nn_epbase** %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.nn_epbase = type { i32 }
define i32 @nn_inproc_connect(i8* %0, %struct.nn_epbase** %1) {
%3 = tail call i32 @nn_cinproc_create(i8* %0, %struct.nn_epbase** %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ wattrset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ wprintw(int /*<<< orphan*/ *, char *, char *);
void tx_printkeyhelp(char *keytext, char *desc, WINDOW *win, int highattr,
                     int textattr) {
  wattrset(win, highattr);
  wprintw(win, "%s", keytext);
  wattrset(win, textattr);
  wprintw(win, "%s", desc);
}


x86 assembly (clang, -O0):
<tx_printkeyhelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <wattrset@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeaa(%rip),%rsi
call   1040 <wprintw@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1030 <wattrset@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1040 <wprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx_printkeyhelp>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r15d
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%rbp
mov    %rdx,%rdi
mov    %ecx,%esi
call   1030 <wattrset@plt>
lea    0xebb(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
call   1040 <wprintw@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1030 <wattrset@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <wprintw@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @tx_printkeyhelp(i8* %0, i8* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %8
%12 = load i32, i32* %9
%13 = call i32 @wattrset(i32* %11, i32 %12)
%14 = load i32*, i32** %8
%15 = load i8*, i8** %6
%16 = call i32 @wprintw(i32* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32*, i32** %8
%18 = load i32, i32* %10
%19 = call i32 @wattrset(i32* %17, i32 %18)
%20 = load i32*, i32** %8
%21 = load i8*, i8** %7
%22 = call i32 @wprintw(i32* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %21)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @tx_printkeyhelp(i8* %0, i8* %1, i32* %2, i32 %3, i32 %4) {
%6 = tail call i32 @wattrset(i32* %2, i32 %3)
%7 = tail call i32 @wprintw(i32* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @wattrset(i32* %2, i32 %4)
%9 = tail call i32 @wprintw(i32* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLPROC_EBPSAFE(int);
void park_init() { RCT2_CALLPROC_EBPSAFE(0x00667132); }


x86 assembly (clang, -O0):
<park_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x667132,%edi
call   1030 <RCT2_CALLPROC_EBPSAFE@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<park_init>:
mov    $0x667132,%edi
jmp    1030 <RCT2_CALLPROC_EBPSAFE@plt>

LLVM IR (-O0):
define void @park_init() {
%1 = call i32 @RCT2_CALLPROC_EBPSAFE(i32 6713650)
ret void
}

LLVM IR (-O2):
define void @park_init() {
%1 = tail call i32 @RCT2_CALLPROC_EBPSAFE(i32 6713650)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ CopyToVRAM(int /*<<< orphan*/ volatile *,
                              int /*<<< orphan*/ const *, int);
void LoadPaletteObjData(int first_entry, const void *data, int data_bytes) {
  CopyToVRAM(((volatile uint16_t *)(0x5000200)) + first_entry,
             (const uint16_t *)data, data_bytes / 2);
}


x86 assembly (clang, -O0):
<LoadPaletteObjData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x4(%rbp),%rax
mov    $0x5000200,%edi
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <CopyToVRAM@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoadPaletteObjData>:
movslq %edi,%rax
lea    0x5000200(,%rax,4),%rdi
05
mov    %edx,%eax
shr    $0x1f,%eax
add    %eax,%edx
sar    %edx
jmp    1030 <CopyToVRAM@plt>

LLVM IR (-O0):
define void @LoadPaletteObjData(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* inttoptr (i64 83886592 to i32*), i64 %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %6
%13 = sdiv i32 %12, 2
%14 = call i32 @CopyToVRAM(i32* %9, i32* %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @LoadPaletteObjData(i32 %0, i8* %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* inttoptr (i64 83886592 to i32*), i64 %4
%6 = bitcast i8* %1 to i32*
%7 = sdiv i32 %2, 2
%8 = tail call i32 @CopyToVRAM(i32* %5, i32* %6, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int num = 65;
  int count = 0;
  while (num > 0) {
    num = num & (num - 1);
    count++;
  }
  printf("%d", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x41,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1153 <main+0x43>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bfalgo(char *, int, int, int, int, int, int, int, int);
int /*<<< orphan*/ popCells(int);
int pushCells(int);
void incrementXbyY2(int x, int y) {
  int temp0 = pushCells(1);
  bfalgo("$[-] $[$+$+$-] $[$+$-]", temp0, y, x, temp0, y, temp0, y, temp0);
  popCells(1);
}


x86 assembly (clang, -O0):
<incrementXbyY2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <pushCells@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x8(%rbp),%r9d
mov    -0xc(%rbp),%r11d
mov    -0x8(%rbp),%r10d
mov    -0xc(%rbp),%eax
lea    0xe92(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1040 <bfalgo@plt>
mov    $0x1,%edi
call   1050 <popCells@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<incrementXbyY2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1,%edi
call   1030 <pushCells@plt>
sub    $0x8,%rsp
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
mov    %ebx,%r9d
push   %rax
push   %rbx
push   %rax
call   1040 <bfalgo@plt>
add    $0x20,%rsp
mov    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <popCells@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"$[-] $[$+$+$-] $[$+$-]\00"
define void @incrementXbyY2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @pushCells(i32 1)
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @bfalgo(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12, i32 %13, i32 %14)
%16 = call i32 @popCells(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"$[-] $[$+$+$-] $[$+$-]\00"
define void @incrementXbyY2(i32 %0, i32 %1) {
%3 = tail call i32 @pushCells(i32 1)
%4 = tail call i32 @bfalgo(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %1, i32 %0, i32 %3, i32 %1, i32 %3, i32 %1, i32 %3)
%5 = tail call i32 @popCells(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World! ");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World! \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double updateMean(int ns, double prevMean, double newX) {
  double nplus = (double)ns + 1;
  return ((1.0 - (1.0 / nplus)) * prevMean + (1.0 / nplus) * newX);
}


x86 assembly (clang, -O0):
<updateMean>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed1(%rip),%xmm1
divsd  -0x20(%rbp),%xmm1
movsd  0xec4(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xeb3(%rip),%xmm1
divsd  -0x20(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateMean>:
cvtsi2sd %edi,%xmm2
movsd  0xef4(%rip),%xmm3
addsd  %xmm3,%xmm2
movapd %xmm3,%xmm4
divsd  %xmm2,%xmm4
subsd  %xmm4,%xmm3
mulsd  %xmm1,%xmm4
mulsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @updateMean(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
store double %2, double* %6
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fadd double %9, 1.000000e+00
store double %10, double* %7
%11 = load double, double* %7
%12 = fdiv double 1.000000e+00, %11
%13 = fsub double 1.000000e+00, %12
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fdiv double 1.000000e+00, %15
%17 = load double, double* %6
%18 = fmul double %16, %17
%19 = call double @llvm.fmuladd.f64(double %13, double %14, double %18)
ret double %19
}

LLVM IR (-O2):
define double @updateMean(i32 %0, double %1, double %2) {
%4 = sitofp i32 %0 to double
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double 1.000000e+00, %5
%7 = fsub double 1.000000e+00, %6
%8 = fmul double %6, %2
%9 = tail call double @llvm.fmuladd.f64(double %7, double %1, double %8)
ret double %9
}