xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ atoi_check(char *, int *);
int atoi_check16(char *a, int *res) {
  if (!(atoi_check(a, res)) || *res < 0 || *res > 0xffff)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<atoi_check16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <atoi_check@plt>
cmp    $0x0,%eax
je     1153 <atoi_check16+0x43>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1153 <atoi_check16+0x43>
mov    -0x18(%rbp),%rax
cmpl   $0xffff,(%rax)
jle    115f <atoi_check16+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1166 <atoi_check16+0x56>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi_check16>:
push   %rbx
mov    %rsi,%rbx
call   1030 <atoi_check@plt>
test   %eax,%eax
je     112a <atoi_check16+0x1a>
xor    %eax,%eax
cmpl   $0x10000,(%rbx)
setb   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @atoi_check16(i8* %0, i32* %1) {
%3 = tail call i32 @atoi_check(i8* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp ult i32 %6, 65536
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ get_kver(int *, int *, int *);
int tst_kvercmp(int r1, int r2, int r3) {
  int a1, a2, a3;
  int testver, currver;
  get_kver(&a1, &a2, &a3);
  testver = (r1 << 16) + (r2 << 8) + r3;
  currver = (a1 << 16) + (a2 << 8) + a3;
  return currver - testver;
}


x86 assembly (clang, -O0):
<tst_kvercmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <get_kver@plt>
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x10,%eax
mov    -0x14(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_kvercmp>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1030 <get_kver@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%eax
sub    %ebp,%edx
shl    $0x8,%edx
sub    %ebx,%ecx
shl    $0x10,%ecx
sub    %r14d,%eax
add    %ecx,%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @tst_kvercmp(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%12 = call i32 @get_kver(i32* %7, i32* %8, i32* %9)
%13 = load i32, i32* %4
%14 = shl i32 %13, 16
%15 = load i32, i32* %5
%16 = shl i32 %15, 8
%17 = add nsw i32 %14, %16
%18 = load i32, i32* %6
%19 = add nsw i32 %17, %18
store i32 %19, i32* %10
%20 = load i32, i32* %7
%21 = shl i32 %20, 16
%22 = load i32, i32* %8
%23 = shl i32 %22, 8
%24 = add nsw i32 %21, %23
%25 = load i32, i32* %9
%26 = add nsw i32 %24, %25
store i32 %26, i32* %11
%27 = load i32, i32* %11
%28 = load i32, i32* %10
%29 = sub nsw i32 %27, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @tst_kvercmp(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = bitcast i32* %6 to i8*
%10 = call i32 @get_kver(i32* %4, i32* %5, i32* %6)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = sub i32 %12, %1
%15 = shl i32 %14, 8
%16 = sub i32 %11, %0
%17 = shl i32 %16, 16
%18 = sub i32 %13, %2
%19 = add i32 %18, %17
%20 = add i32 %19, %15
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void closeLogger() { closelog(); }


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

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

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

LLVM IR (-O2):
define void @closeLogger() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int inportb(int);
int /*<<< orphan*/ outportb(int, int);
void sound(int freq) {
  int scale = 1193046 / freq;
  outportb(0x43, 0xb6);
  outportb(0x42, scale & 0xff);
  outportb(0x42, scale >> 8);
  outportb(0x61, inportb(0x61) | 3);
}


x86 assembly (clang, -O0):
<sound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x123456,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    $0x43,%edi
mov    $0xb6,%esi
call   1040 <outportb@plt>
mov    -0x8(%rbp),%esi
and    $0xff,%esi
mov    $0x42,%edi
call   1040 <outportb@plt>
mov    -0x8(%rbp),%esi
sar    $0x8,%esi
mov    $0x42,%edi
call   1040 <outportb@plt>
mov    $0x61,%edi
call   1030 <inportb@plt>
mov    %eax,%esi
or     $0x3,%esi
mov    $0x61,%edi
call   1040 <outportb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sound>:
push   %rbx
mov    $0x123456,%eax
xor    %edx,%edx
idiv   %edi
mov    %eax,%ebx
mov    $0x43,%edi
mov    $0xb6,%esi
call   1040 <outportb@plt>
movzbl %bl,%esi
mov    $0x42,%edi
call   1040 <outportb@plt>
sar    $0x8,%ebx
mov    $0x42,%edi
mov    %ebx,%esi
call   1040 <outportb@plt>
mov    $0x61,%edi
call   1030 <inportb@plt>
or     $0x3,%eax
mov    $0x61,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <outportb@plt>

LLVM IR (-O0):
define void @sound(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 1193046, %4
store i32 %5, i32* %3
%6 = call i32 @outportb(i32 67, i32 182)
%7 = load i32, i32* %3
%8 = and i32 %7, 255
%9 = call i32 @outportb(i32 66, i32 %8)
%10 = load i32, i32* %3
%11 = ashr i32 %10, 8
%12 = call i32 @outportb(i32 66, i32 %11)
%13 = call i32 @inportb(i32 97)
%14 = or i32 %13, 3
%15 = call i32 @outportb(i32 97, i32 %14)
ret void
}

LLVM IR (-O2):
define void @sound(i32 %0) {
%2 = sdiv i32 1193046, %0
%3 = tail call i32 @outportb(i32 67, i32 182)
%4 = and i32 %2, 255
%5 = tail call i32 @outportb(i32 66, i32 %4)
%6 = ashr i32 %2, 8
%7 = tail call i32 @outportb(i32 66, i32 %6)
%8 = tail call i32 @inportb(i32 97)
%9 = or i32 %8, 3
%10 = tail call i32 @outportb(i32 97, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, int);
void congratulateStudent(char *student, char *course, int numDays) {
  printf("%s has done as much %s Programming as I could fit into %d days.\n",
         student, course, numDays);
}


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

x86 assembly (clang, -O2):
<congratulateStudent>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"%s has done as much %s Programming as I could fit into %d days.\0A\00"
define void @congratulateStudent(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** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [65 x i8] c"%s has done as much %s Programming as I could fit into %d days.\0A\00"
define void @congratulateStudent(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
unsigned long get_XKeyEvent_serial(void *_p) {
  return (unsigned long)((XKeyEvent *)_p)->serial;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XKeyEvent_serial(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XKeyEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int isPal(int numI) {
  int num = numI;
  int n = num;
  int rev = 0, dig = 0;
  while (num > 0) {
    dig = num % 10;
    rev = rev * 10 + dig;
    num = num / 10;
  }
  return rev == n;
}


x86 assembly (clang, -O0):
<isPal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1156 <isPal+0x56>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
imul   $0xa,-0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1121 <isPal+0x21>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPal>:
xor    %edx,%edx
test   %edi,%edi
jle    1133 <isPal+0x33>
mov    $0xcccccccd,%r8d
mov    %edi,%ecx
xchg   %ax,%ax
lea    (%rdx,%rdx,4),%r9d
mov    %ecx,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%eax
mov    %ecx,%edx
sub    %eax,%edx
lea    (%rdx,%r9,2),%edx
cmp    $0x9,%ecx
mov    %esi,%ecx
ja     1110 <isPal+0x10>
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isPal(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = mul nsw i32 %4, 10
%8 = add nsw i32 %7, %6
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
%13 = icmp eq i32 %12, %0
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ umfpack_zi_symbolic(long, long, long *, long *, double *,
                                       double *, void **, double *, double *);
void umf4zsym(long *m, long *n, long Ap[], long Ai[], double Ax[], double Az[],
              void **Symbolic, double Control[20], double Info[90]) {
  (void)umfpack_zi_symbolic(*m, *n, Ap, Ai, Ax, Az, Symbolic, Control, Info);
}


x86 assembly (clang, -O0):
<umf4zsym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
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    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r11
mov    0x18(%rbp),%r10
mov    0x20(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <umfpack_zi_symbolic@plt>
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @umf4zsym(i64* %0, i64* %1, i64* %2, i64* %3, double* %4, double* %5, i8** %6, double* %7, double* %8) {
%10 = alloca i64*
%11 = alloca i64*
%12 = alloca i64*
%13 = alloca i64*
%14 = alloca double*
%15 = alloca double*
%16 = alloca i8**
%17 = alloca double*
%18 = alloca double*
store i64* %0, i64** %10
store i64* %1, i64** %11
store i64* %2, i64** %12
store i64* %3, i64** %13
store double* %4, double** %14
store double* %5, double** %15
store i8** %6, i8*** %16
store double* %7, double** %17
store double* %8, double** %18
%19 = load i64*, i64** %10
%20 = load i64, i64* %19
%21 = load i64*, i64** %11
%22 = load i64, i64* %21
%23 = load i64*, i64** %12
%24 = load i64*, i64** %13
%25 = load double*, double** %14
%26 = load double*, double** %15
%27 = load i8**, i8*** %16
%28 = load double*, double** %17
%29 = load double*, double** %18
%30 = call i32 @umfpack_zi_symbolic(i64 %20, i64 %22, i64* %23, i64* %24, double* %25, double* %26, i8** %27, double* %28, double* %29)
ret void
}

LLVM IR (-O2):
define void @umf4zsym(i64* nocapture %0, i64* nocapture %1, i64* %2, i64* %3, double* %4, double* %5, i8** %6, double* %7, double* %8) {
%10 = load i64, i64* %0
%11 = load i64, i64* %1
%12 = tail call i32 @umfpack_zi_symbolic(i64 %10, i64 %11, i64* %2, i64* %3, double* %4, double* %5, i8** %6, double* %7, double* %8)
ret void
}
/* Variables and functions */
bool is_a_cycle(const int *past_values, size_t count, int value) {
  for (size_t i = 0; i < count; i++)
    if (past_values[i] == value)
      return true;
  return false;
}


x86 assembly (clang, -O0):
<is_a_cycle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115b <is_a_cycle+0x5b>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x1c(%rbp),%eax
jne    1145 <is_a_cycle+0x45>
movl   $0x1,-0x4(%rbp)
jmp    1162 <is_a_cycle+0x62>
jmp    114a <is_a_cycle+0x4a>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1117 <is_a_cycle+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_a_cycle>:
test   %rsi,%rsi
je     113a <is_a_cycle+0x3a>
mov    $0x1,%eax
cmp    %edx,(%rdi)
je     1139 <is_a_cycle+0x39>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rax,%rcx
cmp    %rax,%rsi
je     1131 <is_a_cycle+0x31>
lea    0x1(%rcx),%rax
cmp    %edx,(%rdi,%rcx,4)
jne    1120 <is_a_cycle+0x20>
xor    %eax,%eax
cmp    %rsi,%rcx
setb   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_a_cycle(i32* nocapture %0, i64 %1, i32 %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %19, label %5
5: ; preds = %3
%6 = load i32, i32* %0
%7 = icmp eq i32 %6, %2
br i1 %7, label %19, label %8
8: ; preds = %5, %11
%9 = phi i64 [ %15, %11 ], [ 1, %5 ]
%10 = icmp eq i64 %9, %1
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = getelementptr inbounds i32, i32* %0, i64 %9
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, %2
%15 = add nuw i64 %9, 1
br i1 %14, label %16, label %8
16: ; preds = %8, %11
%17 = icmp ult i64 %9, %1
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %16, %5, %3
%20 = phi i32 [ 0, %3 ], [ 1, %5 ], [ %18, %16 ]
ret i32 %20
}
/* Variables and functions */
int mus_write_1(int, int, int, int, int **, int /*<<< orphan*/ *,
                int /*<<< orphan*/);
int mus_file_write(int tfd, int beg, int end, int chans, int **bufs) {
  return (mus_write_1(tfd, beg, end, chans, bufs, NULL, 0));
}


x86 assembly (clang, -O0):
<mus_file_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <mus_write_1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_file_write>:
push   %rax
movl   $0x0,(%rsp)
xor    %r9d,%r9d
call   1030 <mus_write_1@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mus_file_write(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4) {
%6 = tail call i32 @mus_write_1(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4, i32* null, i32 0)
ret i32 %6
}
/* Variables and functions */
int __udivsi3(unsigned int, unsigned int);
int __divsi3(int value1, int value2) {
  int sign1 = value1 >> 31;
  int sign2 = value2 >> 31;
  unsigned int u_value1 = (value1 ^ sign1) - sign1;
  unsigned int u_value2 = (value2 ^ sign2) - sign2;
  sign1 ^= sign2;
  return (__udivsi3(u_value1, u_value2) ^ sign1) - sign1;
}


x86 assembly (clang, -O0):
<__divsi3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    -0xc(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <__udivsi3@plt>
xor    -0xc(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__divsi3>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
neg    %esi
cmovs  %ebx,%esi
xor    %edi,%ebx
sar    $0x1f,%ebx
mov    %eax,%edi
call   1030 <__udivsi3@plt>
xor    %ebx,%eax
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__divsi3(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* %3
%10 = ashr i32 %9, 31
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = ashr i32 %11, 31
store i32 %12, i32* %6
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = xor i32 %13, %14
%16 = load i32, i32* %5
%17 = sub nsw i32 %15, %16
store i32 %17, i32* %7
%18 = load i32, i32* %4
%19 = load i32, i32* %6
%20 = xor i32 %18, %19
%21 = load i32, i32* %6
%22 = sub nsw i32 %20, %21
store i32 %22, i32* %8
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = xor i32 %24, %23
store i32 %25, i32* %5
%26 = load i32, i32* %7
%27 = load i32, i32* %8
%28 = call i32 @__udivsi3(i32 %26, i32 %27)
%29 = load i32, i32* %5
%30 = xor i32 %28, %29
%31 = load i32, i32* %5
%32 = sub nsw i32 %30, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @__divsi3(i32 %0, i32 %1) {
%3 = ashr i32 %0, 31
%4 = ashr i32 %1, 31
%5 = xor i32 %3, %0
%6 = sub nsw i32 %5, %3
%7 = xor i32 %4, %1
%8 = sub nsw i32 %7, %4
%9 = xor i32 %4, %3
%10 = tail call i32 @__udivsi3(i32 %6, i32 %8)
%11 = xor i32 %10, %9
%12 = sub nsw i32 %11, %9
ret i32 %12
}
/* Variables and functions */
scalar_t__ exp(double);
scalar_t__ ran3(long *);
int metrop(double de, double t) {
  static long gljdum = 1;
  return de < 0.0 || ran3(&gljdum) < exp(-de / t);
}


x86 assembly (clang, -O0):
<metrop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x1,%al
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x11(%rbp)
ja     118b <metrop+0x6b>
lea    0x2ee4(%rip),%rdi
call   1040 <ran3@plt>
mov    %rax,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<metrop>:
mov    $0x1,%eax
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
ja     1178 <metrop+0x58>
push   %rbx
sub    $0x20,%rsp
lea    0x2ef5(%rip),%rdi
movapd %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
call   1040 <ran3@plt>
mov    %rax,%rbx
movapd 0x10(%rsp),%xmm0
xorpd  0xea3(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
call   1030 <exp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rbx
setl   %al
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@metrop.gljdum = internal global i64 1
define i32 @metrop(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %15, label %7
7: ; preds = %2
%8 = call i64 @ran3(i64* @metrop.gljdum)
%9 = load double, double* %3
%10 = fneg double %9
%11 = load double, double* %4
%12 = fdiv double %10, %11
%13 = call i64 @exp(double %12)
%14 = icmp slt i64 %8, %13
br label %15
15: ; preds = %7, %2
%16 = phi i1 [ true, %2 ], [ %14, %7 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@metrop.gljdum = internal global i64 1
define i32 @metrop(double %0, double %1) {
%3 = fcmp olt double %0, 0.000000e+00
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = tail call i64 @ran3(i64* @metrop.gljdum)
%6 = fneg double %0
%7 = fdiv double %6, %1
%8 = tail call i64 @exp(double %7)
%9 = icmp slt i64 %5, %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %2
%12 = phi i32 [ 1, %2 ], [ %10, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ ClearBload(void *);
void ClearBloadCallback(void *theEnv) { ClearBload(theEnv); }


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

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

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

LLVM IR (-O2):
define void @ClearBloadCallback(i8* %0) {
%2 = tail call i32 @ClearBload(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ dumpio_fclose(int /*<<< orphan*/);
void dumpio_fclose_(int32_t *fid) {
  int32_t ierr;
  ierr = dumpio_fclose(*fid);
}


x86 assembly (clang, -O0):
<dumpio_fclose_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <dumpio_fclose@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpio_fclose_>:
mov    (%rdi),%edi
jmp    1030 <dumpio_fclose@plt>

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

LLVM IR (-O2):
define void @dumpio_fclose_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @dumpio_fclose(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int cain() {
  printf("Hello world\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define i32 @cain() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @cain() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ S_IRWXU;
int /*<<< orphan*/ close(int);
int creat(char *, int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
int main(void) {
  char *path = "/tmp/myfile.txt";
  int fd = creat(path, S_IRWXU);
  if (fd >= 0)
    close(fd);
  unlink(path);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
call   1050 <creat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1171 <main+0x41>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1050 <creat@plt>
test   %eax,%eax
js     1151 <main+0x21>
mov    %eax,%edi
call   1040 <close@plt>
lea    0xea8(%rip),%rdi
call   1030 <unlink@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"/tmp/myfile.txt\00"
@S_IRWXU = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @S_IRWXU
%6 = call i32 @creat(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %3
%11 = call i32 @close(i32 %10)
br label %12
12: ; preds = %9, %0
%13 = load i8*, i8** %2
%14 = call i32 @unlink(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"/tmp/myfile.txt\00"
@S_IRWXU = global i32 0
define i32 @main() {
%1 = load i32, i32* @S_IRWXU
%2 = tail call i32 @creat(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @close(i32 %2)
br label %6
6: ; preds = %4, %0
%7 = tail call i32 @unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void mixedComparisons3(signed char a) {
  clang_analyzer_eval((a - 0x200) < -0x100LL);
  clang_analyzer_eval(a == 0);
  clang_analyzer_eval(a == 0x7F);
  clang_analyzer_eval(a == -0x80);
}


x86 assembly (clang, -O0):
<mixedComparisons3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x200,%eax
cltq
cmp    $0xffffffffffffff00,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x7f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
movsbl -0x1(%rbp),%eax
cmp    $0xffffff80,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixedComparisons3>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
test   %bl,%bl
sete   %dil
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmp    $0x7f,%bl
sete   %dil
call   1030 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmp    $0x80,%bl
sete   %dil
pop    %rbx
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @mixedComparisons3(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 512
%6 = sext i32 %5 to i64
%7 = icmp slt i64 %6, -256
%8 = zext i1 %7 to i32
%9 = call i32 @clang_analyzer_eval(i32 %8)
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @clang_analyzer_eval(i32 %13)
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 127
%18 = zext i1 %17 to i32
%19 = call i32 @clang_analyzer_eval(i32 %18)
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, -128
%23 = zext i1 %22 to i32
%24 = call i32 @clang_analyzer_eval(i32 %23)
ret void
}

LLVM IR (-O2):
define void @mixedComparisons3(i8 signext %0) {
%2 = tail call i32 @clang_analyzer_eval(i32 1)
%3 = icmp eq i8 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @clang_analyzer_eval(i32 %4)
%6 = icmp eq i8 %0, 127
%7 = zext i1 %6 to i32
%8 = tail call i32 @clang_analyzer_eval(i32 %7)
%9 = icmp eq i8 %0, -128
%10 = zext i1 %9 to i32
%11 = tail call i32 @clang_analyzer_eval(i32 %10)
ret void
}
void __deregister_frame() {}


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

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

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

LLVM IR (-O2):
define void @__deregister_frame() {
ret void
}
int main() {
  int x, y;
  while (1) {
    x++;
    y++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0xc(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %0, %4
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
br label %4
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_bus_message_ref(void *m) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @sd_bus_message_ref(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @sd_bus_message_ref(i8* nocapture readnone %0) {
ret i8* null
}
void *fd2ud(int fd) { return (void *)(long)fd; }


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

x86 assembly (clang, -O2):
<fd2ud>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i8* @fd2ud(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @fd2ud(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void GraphError(char *message) {
  printf("error: %s\n", message);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"error: %s\0A\00"
define void @GraphError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"error: %s\0A\00"
define void @GraphError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ destroy();
int /*<<< orphan*/ remove();
int /*<<< orphan*/ remove2();
int main() {
  destroy();
  remove();
  remove2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @destroy()
%2 = tail call i32 (...) @remove()
%3 = tail call i32 (...) @remove2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void input(int *p, int size) {
  int i;
  printf("Enter %d numbers:\n", size);
  for (i = 0; i < size; i++) {
    scanf("%d", p + i);
  }
}


x86 assembly (clang, -O0):
<input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117a <input+0x5a>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeac(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1145 <input+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
test   %ebp,%ebp
jle    1165 <input+0x45>
mov    %ebp,%ebp
lea    0xed1(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%rbp
jne    1150 <input+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter %d numbers:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define void @input(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 0, i32* %5
br label %8
8: ; preds = %18, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
br label %18
18: ; preds = %12
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %8
21: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Enter %d numbers:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define void @input(i32* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %2
ret void
}
/* Variables and functions */
double sqrt(double);
double norm_2d(double *x) {
  double out;
  out = *x * *x;
  x++;
  out += *x * *x;
  return sqrt(out);
}


x86 assembly (clang, -O0):
<norm_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm_2d>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1134 <norm_2d+0x24>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @norm_2d(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = load double, double* %6
%8 = fmul double %5, %7
store double %8, double* %3
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i32 1
store double* %10, double** %2
%11 = load double*, double** %2
%12 = load double, double* %11
%13 = load double*, double** %2
%14 = load double, double* %13
%15 = load double, double* %3
%16 = call double @llvm.fmuladd.f64(double %12, double %14, double %15)
store double %16, double* %3
%17 = load double, double* %3
%18 = call double @sqrt(double %17)
ret double %18
}

LLVM IR (-O2):
define double @norm_2d(double* nocapture %0) {
%2 = load double, double* %0
%3 = fmul double %2, %2
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %3)
%7 = tail call double @sqrt(double %6)
ret double %7
}
void g_cache_remove() {}


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

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

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

LLVM IR (-O2):
define void @g_cache_remove() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint8_t long2Byte(uint64_t l, uint8_t pos) {
  uint64_t r = l << (pos * 8);
  return r >> 56;
}


x86 assembly (clang, -O0):
<long2Byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @long2Byte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 8
%9 = shl i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = ashr i32 %10, 56
ret i32 %11
}

LLVM IR (-O2):
define i32 @long2Byte(i32 %0, i32 %1) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(void *data) { printf("%d", *(int *)data); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char const *, char *, int);
int is_url(const char *name) { return strncmp(name, "http://", 7) == 0; }


x86 assembly (clang, -O0):
<is_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_url>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"http://\00"
define i32 @is_url(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"http://\00"
define i32 @is_url(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void _exit(int rc) {
  while (1)
    *(char *)0xE001 = rc;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0xe001,%eax
mov    %cl,(%rax)
jmp    1107 <_exit+0x7>

x86 assembly (clang, -O2):
<_exit>:
mov    %dil,0xe001
nopl   0x0(%rax,%rax,1)
jmp    1110 <_exit+0x10>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* inttoptr (i64 57345 to i8*)
br label %3
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = trunc i32 %0 to i8
store i8 %2, i8* inttoptr (i64 57345 to i8*)
br label %3
3: ; preds = %1, %3
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
__attribute__((always_)) uint8_t __LDREXB(volatile uint8_t *addr) {
  uint8_t result;
  return (result);
}


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

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

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

LLVM IR (-O2):
define i32 @__LDREXB(i32* nocapture readnone %0) {
ret i32 undef
}
void avpriv_get_raw_pix_fmt_tags() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_get_raw_pix_fmt_tags() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *);
char *my_str_malloc(size_t len) {
  char *s;
  s = (char *)malloc(sizeof(char) * len);
  if (s == NULL) {
    printf("Out of memory.\n");
    exit(1);
  }
  memset(s, '\0', sizeof(char) * len);
  return s;
}


x86 assembly (clang, -O0):
<my_str_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1180 <my_str_malloc+0x40>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_str_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
test   %rax,%rax
je     116c <my_str_malloc+0x2c>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14d,%edx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory.\0A\00"
define i8* @my_str_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 1, %4
%6 = trunc i64 %5 to i32
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
%16 = load i64, i64* %2
%17 = mul i64 1, %16
%18 = trunc i64 %17 to i32
%19 = call i32 @memset(i8* %15, i8 signext 0, i32 %18)
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@str = [15 x i8] c"Out of memory.\00"
define i8* @my_str_malloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = tail call i32 @memset(i8* %4, i8 signext 0, i32 %2)
ret i8* %4
}