xunge/DecIR huggingface dataset:
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a, b;
  a = atoi(argv[1]);
  b = atoi(argv[2]);
  if (a != b) {
    printf("%d\n", 0);
  } else {
    printf("%d\n", 1);
  }
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     1175 <main+0x55>
lea    0xe97(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
jmp    1186 <main+0x66>
lea    0xe84(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
xor    %esi,%esi
cmp    %eax,%ebp
sete   %sil
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.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 i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %6
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %7
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = icmp ne i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
br label %23
21: ; preds = %2
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
br label %23
23: ; preds = %21, %19
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = icmp eq i32 %5, %8
%10 = zext i1 %9 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ R_OK;
int /*<<< orphan*/ access(char *, int /*<<< orphan*/);
bool openvz_check(void) {
  if (!access("/proc/vz/vzaquota", R_OK))
    return true;
  if (!access("/proc/user_beancounters", R_OK))
    return true;
  return false;
}


x86 assembly (clang, -O0):
<openvz_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
lea    0xed8(%rip),%rdi
call   1030 <access@plt>
cmp    $0x0,%eax
jne    1142 <openvz_check+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1173 <openvz_check+0x63>
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
lea    0xec0(%rip),%rdi
call   1030 <access@plt>
cmp    $0x0,%eax
jne    116c <openvz_check+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1173 <openvz_check+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openvz_check>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
lea    0xedf(%rip),%rdi
call   1030 <access@plt>
test   %eax,%eax
je     1143 <openvz_check+0x33>
mov    (%rbx),%esi
lea    0xedf(%rip),%rdi
call   1030 <access@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/proc/vz/vzaquota\00"
@R_OK = global i32 0
@.str.1 = [24 x i8] c"/proc/user_beancounters\00"
define i32 @openvz_check() {
%1 = alloca i32
%2 = load i32, i32* @R_OK
%3 = call i32 @access(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %0
store i32 1, i32* %1
br label %12
6: ; preds = %0
%7 = load i32, i32* @R_OK
%8 = call i32 @access(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %6
store i32 1, i32* %1
br label %12
11: ; preds = %6
store i32 0, i32* %1
br label %12
12: ; preds = %11, %10, %5
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [18 x i8] c"/proc/vz/vzaquota\00"
@R_OK = global i32 0
@.str.1 = [24 x i8] c"/proc/user_beancounters\00"
define i32 @openvz_check() {
%1 = load i32, i32* @R_OK
%2 = tail call i32 @access(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = load i32, i32* @R_OK
%6 = tail call i32 @access(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %0
%10 = phi i32 [ 1, %0 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ baz();
void barf(void) { baz(); }


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

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

LLVM IR (-O0):
define void @barf() {
%1 = call i32 (...) @baz()
ret void
}

LLVM IR (-O2):
define void @barf() {
%1 = tail call i32 (...) @baz()
ret void
}
__attribute__((no, noclone)) unsigned __int128 t152_2add(unsigned __int128 y) {
  unsigned __int128 x = (-1);
  unsigned __int128 r;
  if (__builtin_add_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t152_2add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0xffffffffffffffff,-0x38(%rbp)
ff
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
mov    -0x40(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rax
add    %rsi,%rdx
adc    %rax,%rcx
setb   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t152_2add+0x5e>
jmp    1175 <t152_2add+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t152_2add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
adc    $0xffffffffffffffff,%r14
jae    112b <t152_2add+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t152_2add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 -1, i128* %6
%12 = load i128, i128* %6
%13 = load i128, i128* %5
%14 = call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t152_2add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %6, i128 -1)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ post(char);
int /*<<< orphan*/ printf(char *, char *);
char *rate();
void die(void) {
  printf("bye.\nYour rating was %s.\n", rate());
  post(' ');
  exit(0);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rate@plt>
mov    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    $0x20,%edi
call   1050 <post@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
xor    %eax,%eax
call   1030 <rate@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0x20,%edi
call   1050 <post@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"bye.\0AYour rating was %s.\0A\00"
define void @die() {
%1 = call i8* (...) @rate()
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = call i32 @post(i8 signext 32)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"bye.\0AYour rating was %s.\0A\00"
define void @die() {
%1 = tail call i8* (...) @rate()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @post(i8 signext 32)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int get_row(int offset) {
  offset /= 2;
  return offset / 80;
}


x86 assembly (clang, -O0):
<get_row>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x50,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_row>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_row(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 2
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 80
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_row(i32 %0) {
%2 = sdiv i32 %0, 160
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int factorial(int num) {
  assert(num >= 0);
  if (num == 0)
    return 1;
  return num * factorial(num - 1);
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1152 <factorial+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116e <factorial+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
test   %ebp,%ebp
je     1147 <factorial+0x37>
mov    %ebp,%ebx
neg    %ebx
mov    $0x1,%r14d
xchg   %ax,%ax
imul   %ebp,%r14d
add    $0xffffffff,%ebp
mov    %ebx,%edi
shr    $0x1f,%edi
call   1030 <assert@plt>
inc    %ebx
jne    1130 <factorial+0x20>
jmp    114d <factorial+0x3d>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @factorial(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %17
11: ; preds = %1
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1
%15 = call i32 @factorial(i32 %14)
%16 = mul nsw i32 %12, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @factorial(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = icmp eq i32 %0, 0
br i1 %5, label %15, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ %0, %1 ]
%8 = phi i32 [ %10, %6 ], [ 1, %1 ]
%9 = add nsw i32 %7, -1
%10 = mul nsw i32 %7, %8
%11 = sub i32 0, %7
%12 = lshr i32 %11, 31
%13 = tail call i32 @assert(i32 %12)
%14 = icmp eq i32 %9, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %1
%16 = phi i32 [ 1, %1 ], [ %10, %6 ]
ret i32 %16
}
void INT_Excep_ICU_IRQ9(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_IRQ9() {
ret void
}
int compar(const void *value_1, const void *value_2) {
  if (*(int *)value_1 > *(int *)value_2) {
    return 1;
  } else if (*(int *)value_1 < *(int *)value_2) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<compar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <compar+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <compar+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <compar+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <compar+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compar>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @compar(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = icmp sgt i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = icmp slt i32 %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 -1, i32* %3
br label %24
23: ; preds = %14
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ array_clear(void *);
scalar_t__ memory_free(void *, char *, int);
void array_release(void **A) {
  array_clear(*A);
  ((void)(memory_free((void *)(*A),
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/ASMlover/libc/refs/"
                      "heads/master/src/array.c",
                      70),
          (*A) = 0));
}


x86 assembly (clang, -O0):
<array_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <array_clear@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xeba(%rip),%rsi
mov    $0x46,%edx
call   1030 <memory_free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_release>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1040 <array_clear@plt>
mov    (%rbx),%rdi
lea    0xeca(%rip),%rsi
mov    $0x46,%edx
call   1030 <memory_free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ASMlover/libc/refs/heads/master/src/array.c\00"
define void @array_release(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @array_clear(i8* %4)
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = call i64 @memory_free(i8* %7, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 70)
%9 = load i8**, i8*** %2
store i8* null, i8** %9
ret void
}

LLVM IR (-O2):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ASMlover/libc/refs/heads/master/src/array.c\00"
define void @array_release(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @array_clear(i8* %2)
%4 = load i8*, i8** %0
%5 = tail call i64 @memory_free(i8* %4, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 70)
store i8* null, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ size_mul_check(size_t const, size_t const);
int size_mul(size_t *z, const size_t x, const size_t y) {
  assert(z != NULL);
  if (size_mul_check(x, y) != 0) {
    *z = x * y;
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<size_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <size_mul_check@plt>
cmp    $0x0,%rax
je     1179 <size_mul+0x59>
mov    -0x18(%rbp),%rcx
imul   -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1180 <size_mul+0x60>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_mul>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <size_mul_check@plt>
test   %rax,%rax
je     1157 <size_mul+0x37>
imul   %r15,%rbx
mov    %rbx,(%r14)
xor    %eax,%eax
jmp    115c <size_mul+0x3c>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @size_mul(i64* %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64*, i64** %5
%9 = icmp ne i64* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = call i64 @size_mul_check(i64 %12, i64 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %3
%17 = load i64, i64* %6
%18 = load i64, i64* %7
%19 = mul i64 %17, %18
%20 = load i64*, i64** %5
store i64 %19, i64* %20
store i32 0, i32* %4
br label %22
21: ; preds = %3
store i32 1, i32* %4
br label %22
22: ; preds = %21, %16
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @size_mul(i64* writeonly %0, i64 %1, i64 %2) {
%4 = icmp ne i64* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i64 @size_mul_check(i64 %1, i64 %2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = mul i64 %2, %1
store i64 %10, i64* %0
br label %11
11: ; preds = %3, %9
%12 = phi i32 [ 0, %9 ], [ 1, %3 ]
ret i32 %12
}
void protocolBISTRxInformPolicy(void) {}


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

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

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

LLVM IR (-O2):
define void @protocolBISTRxInformPolicy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _set_heaptop(char *);
char *sbrk(int adj) {
  extern char end;
  static char *heap = &end;
  char *rv = heap;
  heap += adj;
  _set_heaptop(heap);
  return rv;
}


x86 assembly (clang, -O0):
<sbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f06(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ef8(%rip),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,0x2eeb(%rip)
mov    0x2ee4(%rip),%rdi
call   1030 <_set_heaptop@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbrk>:
push   %rbx
mov    0x2f10(%rip),%rbx
movslq %edi,%rdi
add    %rbx,%rdi
mov    %rdi,0x2f03(%rip)
call   1030 <_set_heaptop@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@sbrk.heap = internal global i8* @end
@end = external global i8
define i8* @sbrk(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i8*, i8** @sbrk.heap
store i8* %4, i8** %3
%5 = load i32, i32* %2
%6 = load i8*, i8** @sbrk.heap
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8* %8, i8** @sbrk.heap
%9 = load i8*, i8** @sbrk.heap
%10 = call i32 @_set_heaptop(i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@sbrk.heap = internal unnamed_addr global i8* @end
@end = external global i8
define i8* @sbrk(i32 %0) {
%2 = load i8*, i8** @sbrk.heap
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i8, i8* %2, i64 %3
store i8* %4, i8** @sbrk.heap
%5 = tail call i32 @_set_heaptop(i8* %4)
ret i8* %2
}
/* Variables and functions */
unsigned int x(unsigned int);
unsigned int f(unsigned int a, unsigned int b) { return x(a) & b; }


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

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %esi,%ebx
call   1030 <x@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f(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 = call i32 @x(i32 %5)
%7 = load i32, i32* %4
%8 = and i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = tail call i32 @x(i32 %0)
%4 = and i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int EOF;
int getchar();
void nBuffer() {
  int c;
  while (c != '\n' && c != EOF) {
    c = getchar();
  }
}


x86 assembly (clang, -O0):
<nBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1139 <nBuffer+0x29>
mov    -0x4(%rbp),%eax
mov    0x2eb7(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1149 <nBuffer+0x39>
jmp    1158 <nBuffer+0x48>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
jmp    1118 <nBuffer+0x8>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@EOF = global i32 0
define void @nBuffer() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = call i32 (...) @getchar()
store i32 %12, i32* %1
br label %2
13: ; preds = %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @nBuffer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ randomizer(int);
int /*<<< orphan*/ swap(int *, int, int /*<<< orphan*/);
void permutation(int *arr, int arrSize) {
  for (int i = 0; i < arrSize; i++) {
    swap(arr, i, randomizer(arrSize));
  }
}


x86 assembly (clang, -O0):
<permutation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1174 <permutation+0x54>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <randomizer@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%edx
call   1040 <swap@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <permutation+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<permutation>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <permutation+0x2a>
mov    %esi,%ebx
mov    %rdi,%r14
xor    %ebp,%ebp
nop
mov    %ebx,%edi
call   1030 <randomizer@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <swap@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <permutation+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @permutation(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 0, %2 ]
%7 = tail call i32 @randomizer(i32 %1)
%8 = tail call i32 @swap(i32* %0, i32 %6, i32 %7)
%9 = add nuw nsw i32 %6, 1
%10 = icmp eq i32 %9, %1
br i1 %10, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char, char, char, char, char,
                          char, char, char, char *, char, char);
int main(void) {
  char *p = "#include <stdio.h>%c#define N '%cn'%c#define Q '%c%c'%c#define B "
            "'%c%c'%cint "
            "main(void){char*p=%c%s%c;(void)printf(p,N,B,N,B,Q,N,B,B,N,Q,p,Q,N)"
            ";return 0;}%c";
  (void)printf(p, '\n', '\\', '\n', '\\', '\"', '\n', '\\', '\\', '\n', '\"', p,
               '\"', '\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
mov    $0x5c,%r8d
mov    $0x22,%r9d
mov    %ecx,%esi
mov    %r8d,%edx
movl   $0xa,(%rsp)
movl   $0x5c,0x8(%rsp)
movl   $0x5c,0x10(%rsp)
movl   $0xa,0x18(%rsp)
movl   $0x22,0x20(%rsp)
mov    %rax,0x28(%rsp)
movl   $0x22,0x30(%rsp)
movl   $0xa,0x38(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
mov    $0x5c,%edx
mov    $0xa,%ecx
mov    $0x5c,%r8d
mov    $0x22,%r9d
push   $0xa
push   $0x22
push   %rdi
push   $0x22
push   $0xa
push   $0x5c
push   $0x5c
push   $0xa
call   1030 <printf@plt>
add    $0x40,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [157 x i8] c"#include <stdio.h>%c#define N '%cn'%c#define Q '%c%c'%c#define B '%c%c'%cint main(void){char*p=%c%s%c;(void)printf(p,N,B,N,B,Q,N,B,B,N,Q,p,Q,N);return 0;}%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* %3, i8 signext 10, i8 signext 92, i8 signext 10, i8 signext 92, i8 signext 34, i8 signext 10, i8 signext 92, i8 signext 92, i8 signext 10, i8 signext 34, i8* %4, i8 signext 34, i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [157 x i8] c"#include <stdio.h>%c#define N '%cn'%c#define Q '%c%c'%c#define B '%c%c'%cint main(void){char*p=%c%s%c;(void)printf(p,N,B,N,B,Q,N,B,B,N,Q,p,Q,N);return 0;}%c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i8 signext 10, i8 signext 92, i8 signext 10, i8 signext 92, i8 signext 34, i8 signext 10, i8 signext 92, i8 signext 92, i8 signext 10, i8 signext 34, i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i8 signext 34, i8 signext 10)
ret i32 0
}
float QuadraticEaseInOut(float p) {
  if (p < 0.5) {
    return 2 * p * p;
  } else {
    return (-2 * p * p) + (4 * p) - 1;
  }
}


x86 assembly (clang, -O0):
<QuadraticEaseInOut>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1140 <QuadraticEaseInOut+0x40>
movss  0xee8(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1178 <QuadraticEaseInOut+0x78>
movss  0xec8(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  0xeb2(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xe99(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuadraticEaseInOut>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    111c <QuadraticEaseInOut+0x1c>
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret
movss  0xee0(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  0xed4(%rip),%xmm0
addss  %xmm1,%xmm0
addss  0xecc(%rip),%xmm0
ret

LLVM IR (-O0):
define float @QuadraticEaseInOut(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 5.000000e-01
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fmul float 2.000000e+00, %8
%10 = load float, float* %3
%11 = fmul float %9, %10
store float %11, float* %2
br label %20
12: ; preds = %1
%13 = load float, float* %3
%14 = fmul float -2.000000e+00, %13
%15 = load float, float* %3
%16 = load float, float* %3
%17 = fmul float 4.000000e+00, %16
%18 = call float @llvm.fmuladd.f32(float %14, float %15, float %17)
%19 = fsub float %18, 1.000000e+00
store float %19, float* %2
br label %20
20: ; preds = %12, %7
%21 = load float, float* %2
ret float %21
}

LLVM IR (-O2):
define float @QuadraticEaseInOut(float %0) {
%2 = fcmp olt float %0, 5.000000e-01
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fmul float %0, 2.000000e+00
%5 = fmul float %4, %0
br label %11
6: ; preds = %1
%7 = fmul float %0, -2.000000e+00
%8 = fmul float %0, 4.000000e+00
%9 = tail call float @llvm.fmuladd.f32(float %7, float %0, float %8)
%10 = fadd float %9, -1.000000e+00
br label %11
11: ; preds = %6, %3
%12 = phi float [ %5, %3 ], [ %10, %6 ]
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ lcd_backlight(int);
int /*<<< orphan*/ lcd_init(int);
int /*<<< orphan*/ lcd_puts(char *);
int main() {
  lcd_init(0x0F);
  lcd_backlight(1);
  lcd_puts("this is a test message\nHow are you");
  lcd_backlight(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf,%edi
call   1030 <lcd_init@plt>
mov    $0x1,%edi
call   1040 <lcd_backlight@plt>
lea    0xea6(%rip),%rdi
call   1050 <lcd_puts@plt>
mov    $0x1,%edi
call   1040 <lcd_backlight@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf,%edi
call   1030 <lcd_init@plt>
mov    $0x1,%edi
call   1040 <lcd_backlight@plt>
lea    0xeb4(%rip),%rdi
call   1050 <lcd_puts@plt>
mov    $0x1,%edi
call   1040 <lcd_backlight@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"this is a test message\0AHow are you\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @lcd_init(i32 15)
%3 = call i32 @lcd_backlight(i32 1)
%4 = call i32 @lcd_puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @lcd_backlight(i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"this is a test message\0AHow are you\00"
define i32 @main() {
%1 = tail call i32 @lcd_init(i32 15)
%2 = tail call i32 @lcd_backlight(i32 1)
%3 = tail call i32 @lcd_puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @lcd_backlight(i32 1)
ret i32 0
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
uint64_t softfloat_shift64RightJam(uint64_t a, unsigned int count) {
  return (count < 64) ? a >> count | ((uint64_t)(a << ((-count) & 63)) != 0)
                      : (a != 0);
}


x86 assembly (clang, -O0):
<softfloat_shift64RightJam>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jae    1141 <softfloat_shift64RightJam+0x41>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x3f,%ecx
shl    %cl,%edx
mov    %edx,%ecx
cmp    $0x0,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <softfloat_shift64RightJam+0x50>
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<softfloat_shift64RightJam>:
cmp    $0x3f,%esi
ja     1119 <softfloat_shift64RightJam+0x19>
mov    %esi,%ecx
mov    %edi,%edx
shr    %cl,%edx
neg    %cl
shl    %cl,%edi
xor    %eax,%eax
test   %edi,%edi
setne  %al
or     %edx,%eax
ret
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @softfloat_shift64RightJam(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 ult i32 %5, 64
br i1 %6, label %7, label %19
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = lshr i32 %8, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sub i32 0, %12
%14 = and i32 %13, 63
%15 = shl i32 %11, %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
%18 = or i32 %10, %17
br label %23
19: ; preds = %2
%20 = load i32, i32* %3
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %19, %7
%24 = phi i32 [ %18, %7 ], [ %22, %19 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @softfloat_shift64RightJam(i32 %0, i32 %1) {
%3 = icmp ult i32 %1, 64
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = lshr i32 %0, %1
%6 = sub nsw i32 0, %1
%7 = and i32 %6, 63
%8 = shl i32 %0, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
%11 = or i32 %5, %10
br label %15
12: ; preds = %2
%13 = icmp ne i32 %0, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %12, %4
%16 = phi i32 [ %11, %4 ], [ %14, %12 ]
ret i32 %16
}
int main() {
  struct {
    int x;
    int y;
  } s;
  s.x = 3;
  s.y = 5;
  return s.y - s.x - 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
sub    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
store i32 3, i32* %3
%4 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
store i32 5, i32* %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
%10 = sub nsw i32 %9, 2
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
OP(fd, f1) {
  illegal_1();
  op_f1();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_f1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_f1@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_f1()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
void dbup(const char *name, char *p, int ps) {
  snprintf(p, ps,
           "/var/run/mosaic/"
           "/.%s.upd",
           name);
}


x86 assembly (clang, -O0):
<dbup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%rcx
lea    0xecb(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbup>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rax,%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"/var/run/mosaic//.%s.upd\00"
define void @dbup(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @snprintf(i8* %7, i32 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"/var/run/mosaic//.%s.upd\00"
define void @dbup(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @snprintf(i8* %1, i32 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void test_five(int x, int y, int z) {
#pragma omp target
#pragma omp teams distribute collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      for (int i = 0; i < z; i++)
        ;
}


x86 assembly (clang, -O0):
<test_five>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117f <test_five+0x7f>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116c <test_five+0x6c>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <test_five+0x59>
jmp    114b <test_five+0x4b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113a <test_five+0x3a>
jmp    115e <test_five+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <test_five+0x27>
jmp    1171 <test_five+0x71>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <test_five+0x14>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_five(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
double elapsed_sec(struct timeval *end, struct timeval *start) {
  double sec = end->tv_sec - start->tv_sec;
  double usec = end->tv_usec - start->tv_usec;
  return sec + usec / (1000 * 1000);
}


x86 assembly (clang, -O0):
<elapsed_sec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xeb6(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<elapsed_sec>:
movupd (%rdi),%xmm1
movupd (%rsi),%xmm0
subpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
divsd  0xee4(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @elapsed_sec(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
%5 = alloca double
%6 = alloca double
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%7 = load %struct.timeval*, %struct.timeval** %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load double, double* %8
%10 = load %struct.timeval*, %struct.timeval** %4
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
%12 = load double, double* %11
%13 = fsub double %9, %12
store double %13, double* %5
%14 = load %struct.timeval*, %struct.timeval** %3
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
%16 = load double, double* %15
%17 = load %struct.timeval*, %struct.timeval** %4
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load double, double* %18
%20 = fsub double %16, %19
store double %20, double* %6
%21 = load double, double* %5
%22 = load double, double* %6
%23 = fdiv double %22, 1.000000e+06
%24 = fadd double %21, %23
ret double %24
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @elapsed_sec(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = bitcast %struct.timeval* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = bitcast %struct.timeval* %1 to <2 x double>*
%6 = load <2 x double>, <2 x double>* %5
%7 = fsub <2 x double> %4, %6
%8 = extractelement <2 x double> %7, i64 1
%9 = fdiv double %8, 1.000000e+06
%10 = extractelement <2 x double> %7, i64 0
%11 = fadd double %10, %9
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
int /*<<< orphan*/ scanf(char *, float *, float *);
main() {
  float x, y, z;
  scanf("%f %f", &x, &y);
  z = x - y;
  printf("result of %f - %f = %f\n", x, y, z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [24 x i8] c"result of %f - %f = %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%5 = load float, float* %1
%6 = load float, float* %2
%7 = fsub float %5, %6
store float %7, float* %3
%8 = load float, float* %1
%9 = load float, float* %2
%10 = load float, float* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float %8, float %9, float %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [24 x i8] c"result of %f - %f = %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = fsub float %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float %6, float %7, float %8)
ret i32 0
}
/* Variables and functions */
void putc(unsigned char ch) {
  while ((*((volatile unsigned long *)0x7F005018)) & (1 << 14))
    ;
  (*((volatile unsigned char *)0x7F005020)) = ch;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x4000,%rax
cmp    $0x0,%rax
je     1127 <putc+0x27>
jmp    110a <putc+0xa>
mov    -0x1(%rbp),%cl
mov    $0x7f005020,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
testq  $0x4000,0x7f005018
jne    1100 <putc>
mov    %dil,0x7f005020
7f
ret

LLVM IR (-O0):
define void @putc(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%5 = and i64 %4, 16384
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
store volatile i8 %9, i8* inttoptr (i64 2130726944 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%4 = and i64 %3, 16384
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 2130726944 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drive(int, int);
void leftPointTurn(int turnSpeed) { drive(turnSpeed, -1 * turnSpeed); }


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

x86 assembly (clang, -O2):
<leftPointTurn>:
mov    %edi,%esi
neg    %esi
jmp    1030 <drive@plt>

LLVM IR (-O0):
define void @leftPointTurn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 -1, %4
%6 = call i32 @drive(i32 %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @leftPointTurn(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = tail call i32 @drive(i32 %0, i32 %2)
ret void
}