xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage() {
  char *usage =
      "Usage:\n       autodjtg [-h]\n   \n   This tool automates the usage of "
      "djtgcfg from Digilent.\n   Currently does not support file paths as "
      "arguments.\n   In the meantime just run the tool from the directory\n   "
      "containing the .bit file you wish to program.";
  printf("%s\n", usage);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xfbd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [251 x i8] c"Usage:\0A autodjtg [-h]\0A \0A This tool automates the usage of djtgcfg from Digilent.\0A Currently does not support file paths as arguments.\0A In the meantime just run the tool from the directory\0A containing the .bit file you wish to program.\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @usage() {
%1 = alloca i8*
store i8* getelementptr inbounds ([251 x i8], [251 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [251 x i8] c"Usage:\0A autodjtg [-h]\0A \0A This tool automates the usage of djtgcfg from Digilent.\0A Currently does not support file paths as arguments.\0A In the meantime just run the tool from the directory\0A containing the .bit file you wish to program.\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([251 x i8], [251 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ testByte0();
int /*<<< orphan*/ testByte1();
int /*<<< orphan*/ testByte2();
int /*<<< orphan*/ testByte3();
int /*<<< orphan*/ testShort0();
int /*<<< orphan*/ testShort1();
int main() {
  testShort0();
  testShort1();
  testByte0();
  testByte1();
  testByte2();
  testByte3();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <testShort0@plt>
mov    $0x0,%al
call   1030 <testShort1@plt>
mov    $0x0,%al
call   1080 <testByte0@plt>
mov    $0x0,%al
call   1040 <testByte1@plt>
mov    $0x0,%al
call   1070 <testByte2@plt>
mov    $0x0,%al
call   1050 <testByte3@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <testShort0@plt>
xor    %eax,%eax
call   1030 <testShort1@plt>
xor    %eax,%eax
call   1080 <testByte0@plt>
xor    %eax,%eax
call   1040 <testByte1@plt>
xor    %eax,%eax
call   1070 <testByte2@plt>
xor    %eax,%eax
call   1050 <testByte3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @testShort0()
%2 = call i32 (...) @testShort1()
%3 = call i32 (...) @testByte0()
%4 = call i32 (...) @testByte1()
%5 = call i32 (...) @testByte2()
%6 = call i32 (...) @testByte3()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testShort0()
%2 = tail call i32 (...) @testShort1()
%3 = tail call i32 (...) @testByte0()
%4 = tail call i32 (...) @testByte1()
%5 = tail call i32 (...) @testByte2()
%6 = tail call i32 (...) @testByte3()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void local_array_good() {
  char o[10];
  o[0] = 'a';
  char c = o[0];
  free(o);
}


x86 assembly (clang, -O0):
<local_array_good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0xb(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_array_good>:
sub    $0x18,%rsp
movb   $0x61,0xe(%rsp)
lea    0xe(%rsp),%rdi
call   1030 <free@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @local_array_good() {
%1 = alloca [10 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
store i8 97, i8* %3
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = load i8, i8* %4
store i8 %5, i8* %2
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @local_array_good() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
store i8 97, i8* %2
%3 = call i32 @free(i8* %2)
ret void
}
/* Type definitions */
struct user {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ psylbm_free_user(struct user *);
struct user *psylbm_make_user();
int make_user_test(void) {
  struct user *user = psylbm_make_user();
  psylbm_free_user(user);
  return 0;
}


x86 assembly (clang, -O0):
<make_user_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <psylbm_make_user@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <psylbm_free_user@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_user_test>:
push   %rax
xor    %eax,%eax
call   1030 <psylbm_make_user@plt>
mov    %rax,%rdi
call   1040 <psylbm_free_user@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.user = type { i32 }
define i32 @make_user_test() {
%1 = alloca %struct.user*
%2 = call %struct.user* (...) @psylbm_make_user()
store %struct.user* %2, %struct.user** %1
%3 = load %struct.user*, %struct.user** %1
%4 = call i32 @psylbm_free_user(%struct.user* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.user = type { i32 }
define i32 @make_user_test() {
%1 = tail call %struct.user* (...) @psylbm_make_user()
%2 = tail call i32 @psylbm_free_user(%struct.user* %1)
ret i32 0
}
void _empty_weightless_discover_vertex(struct Graph *graph, unsigned int parent,
                                       unsigned int vertex, void *arg) {
  (void)graph;
  (void)parent;
  (void)vertex;
  (void)arg;
}


x86 assembly (clang, -O0):
<_empty_weightless_discover_vertex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Graph = type opaque
define void @_empty_weightless_discover_vertex(%struct.Graph* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.Graph*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.Graph* %0, %struct.Graph** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load %struct.Graph*, %struct.Graph** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
ret void
}

LLVM IR (-O2):
%struct.Graph = type opaque
define void @_empty_weightless_discover_vertex(%struct.Graph* nocapture %0, i32 %1, i32 %2, i8* nocapture %3) {
ret void
}
void fb_ConsoleClear(int mode) {}


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

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

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

LLVM IR (-O2):
define void @fb_ConsoleClear(i32 %0) {
ret void
}
void freeNineDigits(int *value) {}


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

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

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

LLVM IR (-O2):
define void @freeNineDigits(i32* nocapture %0) {
ret void
}
int mod(int n, int d) { return (n % d); }


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

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int insist_write(int, char *, int);
int /*<<< orphan*/ perror(char *);
void reset_xterm_color(int fd) {
  if (insist_write(fd, "\033[0m", 4) != 4) {
    perror("reset_xterm_color: insist_write");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<reset_xterm_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xebb(%rip),%rsi
mov    $0x4,%edx
call   1030 <insist_write@plt>
cmp    $0x4,%eax
je     116e <reset_xterm_color+0x3e>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_xterm_color>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x4,%edx
call   1030 <insist_write@plt>
cmp    $0x4,%eax
jne    1149 <reset_xterm_color+0x19>
pop    %rax
ret
lea    0xeb5(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
@.str.1 = [32 x i8] c"reset_xterm_color: insist_write\00"
define void @reset_xterm_color(i32 %0) {
%2 = tail call i32 @insist_write(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp eq i32 %2, 4
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
void rop3_81_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = S & stk3;
  stk1 = *D | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_81_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_81_1_0>:
xor    (%rdi),%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_81_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = and i32 %39, %41
%43 = or i32 %36, %42
%44 = trunc i32 %43 to i8
%45 = load i8*, i8** %4
store i8 %44, i8* %45
ret void
}

LLVM IR (-O2):
define void @rop3_81_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %5, -1
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ibhead(int osvers, int osrel, int ossub) {
  printf("controller port  busy ipack/s opack/s "
         "igbps ogbps maxgbps lanes  _ib_");
}


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

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

LLVM IR (-O0):
@.str = [70 x i8] c"controller port busy ipack/s opack/s igbps ogbps maxgbps lanes _ib_\00"
define void @ibhead(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 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"controller port busy ipack/s opack/s igbps ogbps maxgbps lanes _ib_\00"
define void @ibhead(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *str) {
  int count;
  for (count = 0; *str != '\0'; ++str)
    ++count;
  return count;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <strlen+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
int fCount(int year, int month) { return (month <= 2) ? year - 1 : year; }


x86 assembly (clang, -O0):
<fCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     1122 <fCount+0x22>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <fCount+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fCount>:
mov    %edi,%eax
xor    %ecx,%ecx
cmp    $0x3,%esi
setl   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fCount(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 = icmp sle i32 %5, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %9, %7 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @fCount(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 3
%4 = sext i1 %3 to i32
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: disk mp tool\n");
  printf("	read	: display partition info \n");
  printf("	write	: write partition 4 sector number to mbr\n");
  printf("\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
lea    0xed0(%rip),%rdi
call   1040 <puts@plt>
lea    0xee4(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"usage: disk mp tool\0A\00"
@.str.1 = [33 x i8] c"\09read\09: display partition info \0A\00"
@.str.2 = [49 x i8] c"\09write\09: write partition 4 sector number to mbr\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [20 x i8] c"usage: disk mp tool\00"
@str.4 = [32 x i8] c"\09read\09: display partition info \00"
@str.5 = [48 x i8] c"\09write\09: write partition 4 sector number to mbr\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @exit(i32 1)
unreachable
}
void __av_wait() {}


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

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

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

LLVM IR (-O2):
define void @__av_wait() {
ret void
}
/* Variables and functions */
int getpid();
int snprintf(char *, size_t, char *, int, unsigned long);
int loghead_build_libc_free(char *str, size_t str_size, const void *addr,
                            size_t size) {
  return snprintf(str, str_size, "%d\tfree\t0x%08lx\t0", getpid(),
                  (unsigned long)addr);
}


x86 assembly (clang, -O0):
<loghead_build_libc_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%ecx
mov    -0x18(%rbp),%r8
lea    0xe9c(%rip),%rdx
call   1040 <snprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loghead_build_libc_free>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec4(%rip),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %eax,%ecx
mov    %r14,%r8
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <snprintf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%d\09free\090x%08lx\090\00"
define i32 @loghead_build_libc_free(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 (...) @getpid()
%12 = load i8*, i8** %7
%13 = ptrtoint i8* %12 to i64
%14 = call i32 @snprintf(i8* %9, i64 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [18 x i8] c"%d\09free\090x%08lx\090\00"
define i32 @loghead_build_libc_free(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 (...) @getpid()
%6 = ptrtoint i8* %2 to i64
%7 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %6)
ret i32 %7
}
int dr_tbb_max_workers() { return -1; }


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

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

LLVM IR (-O0):
define i32 @dr_tbb_max_workers() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @dr_tbb_max_workers() {
ret i32 -1
}
/* Variables and functions */
char and_b(char *, char *);
signed char intr_wrap_512(signed char p1, signed char p2) {
  return and_b(&p1, &p2);
}


x86 assembly (clang, -O0):
<intr_wrap_512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    -0x1(%rbp),%rdi
lea    -0x2(%rbp),%rsi
call   1030 <and_b@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_512>:
push   %rax
mov    %dil,0x7(%rsp)
mov    %sil,0x6(%rsp)
lea    0x7(%rsp),%rdi
lea    0x6(%rsp),%rsi
call   1030 <and_b@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @intr_wrap_512(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call signext i8 @and_b(i8* %3, i8* %4)
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @intr_wrap_512(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call signext i8 @and_b(i8* %3, i8* %4)
ret i8 %5
}
int f_bgt_mm2(float *a1, float *a2) { return !(__builtin_isgreater(*a1, *a2)); }


x86 assembly (clang, -O0):
<f_bgt_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bgt_mm2>:
movss  (%rdi),%xmm0
xor    %eax,%eax
ucomiss (%rsi),%xmm0
setbe  %al
ret

LLVM IR (-O0):
define i32 @f_bgt_mm2(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float*, float** %4
%8 = load float, float* %7
%9 = fcmp ogt float %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @f_bgt_mm2(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fcmp ule float %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int metatile_expire(struct storage_backend *store, const char *xmlconfig, int x,
                    int y, int z) {
  return 0;
}


x86 assembly (clang, -O0):
<metatile_expire>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.storage_backend = type opaque
define i32 @metatile_expire(%struct.storage_backend* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, int *);
int read_num(const char *str) {
  int n;
  sscanf(str, "%d", &n);
  return n;
}


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

x86 assembly (clang, -O2):
<read_num>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @read_num(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @read_num(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int /*<<< orphan*/ g(int, int *);
main() {
  int x[2];
  f(x);
  g(5, x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <f@plt>
lea    -0x8(%rbp),%rsi
mov    $0x5,%edi
call   1040 <g@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <f@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1040 <g@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%3 = call i32 @f(i32* %2)
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%5 = call i32 @g(i32 5, i32* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @f(i32* %3)
%5 = call i32 @g(i32 5, i32* %3)
ret i32 0
}
int _bdf_get_boolean(char *val) {
  int ok;
  ok = 0;
  if (val == 0 || *val == 0)
    return ok;
  switch (val[0]) {
  case '0':
  case 'F':
  case 'f':
  case 'N':
  case 'n':
    ok = 0;
    break;
  case '1':
  case 'T':
  case 't':
  case 'Y':
  case 'y':
    ok = 1;
    break;
  }
  return ok;
}


x86 assembly (clang, -O0):
<_bdf_get_boolean>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     112a <_bdf_get_boolean+0x2a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1135 <_bdf_get_boolean+0x35>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117b <_bdf_get_boolean+0x7b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x49,%eax
ja     1175 <_bdf_get_boolean+0x75>
mov    -0x20(%rbp),%rax
lea    0xea7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x14(%rbp)
jmp    1175 <_bdf_get_boolean+0x75>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bdf_get_boolean>:
xor    %eax,%eax
test   %rdi,%rdi
je     1130 <_bdf_get_boolean+0x30>
movsbl (%rdi),%ecx
test   %ecx,%ecx
je     1130 <_bdf_get_boolean+0x30>
lea    -0x54(%rcx),%edx
cmp    $0x25,%edx
ja     1126 <_bdf_get_boolean+0x26>
movabs $0x2100000021,%rsi
bt     %rdx,%rsi
jb     112b <_bdf_get_boolean+0x2b>
cmp    $0x31,%ecx
jne    1130 <_bdf_get_boolean+0x30>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @_bdf_get_boolean(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %7, %1
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %23
14: ; preds = %7
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
switch i32 %18, label %21 [
i32 48, label %19
i32 70, label %19
i32 102, label %19
i32 78, label %19
i32 110, label %19
i32 49, label %20
i32 84, label %20
i32 116, label %20
i32 89, label %20
i32 121, label %20
]
19: ; preds = %14, %14, %14, %14, %14
store i32 0, i32* %4
br label %21
20: ; preds = %14, %14, %14, %14, %14
store i32 1, i32* %4
br label %21
21: ; preds = %14, %20, %19
%22 = load i32, i32* %4
store i32 %22, i32* %2
br label %23
23: ; preds = %21, %12
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @_bdf_get_boolean(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = sext i8 %4 to i32
switch i32 %7, label %9 [
i32 121, label %8
i32 89, label %8
i32 116, label %8
i32 84, label %8
i32 49, label %8
]
8: ; preds = %6, %6, %6, %6, %6
br label %9
9: ; preds = %8, %6, %1, %3
%10 = phi i32 [ 0, %3 ], [ 0, %1 ], [ 1, %8 ], [ 0, %6 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen_safe(char *, char *);
float **load_2d_float_array(int *, int *, int /*<<< orphan*/ *);
float **load_plsa_posteriors_from_file(char *filein, int *num_topics_ptr,
                                       int *num_docs_ptr) {
  FILE *fp = fopen_safe(filein, "r");
  float **array = load_2d_float_array(num_topics_ptr, num_docs_ptr, fp);
  fclose(fp);
  return array;
}


x86 assembly (clang, -O0):
<load_plsa_posteriors_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <fopen_safe@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <load_2d_float_array@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_plsa_posteriors_from_file>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
lea    0xebe(%rip),%rsi
call   1030 <fopen_safe@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1050 <load_2d_float_array@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define float** @load_plsa_posteriors_from_file(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca float**
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = load i8*, i8** %4
%10 = call i32* @fopen_safe(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %7
%11 = load i32*, i32** %5
%12 = load i32*, i32** %6
%13 = load i32*, i32** %7
%14 = call float** @load_2d_float_array(i32* %11, i32* %12, i32* %13)
store float** %14, float*** %8
%15 = load i32*, i32** %7
%16 = call i32 @fclose(i32* %15)
%17 = load float**, float*** %8
ret float** %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define float** @load_plsa_posteriors_from_file(i8* %0, i32* %1, i32* %2) {
%4 = tail call i32* @fopen_safe(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call float** @load_2d_float_array(i32* %1, i32* %2, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret float** %5
}
/* Type definitions */
typedef int /*<<< orphan*/ BN_CTX;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int BN_div_internal(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                    int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
                    int /*<<< orphan*/ *, int /*<<< orphan*/);
int BN_div_nonct(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
                 const BIGNUM *divisor, BN_CTX *ctx) {
  return BN_div_internal(dv, rm, num, divisor, ctx, 0);
}


x86 assembly (clang, -O0):
<BN_div_nonct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
call   1030 <BN_div_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_div_nonct>:
xor    %r9d,%r9d
jmp    1030 <BN_div_internal@plt>

LLVM IR (-O0):
define i32 @BN_div_nonct(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @BN_div_internal(i32* %11, i32* %12, i32* %13, i32* %14, i32* %15, i32 0)
ret i32 %16
}

LLVM IR (-O2):
define i32 @BN_div_nonct(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @BN_div_internal(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void vt100_erase_bwdsol(void) {
  printf("\x1B[1K");
  fflush(stdout);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[1K\00"
@stdout = global i32 0
define void @vt100_erase_bwdsol() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[1K\00"
@stdout = global i32 0
define void @vt100_erase_bwdsol() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ linpack(long, int, void *, int *);
void linpackc_run(long nreps, int arsize, char *mempool, int *force_end) {
  linpack(nreps, arsize, (void *)mempool, force_end);
}


x86 assembly (clang, -O0):
<linpackc_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <linpack@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @linpackc_run(i64 %0, i32 %1, i8* %2, i32* %3) {
%5 = alloca i64
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
store i64 %0, i64* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%9 = load i64, i64* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32*, i32** %8
%13 = call i32 @linpack(i64 %9, i32 %10, i8* %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @linpackc_run(i64 %0, i32 %1, i8* %2, i32* %3) {
%5 = tail call i32 @linpack(i64 %0, i32 %1, i8* %2, i32* %3)
ret void
}
/* Variables and functions */
unsigned int constant_time_msb(unsigned int);
unsigned int constant_time_ge(unsigned int a, unsigned int b) {
  unsigned int ge;
  ge = ~((a ^ b) | (a - b));
  ge |= a & ~b;
  return constant_time_msb(ge);
}


x86 assembly (clang, -O0):
<constant_time_ge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
or     %ecx,%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <constant_time_msb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<constant_time_ge>:
mov    %esi,%eax
xor    %edi,%eax
mov    %edi,%ecx
sub    %esi,%ecx
or     %eax,%ecx
not    %ecx
not    %esi
and    %esi,%edi
or     %ecx,%edi
jmp    1030 <constant_time_msb@plt>

LLVM IR (-O0):
define i32 @constant_time_ge(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
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub i32 %9, %10
%12 = or i32 %8, %11
%13 = xor i32 %12, -1
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = xor i32 %15, -1
%17 = and i32 %14, %16
%18 = load i32, i32* %5
%19 = or i32 %18, %17
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = call i32 @constant_time_msb(i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @constant_time_ge(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = sub i32 %0, %1
%5 = or i32 %3, %4
%6 = xor i32 %5, -1
%7 = xor i32 %1, -1
%8 = and i32 %7, %0
%9 = or i32 %8, %6
%10 = tail call i32 @constant_time_msb(i32 %9)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int quit(int a, int b, int c) {
  close(a);
  close(b);
  close(c);
  exit(1);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <close@plt>
mov    %ebp,%edi
call   1030 <close@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @quit(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 = call i32 @close(i32 %7)
%9 = load i32, i32* %5
%10 = call i32 @close(i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @close(i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @quit(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @close(i32 %0)
%5 = tail call i32 @close(i32 %1)
%6 = tail call i32 @close(i32 %2)
%7 = tail call i32 @exit(i32 1)
unreachable
}
int f(int b, int c) {
  int a = (short)b * (c >> 16);
  if (!a)
    return 10;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cwtl
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1130 <f+0x30>
movl   $0xa,-0x4(%rbp)
jmp    1136 <f+0x36>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movswl %di,%ecx
sar    $0x10,%esi
imul   %esi,%ecx
test   %ecx,%ecx
mov    $0xa,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i16
%9 = sext i16 %8 to i32
%10 = load i32, i32* %5
%11 = ashr i32 %10, 16
%12 = mul nsw i32 %9, %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %2
store i32 10, i32* %3
br label %18
16: ; preds = %2
%17 = load i32, i32* %6
store i32 %17, i32* %3
br label %18
18: ; preds = %16, %15
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = ashr exact i32 %3, 16
%5 = ashr i32 %1, 16
%6 = mul nsw i32 %4, %5
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 10, i32 %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ tempexit();
int usermenuhelp() {
  tempexit();
  system("/usr/bin/less "
         "/usr/local/share/smit/"
         "usrmenuhelp.txt");
  return 0;
}


x86 assembly (clang, -O0):
<usermenuhelp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <tempexit@plt>
lea    0xece(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usermenuhelp>:
push   %rax
xor    %eax,%eax
call   1030 <tempexit@plt>
lea    0xed1(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"/usr/bin/less /usr/local/share/smit/usrmenuhelp.txt\00"
define i32 @usermenuhelp() {
%1 = call i32 (...) @tempexit()
%2 = call i32 @system(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"/usr/bin/less /usr/local/share/smit/usrmenuhelp.txt\00"
define i32 @usermenuhelp() {
%1 = tail call i32 (...) @tempexit()
%2 = tail call i32 @system(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void UpnpCloseLog(void) {}


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

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

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

LLVM IR (-O2):
define void @UpnpCloseLog() {
ret void
}
int main() {
  tiny_log(0x01, "Logging works!",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/yoink00/tinylog/refs/heads/master/src/"
           "log_test.c",
           5, __func__);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
lea    0xee8(%rip),%rdx
mov    $0x5,%ecx
lea    0xf67(%rip),%r8
mov    $0x0,%al
call   1030 <tiny_log@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef0(%rip),%rdx
lea    0xf74(%rip),%r8
mov    $0x1,%edi
mov    $0x5,%ecx
xor    %eax,%eax
call   1030 <tiny_log@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Logging works!\00"
@.str.1 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/yoink00/tinylog/refs/heads/master/src/log_test.c\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @tiny_log to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.1, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Logging works!\00"
@.str.1 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/yoink00/tinylog/refs/heads/master/src/log_test.c\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 (i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @tiny_log to i32 (i32, i8*, i8*, i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.1, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double vec4d_dot(double const *, double const *);
double vec4d_normSq(const double A[4]) { return vec4d_dot(A, A); }


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

x86 assembly (clang, -O2):
<vec4d_normSq>:
mov    %rdi,%rsi
jmp    1030 <vec4d_dot@plt>

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

LLVM IR (-O2):
define double @vec4d_normSq(double* %0) {
%2 = tail call double @vec4d_dot(double* %0, double* %0)
ret double %2
}
/* Type definitions */
struct group {
  int dummy;
};

/* Variables and functions */
struct group *getgrent();
struct group *fgetgrent(void *f) {
  return getgrent();
}


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

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

LLVM IR (-O0):
%struct.group = type { i32 }
define %struct.group* @fgetgrent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call %struct.group* (...) @getgrent()
ret %struct.group* %3
}

LLVM IR (-O2):
%struct.group = type { i32 }
define %struct.group* @fgetgrent(i8* nocapture readnone %0) {
%2 = tail call %struct.group* (...) @getgrent()
ret %struct.group* %2
}
unsigned char uchar(char chr) { return chr; }


x86 assembly (clang, -O0):
<uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uchar>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @uchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @uchar(i8 returned signext %0) {
ret i8 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void end_graphmode(FILE *fd) { fprintf(fd, "\033*rbC"); }


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

x86 assembly (clang, -O2):
<end_graphmode>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B*rbC\00"
define void @end_graphmode(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B*rbC\00"
define void @end_graphmode(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5, i64 1, i32* %0)
ret void
}
/* Type definitions */
struct dirent {
  long long d_ino;
};

/* Variables and functions */
long long int c_dirent_number(struct dirent *ep) { return ep->d_ino; }


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

x86 assembly (clang, -O2):
<c_dirent_number>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.dirent = type { i64 }
define i64 @c_dirent_number(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
%struct.dirent = type { i64 }
define i64 @c_dirent_number(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i64, i64* %2
ret i64 %3
}