xunge/DecIR huggingface dataset:
unsigned char character(unsigned char i) { return i + 'A'; }


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

x86 assembly (clang, -O2):
<character>:
lea    0x41(%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i8 @character(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = add nsw i32 %4, 65
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @character(i8 zeroext %0) {
%2 = add i8 %0, 65
ret i8 %2
}
int sp_isnumber(char *string) {
  char *current = string;
  while (*current && (*current >= '0') && (*current <= '9')) {
    current++;
  }
  return *current ? 0 : 1;
}


x86 assembly (clang, -O0):
<sp_isnumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     114a <sp_isnumber+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x11(%rbp)
jl     114a <sp_isnumber+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115a <sp_isnumber+0x5a>
jmp    116b <sp_isnumber+0x6b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <sp_isnumber+0x10>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_isnumber>:
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%eax
add    $0x1,%rdi
cmp    $0xa,%al
jb     1100 <sp_isnumber>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @sp_isnumber(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %22, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 48
br i1 %14, label %15, label %20
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 57
br label %20
20: ; preds = %15, %10, %5
%21 = phi i1 [ false, %10 ], [ false, %5 ], [ %19, %15 ]
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
br label %5
25: ; preds = %20
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 0
%30 = zext i1 %29 to i64
%31 = select i1 %29, i32 0, i32 1
ret i32 %31
}

LLVM IR (-O2):
define i32 @sp_isnumber(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = add i8 %4, -48
%6 = icmp ult i8 %5, 10
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = icmp eq i8 %4, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
int main() {
  typedef int a;
  typedef int a;
  typedef struct S struct_S;
  typedef struct S {
    int a;
    int b;
  } struct_S;
  typedef struct S struct_S1;
  struct_S *s;
  struct_S1 *s1;
  s = s1;
  typedef int A;
  {
    A A;
    A = 3;
    if (A != 3)
      return 1;
  }
  typedef A *B, C;
  C c;
  B b = &c;
  c = 3;
  if (*b != 3)
    return 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x3,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
je     1130 <main+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1153 <main+0x53>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x3,-0x20(%rbp)
mov    -0x28(%rbp),%rax
cmpl   $0x3,(%rax)
je     1153 <main+0x53>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.S = type { i32, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.S*
%3 = alloca %struct.S*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 0, i32* %1
%7 = load %struct.S*, %struct.S** %3
store %struct.S* %7, %struct.S** %2
store i32 3, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 1, i32* %1
br label %16
11: ; preds = %0
store i32* %5, i32** %6
store i32 3, i32* %5
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 2, i32* %1
br label %16
16: ; preds = %10, %15, %11
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
%struct.S = type { i32, i32 }
define i32 @main() {
ret i32 0
}
long long t7(long long a, long long b) {
  printf("%s: a: %lld\n", __func__, a);
  printf("%s: b: %lld\n", __func__, b);
  return a + b;
}


x86 assembly (clang, -O0):
<t7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed5(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdx
lea    0xecc(%rip),%rdi
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t7>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xede(%rip),%rdi
lea    0xee4(%rip),%r15
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
add    %r14,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%s: a: %lld\0A\00"
@__func__.t7 = [3 x i8] c"t7\00"
@.str.1 = [13 x i8] c"%s: b: %lld\0A\00"
define i64 @t7(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t7, i64 0, i64 0), i64 %5)
%7 = load i64, i64* %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t7, i64 0, i64 0), i64 %7)
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = add nsw i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s: a: %lld\0A\00"
@__func__.t7 = [3 x i8] c"t7\00"
@.str.1 = [13 x i8] c"%s: b: %lld\0A\00"
define i64 @t7(i64 %0, i64 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t7, i64 0, i64 0), i64 %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t7, i64 0, i64 0), i64 %1)
%5 = add nsw i64 %1, %0
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_socket_(int *sockfd) { close(*sockfd); }


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

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

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

LLVM IR (-O2):
define void @close_socket_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @close(i32 %2)
ret void
}
int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.iio_dev = type opaque
define i32 @iio_simple_dummy_configure_buffer(%struct.iio_dev* %0) {
%2 = alloca %struct.iio_dev*
store %struct.iio_dev* %0, %struct.iio_dev** %2
ret i32 0
}

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @iio_simple_dummy_configure_buffer(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
void Assignment(float f, double d, long double ld) {
  d = f;
  ld = f;
  ld = d;
  f = d;
  f = ld;
  d = ld;
}


x86 assembly (clang, -O0):
<Assignment>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
fstpt  -0x20(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
flds   -0x4(%rbp)
fstpt  -0x20(%rbp)
fldl   -0x10(%rbp)
fstpt  -0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
fldt   -0x20(%rbp)
fstps  -0x4(%rbp)
fldt   -0x20(%rbp)
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Assignment(float %0, double %1, x86_fp80 %2) {
%4 = alloca float
%5 = alloca double
%6 = alloca x86_fp80
store float %0, float* %4
store double %1, double* %5
store x86_fp80 %2, x86_fp80* %6
%7 = load float, float* %4
%8 = fpext float %7 to double
store double %8, double* %5
%9 = load float, float* %4
%10 = fpext float %9 to x86_fp80
store x86_fp80 %10, x86_fp80* %6
%11 = load double, double* %5
%12 = fpext double %11 to x86_fp80
store x86_fp80 %12, x86_fp80* %6
%13 = load double, double* %5
%14 = fptrunc double %13 to float
store float %14, float* %4
%15 = load x86_fp80, x86_fp80* %6
%16 = fptrunc x86_fp80 %15 to float
store float %16, float* %4
%17 = load x86_fp80, x86_fp80* %6
%18 = fptrunc x86_fp80 %17 to double
store double %18, double* %5
ret void
}

LLVM IR (-O2):
define void @Assignment(float %0, double %1, x86_fp80 %2) {
ret void
}
double _p3dKittlerTresholding_P2(int t, double *h, int hist_length) {
  long i;
  double sum;
  sum = 0.0;
  for (i = t + 1; i <= hist_length; i++)
    sum += h[i];
  return sum;
}


x86 assembly (clang, -O0):
<_p3dKittlerTresholding_P2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
jg     115b <_p3dKittlerTresholding_P2+0x5b>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1122 <_p3dKittlerTresholding_P2+0x22>
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_p3dKittlerTresholding_P2>:
xorpd  %xmm0,%xmm0
cmp    %edx,%edi
jge    112f <_p3dKittlerTresholding_P2+0x2f>
movslq %edx,%rax
movslq %edi,%rcx
xorpd  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addsd  0x8(%rsi,%rcx,8),%xmm0
add    $0x1,%rcx
cmp    %rax,%rcx
jl     1120 <_p3dKittlerTresholding_P2+0x20>
ret

LLVM IR (-O0):
define double @_p3dKittlerTresholding_P2(i32 %0, double* %1, i32 %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i32
%7 = alloca i64
%8 = alloca double
store i32 %0, i32* %4
store double* %1, double** %5
store i32 %2, i32* %6
store double 0.000000e+00, double* %8
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
%11 = sext i32 %10 to i64
store i64 %11, i64* %7
br label %12
12: ; preds = %24, %3
%13 = load i64, i64* %7
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = icmp sle i64 %13, %15
br i1 %16, label %17, label %27
17: ; preds = %12
%18 = load double*, double** %5
%19 = load i64, i64* %7
%20 = getelementptr inbounds double, double* %18, i64 %19
%21 = load double, double* %20
%22 = load double, double* %8
%23 = fadd double %22, %21
store double %23, double* %8
br label %24
24: ; preds = %17
%25 = load i64, i64* %7
%26 = add nsw i64 %25, 1
store i64 %26, i64* %7
br label %12
27: ; preds = %12
%28 = load double, double* %8
ret double %28
}

LLVM IR (-O2):
define double @_p3dKittlerTresholding_P2(i32 %0, double* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = icmp slt i32 %0, %2
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = add nsw i32 %0, 1
%8 = sext i32 %7 to i64
br label %9
9: ; preds = %6, %9
%10 = phi double [ %14, %9 ], [ 0.000000e+00, %6 ]
%11 = phi i64 [ %15, %9 ], [ %8, %6 ]
%12 = getelementptr inbounds double, double* %1, i64 %11
%13 = load double, double* %12
%14 = fadd double %10, %13
%15 = add nsw i64 %11, 1
%16 = icmp slt i64 %11, %4
br i1 %16, label %9, label %17
17: ; preds = %9, %3
%18 = phi double [ 0.000000e+00, %3 ], [ %14, %9 ]
ret double %18
}
hellovms() {}


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

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

LLVM IR (-O0):
define i32 @hellovms() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @hellovms() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ geo_location_displayed();
int /*<<< orphan*/ is_geo_location_enabled();
int /*<<< orphan*/ roadmap_geo_location_dialog();
void roadmap_geo_location_info(void) {
  if (!is_geo_location_enabled())
    return;
  if (geo_location_displayed())
    return;
  roadmap_geo_location_dialog();
}


x86 assembly (clang, -O0):
<roadmap_geo_location_info>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <is_geo_location_enabled@plt>
cmp    $0x0,%eax
jne    1149 <roadmap_geo_location_info+0x19>
jmp    1166 <roadmap_geo_location_info+0x36>
mov    $0x0,%al
call   1050 <geo_location_displayed@plt>
cmp    $0x0,%rax
je     115f <roadmap_geo_location_info+0x2f>
jmp    1166 <roadmap_geo_location_info+0x36>
mov    $0x0,%al
call   1030 <roadmap_geo_location_dialog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_geo_location_info>:
push   %rax
xor    %eax,%eax
call   1040 <is_geo_location_enabled@plt>
test   %eax,%eax
je     1148 <roadmap_geo_location_info+0x18>
xor    %eax,%eax
call   1050 <geo_location_displayed@plt>
test   %rax,%rax
je     114a <roadmap_geo_location_info+0x1a>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <roadmap_geo_location_dialog@plt>

LLVM IR (-O0):
define void @roadmap_geo_location_info() {
%1 = call i32 (...) @is_geo_location_enabled()
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %10
4: ; preds = %0
%5 = call i64 (...) @geo_location_displayed()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4
br label %10
8: ; preds = %4
%9 = call i32 (...) @roadmap_geo_location_dialog()
br label %10
10: ; preds = %8, %7, %3
ret void
}

LLVM IR (-O2):
define void @roadmap_geo_location_info() {
%1 = tail call i32 (...) @is_geo_location_enabled()
%2 = icmp eq i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i64 (...) @geo_location_displayed()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @roadmap_geo_location_dialog()
br label %8
8: ; preds = %3, %0, %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_andnot_si128(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_andnot_si128(__m128i A, __m128i B) {
  return _mm_andnot_si128(A, B);
}


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

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

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

LLVM IR (-O2):
define i32 @test_mm_andnot_si128(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_andnot_si128(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ debugPrint(char *);
int /*<<< orphan*/ next_glPopDebugGroup();
int /*<<< orphan*/ printGLError();
void glPopDebugGroup() {
  next_glPopDebugGroup();
  printGLError();
  debugPrint("glPopDebugGroup()\n");
}


x86 assembly (clang, -O0):
<glPopDebugGroup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <next_glPopDebugGroup@plt>
mov    $0x0,%al
call   1030 <printGLError@plt>
lea    0xeb7(%rip),%rdi
call   1050 <debugPrint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glPopDebugGroup>:
push   %rax
xor    %eax,%eax
call   1040 <next_glPopDebugGroup@plt>
xor    %eax,%eax
call   1030 <printGLError@plt>
lea    0xeba(%rip),%rdi
pop    %rax
jmp    1050 <debugPrint@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"glPopDebugGroup()\0A\00"
define void @glPopDebugGroup() {
%1 = call i32 (...) @next_glPopDebugGroup()
%2 = call i32 (...) @printGLError()
%3 = call i32 @debugPrint(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"glPopDebugGroup()\0A\00"
define void @glPopDebugGroup() {
%1 = tail call i32 (...) @next_glPopDebugGroup()
%2 = tail call i32 (...) @printGLError()
%3 = tail call i32 @debugPrint(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t prv_not_equal_real_fn(double a, double b) { return a != b ? -1 : 0; }


x86 assembly (clang, -O0):
<prv_not_equal_real_fn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
xor    %eax,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
setp   %sil
setne  %dl
or     %sil,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_not_equal_real_fn>:
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rax
ret

LLVM IR (-O0):
define i32 @prv_not_equal_real_fn(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 = load double, double* %4
%7 = fcmp une double %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @prv_not_equal_real_fn(double %0, double %1) {
%3 = fcmp une double %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int a;
  char b;
  (void)(&a == &b);
  printf("Hello world\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast i8* %7 to i32*
%9 = icmp eq i32* %6, %8
%10 = zext i1 %9 to i32
%11 = 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 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
long double simX(long double v[]) {
  const long double o = 10;
  return o * (v[1] - v[0]);
}


x86 assembly (clang, -O0):
<simX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
flds   0xef2(%rip)
fld    %st(0)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   0x10(%rax)
fldt   (%rax)
fsubrp %st,%st(1)
fmulp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<simX>:
fldt   0x10(%rdi)
fldt   (%rdi)
fsubrp %st,%st(1)
fmuls  0xef3(%rip)
ret

LLVM IR (-O0):
define x86_fp80 @simX(x86_fp80* %0) {
%2 = alloca x86_fp80*
%3 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %2
store x86_fp80 0xK4002A000000000000000, x86_fp80* %3
%4 = load x86_fp80*, x86_fp80** %2
%5 = getelementptr inbounds x86_fp80, x86_fp80* %4, i64 1
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80*, x86_fp80** %2
%8 = getelementptr inbounds x86_fp80, x86_fp80* %7, i64 0
%9 = load x86_fp80, x86_fp80* %8
%10 = fsub x86_fp80 %6, %9
%11 = fmul x86_fp80 0xK4002A000000000000000, %10
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @simX(x86_fp80* nocapture %0) {
%2 = getelementptr inbounds x86_fp80, x86_fp80* %0, i64 1
%3 = load x86_fp80, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %0
%5 = fsub x86_fp80 %3, %4
%6 = fmul x86_fp80 %5, 0xK4002A000000000000000
ret x86_fp80 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a;
  printf("%d\n", 0 == !(a = 1));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
scalar_t__ is_alpha(char const);
int __alpha_len(const char *s) {
  int l;
  for (l = 0; is_alpha(*s); l++)
    s++;
  return l;
}


x86 assembly (clang, -O0):
<__alpha_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_alpha@plt>
cmp    $0x0,%rax
je     1153 <__alpha_len+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <__alpha_len+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__alpha_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <is_alpha@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1144 <__alpha_len+0x34>
cs nopw 0x0(%rax,%rax,1)
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <is_alpha@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <__alpha_len+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @__alpha_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @is_alpha(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add nuw nsw i32 %6, 1
%10 = load i8, i8* %8
%11 = tail call i64 @is_alpha(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int,
                           char const *);
int /*<<< orphan*/ stderr;
int assert_fail(const char *s, unsigned l) {
  fprintf(stderr, "assertion failed in line %u: '%s'\n", l, s);
  return 0;
}


x86 assembly (clang, -O0):
<assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_fail>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rcx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"assertion failed in line %u: '%s'\0A\00"
define i32 @assert_fail(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"assertion failed in line %u: '%s'\0A\00"
define i32 @assert_fail(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
ret i32 0
}
void touch_string(const char *str) {
  const char *c;
  for (c = str; *c != '\0'; c++)
    ;
}


x86 assembly (clang, -O0):
<touch_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1136 <touch_string+0x36>
jmp    1125 <touch_string+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <touch_string+0x10>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @touch_string(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char inb(int);
char getScancode() {
  char c = 0;
  do {
    if (inb(0x60) != c) {
      c = inb(0x60);
      if (c > 0)
        return c;
    }
  } while (1);
}


x86 assembly (clang, -O0):
<getScancode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x2(%rbp)
mov    $0x60,%edi
call   1030 <inb@plt>
movsbl %al,%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
je     115f <getScancode+0x4f>
mov    $0x60,%edi
call   1030 <inb@plt>
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jle    115a <getScancode+0x4a>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1173 <getScancode+0x63>
jmp    115f <getScancode+0x4f>
jmp    1164 <getScancode+0x54>
mov    $0x1,%al
test   $0x1,%al
jne    111c <getScancode+0xc>
jmp    1173 <getScancode+0x63>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getScancode>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x60,%edi
call   1030 <inb@plt>
cmp    %bl,%al
je     1120 <getScancode+0x10>
mov    $0x60,%edi
call   1030 <inb@plt>
mov    %eax,%ebx
test   %al,%al
jle    1120 <getScancode+0x10>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @getScancode() {
br label %1
1: ; preds = %6, %0
%2 = phi i8 [ %7, %6 ], [ 0, %0 ]
br label %3
3: ; preds = %1, %3
%4 = tail call signext i8 @inb(i32 96)
%5 = icmp eq i8 %4, %2
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = tail call signext i8 @inb(i32 96)
%8 = icmp sgt i8 %7, 0
br i1 %8, label %9, label %1
9: ; preds = %6
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ FerMem_Free(double *, char *, int);
void free_cached_full_array_(double **pointer_val) {
  if (*pointer_val != NULL) {
    FerMem_Free(*pointer_val,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/NOAA-PMEL/Ferret/refs/heads/"
                "master/fer/ccr/free_cached_full_array.c",
                65);
    *pointer_val = NULL;
  }
}


x86 assembly (clang, -O0):
<free_cached_full_array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114d <free_cached_full_array_+0x3d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xec8(%rip),%rsi
mov    $0x41,%edx
call   1030 <FerMem_Free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_cached_full_array_>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1134 <free_cached_full_array_+0x24>
lea    0xedd(%rip),%rsi
mov    $0x41,%edx
call   1030 <FerMem_Free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NOAA-PMEL/Ferret/refs/heads/master/fer/ccr/free_cached_full_array.c\00"
define void @free_cached_full_array_(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = load double*, double** %3
%5 = icmp ne double* %4, null
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double**, double*** %2
%8 = load double*, double** %7
%9 = call i32 @FerMem_Free(double* %8, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 65)
%10 = load double**, double*** %2
store double* null, double** %10
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NOAA-PMEL/Ferret/refs/heads/master/fer/ccr/free_cached_full_array.c\00"
define void @free_cached_full_array_(double** nocapture %0) {
%2 = load double*, double** %0
%3 = icmp eq double* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @FerMem_Free(double* %2, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 65)
store double* null, double** %0
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int git_os_error();
int /*<<< orphan*/ link(char *, char *);
int /*<<< orphan*/ rename(char *, char *);
int /*<<< orphan*/ unlink(char *);
int gitfo_move_file(char *from, char *to) {
  if (!link(from, to)) {
    unlink(from);
    return 0;
  }
  if (!rename(from, to))
    return 0;
  return git_os_error();
}


x86 assembly (clang, -O0):
<gitfo_move_file>:
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   1060 <link@plt>
cmp    $0x0,%eax
jne    117b <gitfo_move_file+0x3b>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <gitfo_move_file+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <rename@plt>
cmp    $0x0,%eax
jne    119d <gitfo_move_file+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <gitfo_move_file+0x67>
mov    $0x0,%al
call   1040 <git_os_error@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gitfo_move_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1060 <link@plt>
mov    %rbx,%rdi
test   %eax,%eax
je     1170 <gitfo_move_file+0x30>
mov    %r14,%rsi
call   1050 <rename@plt>
test   %eax,%eax
je     1175 <gitfo_move_file+0x35>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <git_os_error@plt>
call   1030 <unlink@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @gitfo_move_file(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 = load i8*, i8** %5
%8 = call i32 @link(i8* %6, i8* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @unlink(i8* %11)
store i32 0, i32* %3
br label %21
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = call i32 @rename(i8* %14, i8* %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %13
store i32 0, i32* %3
br label %21
19: ; preds = %13
%20 = call i32 (...) @git_os_error()
store i32 %20, i32* %3
br label %21
21: ; preds = %19, %18, %10
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @gitfo_move_file(i8* %0, i8* %1) {
%3 = tail call i32 @link(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unlink(i8* %0)
br label %12
7: ; preds = %2
%8 = tail call i32 @rename(i8* %0, i8* %1)
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (...) @git_os_error()
br label %12
12: ; preds = %7, %10, %5
%13 = phi i32 [ %11, %10 ], [ 0, %5 ], [ 0, %7 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ vfork();
int main(void) {
  pid_t pid;
  pid = vfork();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = call i32 @vfork()
ret i32 0
}
/* Variables and functions */
int syscall(int, int *, int /*<<< orphan*/);
int mutex_destroy(int *m) { return syscall(18, m, 0); }


x86 assembly (clang, -O0):
<mutex_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x12,%edi
xor    %edx,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_destroy>:
mov    %rdi,%rsi
mov    $0x12,%edi
xor    %edx,%edx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @mutex_destroy(i32* %0) {
%2 = tail call i32 @syscall(i32 18, i32* %0, i32 0)
ret i32 %2
}
extern void x() {}


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

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

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

LLVM IR (-O2):
define void @x() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void performDelayedReboot() {
  printf("The system will be rebooted when you press Ctrl-C or "
         "Ctrl-Alt-Delete.\n");
  while (1) {
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<performDelayedReboot>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <performDelayedReboot+0x10>

x86 assembly (clang, -O2):
<performDelayedReboot>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <performDelayedReboot+0x10>

LLVM IR (-O0):
@.str = [71 x i8] c"The system will be rebooted when you press Ctrl-C or Ctrl-Alt-Delete.\0A\00"
define void @performDelayedReboot() {
%1 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
@str = [70 x i8] c"The system will be rebooted when you press Ctrl-C or Ctrl-Alt-Delete.\00"
define void @performDelayedReboot() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = tail call i32 @sleep(i32 1)
br label %2
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
u_int32_t shr32(u_int32_t i, int count) {
  if (count == 32)
    return 0;
  return i >> count;
}


x86 assembly (clang, -O0):
<shr32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jne    1120 <shr32+0x20>
movl   $0x0,-0x4(%rbp)
jmp    112b <shr32+0x2b>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shr32>:
mov    %esi,%ecx
sar    %cl,%edi
xor    %eax,%eax
cmp    $0x20,%esi
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @shr32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 32
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = ashr i32 %10, %11
store i32 %12, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @shr32(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 32
%4 = ashr i32 %0, %1
%5 = select i1 %3, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *,
                         size_t const);
void *malloc(size_t const);
__attribute__((alloc_size(1))) void *xmalloc(const size_t size) {
  void *ret = malloc(size);
  if (!ret && size)
    error(EXIT_FAILURE, 0, "cannot allocate %zu bytes", size);
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <xmalloc+0x4a>
cmpq   $0x0,-0x8(%rbp)
je     116a <xmalloc+0x4a>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
xor    %esi,%esi
lea    0xe9b(%rip),%rdx
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1153 <xmalloc+0x33>
test   %r14,%r14
jne    1153 <xmalloc+0x33>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rdx
xor    %esi,%esi
mov    %rbx,%rcx
call   1040 <error@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [26 x i8] c"cannot allocate %zu bytes\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %15, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* @EXIT_FAILURE
%13 = load i64, i64* %2
%14 = call i32 @error(i32 %12, i32 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %13)
br label %15
15: ; preds = %11, %8, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [26 x i8] c"cannot allocate %zu bytes\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @error(i32 %7, i32 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %9
9: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int show_menu();
int cmd_help(int cmd_argc, char *cmd_argv[]) { return show_menu(); }


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

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

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

LLVM IR (-O2):
define i32 @cmd_help(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @show_menu()
ret i32 %3
}
void TimerOC3FastConfigure(unsigned long ulBase, unsigned long ulOCFast) {
  unsigned long ulTempccmr2 = 0;

  ;

  ;
  ulTempccmr2 = (*((volatile unsigned long *)(ulBase + 0x0000001C)));
  ulTempccmr2 &= ~0x00000004;
  ulTempccmr2 |= ulOCFast;
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) = ulTempccmr2;
}


x86 assembly (clang, -O0):
<TimerOC3FastConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xfffffffffffffffb,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerOC3FastConfigure>:
mov    0x1c(%rdi),%rax
and    $0xfffffffffffffffb,%rax
or     %rsi,%rax
mov    %rax,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @TimerOC3FastConfigure(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %3
%7 = add i64 %6, 28
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = and i64 %10, -5
store i64 %11, i64* %5
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = or i64 %13, %12
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = load i64, i64* %3
%17 = add i64 %16, 28
%18 = inttoptr i64 %17 to i64*
store volatile i64 %15, i64* %18
ret void
}

LLVM IR (-O2):
define void @TimerOC3FastConfigure(i64 %0, i64 %1) {
%3 = add i64 %0, 28
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -5
%7 = or i64 %6, %1
store volatile i64 %7, i64* %4
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool carry(uint32_t a, bool c, uint32_t r) { return c ? r <= a : r < a; }


x86 assembly (clang, -O0):
<carry>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1131 <carry+0x31>
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
jmp    1144 <carry+0x44>
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<carry>:
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdi,%rdx
setle  %al
setl   %cl
test   %esi,%esi
cmove  %ecx,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @carry(i64 %0, i32 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i64
store i64 %0, i64* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i64, i64* %6
%11 = load i64, i64* %4
%12 = icmp sle i64 %10, %11
%13 = zext i1 %12 to i32
br label %19
14: ; preds = %3
%15 = load i64, i64* %6
%16 = load i64, i64* %4
%17 = icmp slt i64 %15, %16
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %14, %9
%20 = phi i32 [ %13, %9 ], [ %18, %14 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @carry(i64 %0, i32 %1, i64 %2) {
%4 = icmp eq i32 %1, 0
%5 = icmp sle i64 %2, %0
%6 = icmp slt i64 %2, %0
%7 = select i1 %4, i1 %6, i1 %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
long strtol(char const *, char **, int);
long strcint(const char *str) {
  int num;
  char *ptr;
  return strtol(str, &ptr, 10);
}


x86 assembly (clang, -O0):
<strcint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcint>:
push   %rax
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @strcint(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strtol(i8* %5, i8** %4, i32 10)
ret i64 %6
}

LLVM IR (-O2):
define i64 @strcint(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtol(i8* %0, i8** %2, i32 10)
ret i64 %4
}
void rop3_144_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


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

x86 assembly (clang, -O2):
<rop3_144_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
or     %sil,%cl
not    %cl
and    %dl,%cl
and    %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_144_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = xor i8 %5, -1
%7 = and i8 %6, %2
%8 = and i8 %4, %1
%9 = or i8 %7, %8
store i8 %9, i8* %0
ret void
}
int somedllfunc(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @somedllfunc() {
ret i32 42
}

LLVM IR (-O2):
define i32 @somedllfunc() {
ret i32 42
}