xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ __dn_expand(void const *, unsigned char const *, void const *,
                       void *, int);
int dns_parse_callback(void *c, int rr, const void *data, int len,
                       const void *packet) {
  if (rr != 12)
    return 0;
  if (__dn_expand(packet, (const unsigned char *)packet + 512, data, c, 256) <=
      0)
    *(char *)c = 0;
  return 0;
}


x86 assembly (clang, -O0):
<dns_parse_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
cmpl   $0xc,-0x14(%rbp)
je     1140 <dns_parse_callback+0x30>
movl   $0x0,-0x4(%rbp)
jmp    117a <dns_parse_callback+0x6a>
mov    -0x30(%rbp),%rdi
mov    -0x30(%rbp),%rsi
add    $0x200,%rsi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x100,%r8d
call   1030 <__dn_expand@plt>
cmp    $0x0,%rax
jg     1173 <dns_parse_callback+0x63>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_parse_callback>:
push   %rbx
cmp    $0xc,%esi
jne    1139 <dns_parse_callback+0x29>
mov    %rdi,%rbx
lea    0x200(%r8),%rsi
mov    %r8,%rdi
mov    %rbx,%rcx
mov    $0x100,%r8d
call   1030 <__dn_expand@plt>
test   %rax,%rax
jg     1139 <dns_parse_callback+0x29>
movb   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @dns_parse_callback(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = icmp eq i32 %1, 12
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = getelementptr inbounds i8, i8* %4, i64 512
%9 = tail call i64 @__dn_expand(i8* %4, i8* %8, i8* %2, i8* %0, i32 256)
%10 = icmp slt i64 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %7
store i8 0, i8* %0
br label %12
12: ; preds = %7, %11, %5
ret i32 0
}
/* Variables and functions */
int isUnique(char *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  char str[3] = {'a', 'b', 'b'};
  printf("%d\n", isUnique(str, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xebb(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x13(%rbp),%rdi
mov    $0x3,%esi
call   1040 <isUnique@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x62,0x6(%rsp)
movw   $0x6261,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x3,%esi
call   1040 <isUnique@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [3 x i8] c"abb"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [3 x i8]* %6 to i8*
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%9 = call i32 @isUnique(i8* %8, i32 3)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [3 x i8] c"abb"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = call i32 @isUnique(i8* %4, i32 3)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void foo_1_1_1_2_2_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_2_2_1_2_2_1() {
ret void
}
void fff() { int asdf = 1; }


x86 assembly (clang, -O0):
<fff>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @fff() {
ret void
}
void swap(void **a, void **b) {
  void *c = *a;
  *a = *b;
  *b = c;
}


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

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

LLVM IR (-O0):
define void @swap(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** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, result;
  scanf("%d", &a);
  scanf("%d", &b);
  if (1 == 1) {
    b = b >> a;
    result = b >> a;
    result = b & 1;
  }
  printf("%d", result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = ashr i32 %7, %8
store i32 %9, i32* %2
%10 = and i32 %9, 1
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int is_numeric(char *str) {
  while (*str) {
    if (!isdigit(*str))
      return 0;
    str++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <is_numeric+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    114a <is_numeric+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <is_numeric+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <is_numeric+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <is_numeric+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <is_numeric+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_numeric+0x20>
jmp    114b <is_numeric+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_numeric(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M155_f(char *s) {
  debug("M155_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M155_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M155_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M155_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M155_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M155_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M155_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int csv_close_report_file(__attribute__((unused)) void *report_data) {
  return (fclose(stdout) == EOF) ? -1 : 0;
}


x86 assembly (clang, -O0):
<csv_close_report_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    %rax,%rdx
mov    0x2eb4(%rip),%rax
mov    (%rax),%rsi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csv_close_report_file>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
mov    0x2ec2(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@EOF = global i64 0
define i32 @csv_close_report_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i64 @fclose(i32 %3)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -1, i32 0
ret i32 %8
}

LLVM IR (-O2):
@stdout = global i32 0
@EOF = global i64 0
define i32 @csv_close_report_file(i8* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i64 @fclose(i32 %2)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ writeDiagonalMatrixInPetscFormat(char *);
int main(int argc, char **args) {
  char *petsc_full_filename = "diagonalMatrix1.petsc";
  printf("starting processing %s --->\n", petsc_full_filename);
  writeDiagonalMatrixInPetscFormat(petsc_full_filename);
  printf("finished writing to: %s\n", petsc_full_filename);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <writeDiagonalMatrixInPetscFormat@plt>
mov    -0x18(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeee(%rip),%rdi
lea    0xed1(%rip),%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <writeDiagonalMatrixInPetscFormat@plt>
lea    0xeed(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"diagonalMatrix1.petsc\00"
@.str.1 = [29 x i8] c"starting processing %s --->\0A\00"
@.str.2 = [25 x i8] c"finished writing to: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %6
%10 = call i32 @writeDiagonalMatrixInPetscFormat(i8* %9)
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"diagonalMatrix1.petsc\00"
@.str.1 = [29 x i8] c"starting processing %s --->\0A\00"
@.str.2 = [25 x i8] c"finished writing to: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @writeDiagonalMatrixInPetscFormat(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ stdscr;
void initialize_curses(void) {
  initscr();
  raw();
  keypad(stdscr, TRUE);
  noecho();
}


x86 assembly (clang, -O0):
<initialize_curses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x0,%al
call   1050 <raw@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
call   1030 <keypad@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_curses>:
push   %rax
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1050 <raw@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
call   1030 <keypad@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <noecho@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define void @initialize_curses() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @raw()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = call i32 @keypad(i32 %3, i32 %4)
%6 = call i32 (...) @noecho()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define void @initialize_curses() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @raw()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = tail call i32 @keypad(i32 %3, i32 %4)
%6 = tail call i32 (...) @noecho()
ret void
}
int fxInt(int x, int a, int b, int c) { return (a * x * x) + (b * x) + c; }


x86 assembly (clang, -O0):
<fxInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    %ecx,%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fxInt>:
imul   %edi,%esi
lea    (%rsi,%rdx,1),%eax
imul   %edi,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fxInt(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %1, %0
%6 = add i32 %5, %2
%7 = mul i32 %6, %0
%8 = add nsw i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ delay_ms(int);
void tempocurto() { delay_ms(5); }


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

x86 assembly (clang, -O2):
<tempocurto>:
mov    $0x5,%edi
jmp    1030 <delay_ms@plt>

LLVM IR (-O0):
define void @tempocurto() {
%1 = call i32 @delay_ms(i32 5)
ret void
}

LLVM IR (-O2):
define void @tempocurto() {
%1 = tail call i32 @delay_ms(i32 5)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
struct aiocb {
  int dummy;
};

/* Variables and functions */
int do_aio_suspend(struct aiocb const *const *, int, struct timespec const *);
int aio_suspend(const struct aiocb *const cblist[], int n,
                const struct timespec *timeout) {
  return do_aio_suspend(cblist, n, timeout);
}


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

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

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

LLVM IR (-O2):
%struct.aiocb = type { i32 }
%struct.timespec = type { i32 }
define i32 @aio_suspend(%struct.aiocb** %0, i32 %1, %struct.timespec* %2) {
%4 = tail call i32 @do_aio_suspend(%struct.aiocb** %0, i32 %1, %struct.timespec* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ readfile(char const *, int *, int const *, char *, int *,
                            int *);
void creadfile(const char *filename, const int *m, const int *n, float *A,
               const int *ldA, int *info) {
  int cm = *m * (int)(2 * sizeof(float) / sizeof(char));
  int cldA = *ldA * (int)(2 * sizeof(float) / sizeof(char));
  readfile(filename, &cm, n, (char *)A, &cldA, info);
}


x86 assembly (clang, -O0):
<creadfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x3,%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
shl    $0x3,%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r9
lea    -0x34(%rbp),%rsi
lea    -0x38(%rbp),%r8
call   1030 <readfile@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creadfile>:
push   %rax
mov    (%rsi),%eax
shl    $0x3,%eax
mov    %eax,0x4(%rsp)
mov    (%r8),%eax
shl    $0x3,%eax
mov    %eax,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%r8
call   1030 <readfile@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @creadfile(i8* %0, i32* %1, i32* %2, float* %3, i32* %4, i32* %5) {
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca float*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store float* %3, float** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = mul nsw i32 %16, 8
store i32 %17, i32* %13
%18 = load i32*, i32** %11
%19 = load i32, i32* %18
%20 = mul nsw i32 %19, 8
store i32 %20, i32* %14
%21 = load i8*, i8** %7
%22 = load i32*, i32** %9
%23 = load float*, float** %10
%24 = bitcast float* %23 to i8*
%25 = load i32*, i32** %12
%26 = call i32 @readfile(i8* %21, i32* %13, i32* %22, i8* %24, i32* %14, i32* %25)
ret void
}

LLVM IR (-O2):
define void @creadfile(i8* %0, i32* nocapture %1, i32* %2, float* %3, i32* nocapture %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %7 to i8*
%10 = load i32, i32* %1
%11 = shl nsw i32 %10, 3
store i32 %11, i32* %7
%12 = bitcast i32* %8 to i8*
%13 = load i32, i32* %4
%14 = shl nsw i32 %13, 3
store i32 %14, i32* %8
%15 = bitcast float* %3 to i8*
%16 = call i32 @readfile(i8* %0, i32* %7, i32* %2, i8* %15, i32* %8, i32* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ wait4(int /*<<< orphan*/, int *, int, int /*<<< orphan*/ *);
pid_t waitpid(pid_t pid, int *status, int options) {
  return wait4(pid, status, options, NULL);
}


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid>:
xor    %ecx,%ecx
jmp    1030 <wait4@plt>

LLVM IR (-O0):
define i32 @waitpid(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 @wait4(i32 %7, i32* %8, i32 %9, i32* null)
ret i32 %10
}

LLVM IR (-O2):
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @wait4(i32 %0, i32* %1, i32 %2, i32* null)
ret i32 %4
}
int ptrCmpFunction(const void *pointer1, const void *pointer2) {
  return (pointer1 != pointer2);
}


x86 assembly (clang, -O0):
<ptrCmpFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrCmpFunction>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @ptrCmpFunction(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ne i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ptrCmpFunction(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printPrivate(char *);
int executeWait(void) {
  printPrivate("Some time passes...\n");
  return 1;
}


x86 assembly (clang, -O0):
<executeWait>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printPrivate@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<executeWait>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printPrivate@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Some time passes...\0A\00"
define i32 @executeWait() {
%1 = call i32 @printPrivate(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [21 x i8] c"Some time passes...\0A\00"
define i32 @executeWait() {
%1 = tail call i32 @printPrivate(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
long double logb(double);
long double logbl(long double x) { return logb((double)x); }


x86 assembly (clang, -O0):
<logbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <logb@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logbl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <logb@plt>

LLVM IR (-O0):
define x86_fp80 @logbl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @logb(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @logbl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @logb(double %2)
ret x86_fp80 %3
}
double bezier_curve(double u, unsigned int N, const double k[N + 1]) {
  return de_casteljau(u, N, k);
}


x86 assembly (clang, -O0):
<bezier_curve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x1,%al
call   1030 <de_casteljau@plt>
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bezier_curve>:
push   %rax
mov    $0x1,%al
call   1030 <de_casteljau@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bezier_curve(double %0, i32 %1, double* %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca double*
store double %0, double* %4
store i32 %1, i32* %5
store double* %2, double** %6
%7 = load i32, i32* %5
%8 = add i32 %7, 1
%9 = zext i32 %8 to i64
%10 = load double, double* %4
%11 = load i32, i32* %5
%12 = load double*, double** %6
%13 = call i32 (double, i32, double*, ...) bitcast (i32 (...)* @de_casteljau to i32 (double, i32, double*, ...)*)(double %10, i32 %11, double* %12)
%14 = sitofp i32 %13 to double
ret double %14
}

LLVM IR (-O2):
define double @bezier_curve(double %0, i32 %1, double* %2) {
%4 = tail call i32 (double, i32, double*, ...) bitcast (i32 (...)* @de_casteljau to i32 (double, i32, double*, ...)*)(double %0, i32 %1, double* %2)
%5 = sitofp i32 %4 to double
ret double %5
}
unsigned long long ROR64(unsigned long long word, int i) {
  asm("rorq %%cl,%0" : "=r"(word) : "0"(word), "c"(i));
  return word;
}


x86 assembly (clang, -O0):
<ROR64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
ror    %cl,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROR64>:
mov    %esi,%ecx
mov    %rdi,%rax
ror    %cl,%rax
ret

LLVM IR (-O0):
define i64 @ROR64(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = call i64 asm "rorq %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i64 %5, i32 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @ROR64(i64 %0, i32 %1) {
%3 = tail call i64 asm "rorq %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i32 %1)
ret i64 %3
}
int nxtd_usb_init() { return 0; }


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

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

LLVM IR (-O0):
define i32 @nxtd_usb_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nxtd_usb_init() {
ret i32 0
}
/* Type definitions */
struct timeval {
  short tv_sec;
  short tv_usec;
};

/* Variables and functions */
void setTimeout(short ms, struct timeval *t) {
  t->tv_sec = ms / 1000;
  t->tv_usec = ms % 1000;
}


x86 assembly (clang, -O0):
<setTimeout>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
movswl -0x2(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %dx,%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setTimeout>:
imul   $0xffff8313,%edi,%eax
shr    $0x10,%eax
add    %edi,%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
sar    $0x9,%ecx
add    %eax,%ecx
mov    %cx,(%rsi)
imul   $0x3e8,%ecx,%eax
sub    %eax,%edi
mov    %di,0x2(%rsi)
ret

LLVM IR (-O0):
%struct.timeval = type { i16, i16 }
define void @setTimeout(i16 signext %0, %struct.timeval* %1) {
%3 = alloca i16
%4 = alloca %struct.timeval*
store i16 %0, i16* %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = sdiv i32 %6, 1000
%8 = trunc i32 %7 to i16
%9 = load %struct.timeval*, %struct.timeval** %4
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
store i16 %8, i16* %10
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
%13 = srem i32 %12, 1000
%14 = trunc i32 %13 to i16
%15 = load %struct.timeval*, %struct.timeval** %4
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 1
store i16 %14, i16* %16
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i16, i16 }
define void @setTimeout(i16 signext %0, %struct.timeval* nocapture writeonly %1) {
%3 = sdiv i16 %0, 1000
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
store i16 %3, i16* %4
%5 = srem i16 %0, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
store i16 %5, i16* %6
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmpfunc(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
  return *(char *)a - *(char *)b;
}


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

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

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

LLVM IR (-O2):
define i32 @cmpfunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int turn_image(double);
int turn_image_left(void) { return turn_image(-90.0); }


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

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

LLVM IR (-O0):
define i32 @turn_image_left() {
%1 = call i32 @turn_image(double -9.000000e+01)
ret i32 %1
}

LLVM IR (-O2):
define i32 @turn_image_left() {
%1 = tail call i32 @turn_image(double -9.000000e+01)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ commander(int);
void main_menu_select(void *cookie, int key) {
  if (key > 0)
    commander(key);
}


x86 assembly (clang, -O0):
<main_menu_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1131 <main_menu_select+0x21>
mov    -0xc(%rbp),%edi
call   1030 <commander@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_menu_select>:
test   %esi,%esi
jle    111b <main_menu_select+0xb>
mov    %esi,%edi
jmp    1030 <commander@plt>
ret

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

LLVM IR (-O2):
define void @main_menu_select(i8* nocapture readnone %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @commander(i32 %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int /*<<< orphan*/ hea_set_u64_bits(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
__u32 hea_set_u32_bits(__u32 oval, __u32 nval, int start, int end) {
  return hea_set_u64_bits(oval, nval, start + 32, end + 32);
}


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

x86 assembly (clang, -O2):
<hea_set_u32_bits>:
add    $0x20,%edx
add    $0x20,%ecx
jmp    1030 <hea_set_u64_bits@plt>

LLVM IR (-O0):
define i32 @hea_set_u32_bits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = add nsw i32 %11, 32
%13 = load i32, i32* %8
%14 = add nsw i32 %13, 32
%15 = call i32 @hea_set_u64_bits(i32 %9, i32 %10, i32 %12, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @hea_set_u32_bits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, 32
%6 = add nsw i32 %3, 32
%7 = tail call i32 @hea_set_u64_bits(i32 %0, i32 %1, i32 %5, i32 %6)
ret i32 %7
}
double rq_pricing_monte_carlo_multi_factor_get_dt(double tau_d,
                                                  unsigned long num_timesteps) {
  return tau_d / (double)num_timesteps;
}


x86 assembly (clang, -O0):
<rq_pricing_monte_carlo_multi_factor_get_dt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xee7(%rip),%xmm2
movq   -0x10(%rbp),%xmm1
punpckldq %xmm2,%xmm1
movapd 0xee6(%rip),%xmm2
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_pricing_monte_carlo_multi_factor_get_dt>:
movq   %rdi,%xmm1
punpckldq 0xef3(%rip),%xmm1
subpd  0xefb(%rip),%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @rq_pricing_monte_carlo_multi_factor_get_dt(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load double, double* %3
%6 = load i64, i64* %4
%7 = uitofp i64 %6 to double
%8 = fdiv double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @rq_pricing_monte_carlo_multi_factor_get_dt(double %0, i64 %1) {
%3 = uitofp i64 %1 to double
%4 = fdiv double %0, %3
ret double %4
}
void cpuid(int output[4], int functionnumber) {
  int a, b, c, d;
  __asm("cpuid"
        : "=a"(a), "=b"(b), "=c"(c), "=d"(d)
        : "a"(functionnumber), "c"(0));
  output[0] = a;
  output[1] = b;
  output[2] = c;
  output[3] = d;
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    %ecx,%ecx
cpuid
mov    %eax,-0x18(%rbp)
mov    %ebx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
push   %rbx
mov    %esi,%eax
xor    %ecx,%ecx
cpuid
mov    %eax,(%rdi)
mov    %ebx,0x4(%rdi)
mov    %ecx,0x8(%rdi)
mov    %edx,0xc(%rdi)
pop    %rbx
ret

LLVM IR (-O0):
define void @cpuid(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
%10 = call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %9, i32 0)
%11 = extractvalue { i32, i32, i32, i32 } %10, 0
%12 = extractvalue { i32, i32, i32, i32 } %10, 1
%13 = extractvalue { i32, i32, i32, i32 } %10, 2
%14 = extractvalue { i32, i32, i32, i32 } %10, 3
store i32 %11, i32* %5
store i32 %12, i32* %6
store i32 %13, i32* %7
store i32 %14, i32* %8
%15 = load i32, i32* %5
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 0
store i32 %15, i32* %17
%18 = load i32, i32* %6
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 1
store i32 %18, i32* %20
%21 = load i32, i32* %7
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 2
store i32 %21, i32* %23
%24 = load i32, i32* %8
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 3
store i32 %24, i32* %26
ret void
}

LLVM IR (-O2):
define void @cpuid(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %1, i32 0)
%4 = extractvalue { i32, i32, i32, i32 } %3, 0
%5 = extractvalue { i32, i32, i32, i32 } %3, 1
%6 = extractvalue { i32, i32, i32, i32 } %3, 2
%7 = extractvalue { i32, i32, i32, i32 } %3, 3
store i32 %4, i32* %0
%8 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %8
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %9
%10 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %7, i32* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EC_KEY;
typedef int /*<<< orphan*/ EC_GROUP;

/* Variables and functions */
int /*<<< orphan*/ *EC_KEY_new();
int /*<<< orphan*/ EC_KEY_set_group(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *sm2_ec_group();
EC_KEY *EC_KEY_new_group() {
  EC_KEY *ret = EC_KEY_new();
  if (ret == NULL)
    return NULL;
  EC_GROUP *group = sm2_ec_group();
  EC_KEY_set_group(ret, group);
  return ret;
}


x86 assembly (clang, -O0):
<EC_KEY_new_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <EC_KEY_new@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <EC_KEY_new_group+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    117b <EC_KEY_new_group+0x4b>
mov    $0x0,%al
call   1030 <sm2_ec_group@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <EC_KEY_set_group@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EC_KEY_new_group>:
push   %rbx
xor    %eax,%eax
call   1040 <EC_KEY_new@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1152 <EC_KEY_new_group+0x22>
xor    %eax,%eax
call   1030 <sm2_ec_group@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <EC_KEY_set_group@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @EC_KEY_new_group() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = call i32* (...) @EC_KEY_new()
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %0
store i32* null, i32** %1
br label %14
8: ; preds = %0
%9 = call i32* (...) @sm2_ec_group()
store i32* %9, i32** %3
%10 = load i32*, i32** %2
%11 = load i32*, i32** %3
%12 = call i32 @EC_KEY_set_group(i32* %10, i32* %11)
%13 = load i32*, i32** %2
store i32* %13, i32** %1
br label %14
14: ; preds = %8, %7
%15 = load i32*, i32** %1
ret i32* %15
}

LLVM IR (-O2):
define i32* @EC_KEY_new_group() {
%1 = tail call i32* (...) @EC_KEY_new()
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32* (...) @sm2_ec_group()
%5 = tail call i32 @EC_KEY_set_group(i32* %1, i32* %4)
br label %6
6: ; preds = %0, %3
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ mcset_ncount(long long);
scalar_t__ strtod(char *, int /*<<< orphan*/ *);
void mcsetn_arg(char *arg) { mcset_ncount((long long int)strtod(arg, NULL)); }


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

x86 assembly (clang, -O2):
<mcsetn_arg>:
push   %rax
xor    %esi,%esi
call   1030 <strtod@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <mcset_ncount@plt>

LLVM IR (-O0):
define void @mcsetn_arg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtod(i8* %3, i32* null)
%5 = call i32 @mcset_ncount(i64 %4)
ret void
}

LLVM IR (-O2):
define void @mcsetn_arg(i8* nocapture %0) {
%2 = tail call i64 @strtod(i8* nocapture %0, i32* null)
%3 = tail call i32 @mcset_ncount(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgclear(void) { gen("xorq\t%rax,%rax"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"xorq\09%rax,%rax\00"
define void @cgclear() {
%1 = call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"xorq\09%rax,%rax\00"
define void @cgclear() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int bar_OK();
int cond_OK(int i) {
  int x;
  if (i < 0) {
    x = bar_OK();
  } else {
    x = 1;
  }
  return x;
}


x86 assembly (clang, -O0):
<cond_OK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1134 <cond_OK+0x24>
mov    $0x0,%al
call   1030 <bar_OK@plt>
mov    %eax,-0x8(%rbp)
jmp    113b <cond_OK+0x2b>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cond_OK>:
test   %edi,%edi
js     111a <cond_OK+0xa>
mov    $0x1,%eax
ret
xor    %eax,%eax
jmp    1030 <bar_OK@plt>

LLVM IR (-O0):
define i32 @cond_OK(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @bar_OK()
store i32 %7, i32* %3
br label %9
8: ; preds = %1
store i32 1, i32* %3
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @cond_OK(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @bar_OK()
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 1, %1 ]
ret i32 %6
}