xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_string(char *ostr) {
  if (ostr != NULL)
    free(ostr);
}


x86 assembly (clang, -O0):
<free_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_string+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_string>:
test   %rdi,%rdi
je     111a <free_string+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @free_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t reglib_max(uint32_t a, uint32_t b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<reglib_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <reglib_max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <reglib_max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reglib_max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @reglib_max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
void siz_reverse(size_t *array, size_t n) {
  size_t *end = array + n;
  size_t t;
  while (--end > array) {
    t = *end;
    *end = *array;
    *array++ = t;
  }
}


x86 assembly (clang, -O0):
<siz_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x18(%rbp)
cmp    -0x8(%rbp),%rax
jbe    1169 <siz_reverse+0x69>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x8(%rbp)
mov    %rcx,(%rax)
jmp    111f <siz_reverse+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<siz_reverse>:
lea    (%rdi,%rsi,8),%rax
add    $0xfffffffffffffff8,%rax
cmp    %rdi,%rax
jbe    113e <siz_reverse+0x3e>
add    $0x8,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rax),%rcx
mov    -0x8(%rdi),%rdx
mov    %rdx,(%rax)
mov    %rcx,-0x8(%rdi)
add    $0xfffffffffffffff8,%rax
lea    0x8(%rdi),%rcx
cmp    %rdi,%rax
mov    %rcx,%rdi
ja     1120 <siz_reverse+0x20>
ret

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

LLVM IR (-O2):
define void @siz_reverse(i64* %0, i64 %1) {
%3 = getelementptr inbounds i64, i64* %0, i64 %1
%4 = getelementptr inbounds i64, i64* %3, i64 -1
%5 = icmp ugt i64* %4, %0
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi i64* [ %12, %6 ], [ %4, %2 ]
%8 = phi i64* [ %11, %6 ], [ %0, %2 ]
%9 = load i64, i64* %7
%10 = load i64, i64* %8
store i64 %10, i64* %7
%11 = getelementptr inbounds i64, i64* %8, i64 1
store i64 %9, i64* %8
%12 = getelementptr inbounds i64, i64* %7, i64 -1
%13 = icmp ugt i64* %12, %11
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
double atan2(double, double);
double radian(double degree) {
  double pi = 4.0 * atan2(1.0, 1.0);
  return (degree / 180.) * pi;
}


x86 assembly (clang, -O0):
<radian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm1
movaps %xmm1,%xmm0
call   1030 <atan2@plt>
movaps %xmm0,%xmm1
movsd  0xed0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb2(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radian>:
push   %rax
movsd  %xmm0,(%rsp)
movsd  0xee2(%rip),%xmm0
movaps %xmm0,%xmm1
call   1030 <atan2@plt>
movsd  (%rsp),%xmm0
divsd  0xed5(%rip),%xmm0
mulsd  0xed5(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @radian(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call double @atan2(double 1.000000e+00, double 1.000000e+00)
%5 = fmul double 4.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %2
%7 = fdiv double %6, 1.800000e+02
%8 = load double, double* %3
%9 = fmul double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @radian(double %0) {
%2 = tail call double @atan2(double 1.000000e+00, double 1.000000e+00)
%3 = fdiv double %0, 1.800000e+02
%4 = fmul double %3, 0x400921FB54442D18
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float ss = 0.1999999;
  printf("%f", ss);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float 0x3FC99998C0000000)
ret i32 0
}
void EI() {}


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

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

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

LLVM IR (-O2):
define void @EI() {
ret void
}
signed long long f8(signed long long v_foo) {
  signed long long v_shr = ((unsigned long long)v_foo) >> 2;
  signed long long v_and = v_shr & -7;
  return v_and;
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffffffffffff9,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f8>:
mov    %rdi,%rax
shr    $0x2,%rax
and    $0xfffffffffffffff9,%rax
ret

LLVM IR (-O0):
define i64 @f8(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 2
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = and i64 %7, -7
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @f8(i64 %0) {
%2 = lshr i64 %0, 2
%3 = and i64 %2, 4611686018427387897
ret i64 %3
}
unsigned int UARTModemStatusChangeCheck(unsigned int baseAdd) {
  return ((*((volatile unsigned int *)(baseAdd + (0x18)))) &
          ((0x00000008u) | (0x00000004u) | (0x00000002u) | (0x00000001u)));
}


x86 assembly (clang, -O0):
<UARTModemStatusChangeCheck>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x18,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemStatusChangeCheck>:
add    $0x18,%edi
mov    (%rdi),%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @UARTModemStatusChangeCheck(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 24
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 15
ret i32 %8
}

LLVM IR (-O2):
define i32 @UARTModemStatusChangeCheck(i32 %0) {
%2 = add i32 %0, 24
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 15
ret i32 %6
}
int parent_index(int child_index) { return (child_index - 1) / 2; }


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

x86 assembly (clang, -O2):
<parent_index>:
mov    %edi,%eax
add    $0xffffffff,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @parent_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @parent_index(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = sdiv i32 %2, 2
ret i32 %3
}
int charsearch(char c, const char *s) {
  if (c == '\0')
    return 1;
  while (*s)
    if (*s == c)
      break;
    else
      s++;
  if (*s)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<charsearch>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    1127 <charsearch+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1182 <charsearch+0x82>
jmp    112c <charsearch+0x2c>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <charsearch+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1151 <charsearch+0x51>
jmp    1162 <charsearch+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <charsearch+0x2c>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     117b <charsearch+0x7b>
movl   $0x1,-0x4(%rbp)
jmp    1182 <charsearch+0x82>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charsearch>:
test   %dil,%dil
je     1128 <charsearch+0x28>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi),%ecx
test   %cl,%cl
je     1120 <charsearch+0x20>
add    $0x1,%rsi
cmp    %dil,%cl
jne    1110 <charsearch+0x10>
xor    %eax,%eax
test   %cl,%cl
setne  %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @charsearch(i8 signext %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 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %33
10: ; preds = %2
br label %11
11: ; preds = %26, %10
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %11
%16 = load i8*, i8** %5
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %18, %20
br i1 %21, label %22, label %23
22: ; preds = %15
br label %27
23: ; preds = %15
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
br label %26
26: ; preds = %23
br label %11
27: ; preds = %22, %11
%28 = load i8*, i8** %5
%29 = load i8, i8* %28
%30 = icmp ne i8 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 1, i32* %3
br label %33
32: ; preds = %27
store i32 0, i32* %3
br label %33
33: ; preds = %32, %31, %9
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @charsearch(i8 signext %0, i8* nocapture %1) {
%3 = icmp eq i8 %0, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %1, %2 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = icmp eq i8 %6, %0
%9 = or i1 %7, %8
%10 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %9, label %11, label %4
11: ; preds = %4
%12 = xor i1 %7, true
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %11, %2
%15 = phi i32 [ 1, %2 ], [ %13, %11 ]
ret i32 %15
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xconfigure;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xconfigure_display(void *_p) {
  return (void *)((XEvent *)_p)->xconfigure.display;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XEvent_xconfigure_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
unsigned srl(unsigned x, int k) {
  unsigned xsra = (int)x >> k;
  int w = sizeof(int) << 3;
  int mask = (int)-1 << (w - k);
  return xsra & ~mask;
}


x86 assembly (clang, -O0):
<srl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
movl   $0x20,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<srl>:
mov    %esi,%ecx
sar    %cl,%edi
neg    %cl
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @srl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = ashr i32 %8, %9
store i32 %10, i32* %5
store i32 32, i32* %6
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = sub nsw i32 %11, %12
%14 = shl i32 -1, %13
store i32 %14, i32* %7
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = xor i32 %16, -1
%18 = and i32 %15, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @srl(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl nsw i32 -1, %4
%6 = xor i32 %5, -1
%7 = and i32 %3, %6
ret i32 %7
}
void g_value_fits_pointer() {}


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

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

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

LLVM IR (-O2):
define void @g_value_fits_pointer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcat(char *, char *);
int main(void) {
  char flower[80];
  char addon[] = "s smell like old shoes.";
  puts("What is your favorite flower?");
  gets(flower);
  strcat(flower, addon);
  puts(flower);
  puts(addon);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
lea    -0x60(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x60(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x60(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x80(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
movaps 0xec2(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x2e73656f687320,%rax
mov    %rax,0x10(%rsp)
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.addon = [24 x i8] c"s smell like old shoes.\00"
@.str = [30 x i8] c"What is your favorite flower?\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = alloca [24 x i8]
store i32 0, i32* %1
%4 = bitcast [24 x i8]* %3 to i8*
%5 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%10 = call i32 @strcat(i8* %8, i8* %9)
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%12 = call i32 @puts(i8* %11)
%13 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%14 = call i32 @puts(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.addon = [24 x i8] c"s smell like old shoes.\00"
@.str = [30 x i8] c"What is your favorite flower?\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca [24 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @gets(i8* %3)
%7 = call i32 @strcat(i8* %3, i8* %4)
%8 = call i32 @puts(i8* %3)
%9 = call i32 @puts(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int compare_lines(void *a, void *b) {
  if (!strcmp(*(char **)a, *(char **)b))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compare_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1148 <compare_lines+0x38>
movl   $0x1,-0x4(%rbp)
jmp    114f <compare_lines+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_lines>:
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @compare_lines(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
void _Locale_numeric_destroy(void *__DUMMY_PAR) {}


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

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

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

LLVM IR (-O2):
define void @_Locale_numeric_destroy(i8* nocapture %0) {
ret void
}
int div(int a, int b) { return b ? a / b : -1; }


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1123 <div+0x23>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1130 <div+0x30>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <div+0x30>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
test   %esi,%esi
je     110a <div+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @div(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i32 %0, %1
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ -1, %2 ]
ret i32 %7
}
/* Variables and functions */
int strlen(char *str) {
  int i;
  i = 0;
  while (*str++ != '\0') {
    i++;
  }
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int rand_int_between(int, int, int);
int spin_red(int bet, int tid) {
  int payout = -1;
  int slot = rand_int_between(1, 38, tid);
  if (slot <= 18) {
    payout = bet;
  } else if (slot <= 36) {
    payout = -bet;
  } else {
    payout = -(bet / 2);
  }
  return payout;
}


x86 assembly (clang, -O0):
<spin_red>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x1,%edi
mov    $0x26,%esi
call   1030 <rand_int_between@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x12,-0x10(%rbp)
jg     114f <spin_red+0x3f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    117f <spin_red+0x6f>
cmpl   $0x24,-0x10(%rbp)
jg     1166 <spin_red+0x56>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    117a <spin_red+0x6a>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    117f <spin_red+0x6f>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spin_red>:
push   %rbx
mov    %esi,%edx
mov    %edi,%ebx
mov    $0x1,%edi
mov    $0x26,%esi
call   1030 <rand_int_between@plt>
cmp    $0x13,%eax
jl     113f <spin_red+0x2f>
cmp    $0x24,%eax
ja     1132 <spin_red+0x22>
neg    %ebx
jmp    113f <spin_red+0x2f>
mov    %ebx,%eax
shr    $0x1f,%eax
add    %ebx,%eax
sar    %eax
neg    %eax
mov    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @spin_red(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 -1, i32* %5
%7 = load i32, i32* %4
%8 = call i32 @rand_int_between(i32 1, i32 38, i32 %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp sle i32 %9, 18
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %3
store i32 %12, i32* %5
br label %24
13: ; preds = %2
%14 = load i32, i32* %6
%15 = icmp sle i32 %14, 36
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %3
%18 = sub nsw i32 0, %17
store i32 %18, i32* %5
br label %23
19: ; preds = %13
%20 = load i32, i32* %3
%21 = sdiv i32 %20, 2
%22 = sub nsw i32 0, %21
store i32 %22, i32* %5
br label %23
23: ; preds = %19, %16
br label %24
24: ; preds = %23, %11
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @spin_red(i32 %0, i32 %1) {
%3 = tail call i32 @rand_int_between(i32 1, i32 38, i32 %1)
%4 = icmp slt i32 %3, 19
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = icmp ult i32 %3, 37
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = sub nsw i32 0, %0
br label %11
9: ; preds = %5
%10 = sdiv i32 %0, -2
br label %11
11: ; preds = %2, %7, %9
%12 = phi i32 [ %8, %7 ], [ %10, %9 ], [ %0, %2 ]
ret i32 %12
}
/* Variables and functions */
int errno;
int my_set_errno(int oi_errno) {
  errno = oi_errno;
  return -1;
}


x86 assembly (clang, -O0):
<my_set_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ecf(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_set_errno>:
mov    0x2ed9(%rip),%rax
mov    %edi,(%rax)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @my_set_errno(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @my_set_errno(i32 %0) {
store i32 %0, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_or_die(void *ptr) {
  ;
  free(ptr);
}


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

x86 assembly (clang, -O2):
<free_or_die>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_or_die(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ disableHeater(int /*<<< orphan*/);
void disableAllHeater() { disableHeater(0); }


x86 assembly (clang, -O0):
<disableAllHeater>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <disableHeater@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disableAllHeater>:
xor    %edi,%edi
jmp    1030 <disableHeater@plt>

LLVM IR (-O0):
define void @disableAllHeater() {
%1 = call i32 @disableHeater(i32 0)
ret void
}

LLVM IR (-O2):
define void @disableAllHeater() {
%1 = tail call i32 @disableHeater(i32 0)
ret void
}
void gdk_window_type_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_type_get_type() {
ret void
}
const char *path_last(const char *p) {
  const char *s;
  for (s = p; *s != 0; s += 1)
    if (*s == '/')
      p = ++s;
  return p;
}


x86 assembly (clang, -O0):
<path_last>:
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     1156 <path_last+0x56>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1140 <path_last+0x40>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1145 <path_last+0x45>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <path_last+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_last>:
mov    %rdi,%rax
mov    %rdi,%rcx
jmp    111b <path_last+0x1b>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rcx
mov    %rcx,%rax
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x2f,%dl
je     1110 <path_last+0x10>
test   %dl,%dl
jne    1117 <path_last+0x17>
ret

LLVM IR (-O0):
define i8* @path_last(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 = %19, %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 %22
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 47
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
store i8* %17, i8** %2
br label %18
18: ; preds = %15, %10
br label %19
19: ; preds = %18
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8* %21, i8** %3
br label %5
22: ; preds = %5
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @path_last(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = phi i8* [ %0, %1 ], [ %11, %8 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 0, label %12
i8 47, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %3, %2 ]
%10 = phi i8* [ %7, %6 ], [ %4, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
br label %2
12: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int proxy(int);
int baz(int i) {
  if (i == 0)
    return proxy(0);
  else if (i > 0)
    return proxy(1);
  else
    return proxy(-1);
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1134 <baz+0x24>
xor    %edi,%edi
call   1030 <proxy@plt>
mov    %eax,-0x4(%rbp)
jmp    115d <baz+0x4d>
cmpl   $0x0,-0x8(%rbp)
jle    1150 <baz+0x40>
mov    $0x1,%edi
call   1030 <proxy@plt>
mov    %eax,-0x4(%rbp)
jmp    115d <baz+0x4d>
mov    $0xffffffff,%edi
call   1030 <proxy@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
lea    -0x1(%rax,%rax,1),%eax
cmovne %eax,%edi
jmp    1030 <proxy@plt>

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

LLVM IR (-O2):
define i32 @baz(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 -1, i32 1
%5 = select i1 %2, i32 0, i32 %4
%6 = tail call i32 @proxy(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ErrorLine(char *, char const *);
void BMP_InvalidExtension(const char *fileName) {
  ErrorLine("Bitmap file extension not recognized for file %s"
            " (Supported extensions: .BMP, .pbitm, .xbm and .pbm/.ppm/.pnm)",
            fileName);
}


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

x86 assembly (clang, -O2):
<BMP_InvalidExtension>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <ErrorLine@plt>

LLVM IR (-O0):
@.str = [111 x i8] c"Bitmap file extension not recognized for file %s (Supported extensions: .BMP, .pbitm, .xbm and .pbm/.ppm/.pnm)\00"
define void @BMP_InvalidExtension(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ErrorLine(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [111 x i8] c"Bitmap file extension not recognized for file %s (Supported extensions: .BMP, .pbitm, .xbm and .pbm/.ppm/.pnm)\00"
define void @BMP_InvalidExtension(i8* %0) {
%2 = tail call i32 @ErrorLine(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_timestamp_t;
typedef int /*<<< orphan*/ xcb_connection_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ xembed_message_send(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/);
void xembed_focus_in(xcb_connection_t *c, xcb_window_t client,
                     xcb_timestamp_t timestamp, uint32_t focus_type) {
  xembed_message_send(c, client, timestamp, 4, focus_type, 0, 0);
}


x86 assembly (clang, -O0):
<xembed_focus_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%r8d
mov    $0x4,%ecx
xor    %r9d,%r9d
movl   $0x0,(%rsp)
call   1030 <xembed_message_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xembed_focus_in>:
push   %rax
mov    %ecx,%r8d
movl   $0x0,(%rsp)
mov    $0x4,%ecx
xor    %r9d,%r9d
call   1030 <xembed_message_send@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @xembed_focus_in(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @xembed_message_send(i32* %0, i32 %1, i32 %2, i32 4, i32 %3, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, int);
main() {
  char *p = "main(){ char*p=%c%s%c; printf(p,34,p,34); }";
  printf(p, 34, p, 34);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x22,%ecx
mov    %ecx,%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    $0x22,%esi
mov    %rdi,%rdx
mov    $0x22,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [44 x i8] c"main(){ char*p=%c%s%c; printf(p,34,p,34); }\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 34, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 34)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_aesenc_si128(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i __attribute__((__target__("aes")))
mm_aesenc_si128_wrap(__m128i v, __m128i r) {
  return _mm_aesenc_si128(v, r);
}


x86 assembly (clang, -O0):
<mm_aesenc_si128_wrap>:
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_aesenc_si128@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_aesenc_si128_wrap>:
jmp    1030 <_mm_aesenc_si128@plt>

LLVM IR (-O0):
define i32 @mm_aesenc_si128_wrap(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_aesenc_si128(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mm_aesenc_si128_wrap(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_aesenc_si128(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void dump(double *input) {
  int i;
  for (i = 0; i < 32 * 32 * 32; ++i) {
    printf("%f\n", input[i]);
  }
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8000,-0xc(%rbp)
jge    1157 <dump+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <dump+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x8000,%rbx
jne    1130 <dump+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @dump(double* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds double, double* %0, i64 %3
%5 = load double, double* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
%7 = add nuw nsw i64 %3, 1
%8 = icmp eq i64 %7, 32768
br i1 %8, label %9, label %2
9: ; preds = %2
ret void
}
int test_imm_E6int8_mem(signed char *val) {
  return ((*val) & (0xE6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E6int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xe6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E6int8_mem>:
testb  $0xe6,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E6int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 230
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_E6int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -26
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int ts_x_origin;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
void set_XGCValues_ts_x_origin(void *_p, int _v) {
  ((XGCValues *)_p)->ts_x_origin = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XGCValues_ts_x_origin>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XGCValues_ts_x_origin(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_OCTET_STRING;

/* Variables and functions */
int ASN1_STRING_set(int /*<<< orphan*/ *, unsigned char const *, int);
int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d,
                          int len) {
  return ASN1_STRING_set(x, d, len);
}


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

x86 assembly (clang, -O2):
<ASN1_OCTET_STRING_set>:
jmp    1030 <ASN1_STRING_set@plt>

LLVM IR (-O0):
define i32 @ASN1_OCTET_STRING_set(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @ASN1_STRING_set(i32* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ASN1_OCTET_STRING_set(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ASN1_STRING_set(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
int test_07(int x) { return x > 0 ? x - 1 : x; }


x86 assembly (clang, -O0):
<test_07>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111f <test_07+0x1f>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <test_07+0x25>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_07>:
mov    %edi,%eax
xor    %ecx,%ecx
test   %edi,%edi
setg   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_07(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_07(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = sext i1 %2 to i32
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int);
int /*<<< orphan*/ assert(int);
int main() {
  unsigned n;
  int a[n];
  __ESBMC_assume(n < 100000 && n > 10);
  a[0] = 0;
  a[1] = 1;
  a[2] = 2;
  assert(a[0] == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x186a0,-0x8(%rbp)
mov    %al,-0x19(%rbp)
jae    1172 <main+0x52>
cmpl   $0xa,-0x8(%rbp)
seta   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__ESBMC_assume@plt>
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x1,0x4(%rax)
movl   $0x2,0x8(%rax)
cmpl   $0x1,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = load i32, i32* %2
%10 = icmp ult i32 %9, 100000
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = load i32, i32* %2
%13 = icmp ugt i32 %12, 10
br label %14
14: ; preds = %11, %0
%15 = phi i1 [ false, %0 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
%17 = call i32 @__ESBMC_assume(i32 %16)
%18 = getelementptr inbounds i32, i32* %8, i64 0
store i32 0, i32* %18
%19 = getelementptr inbounds i32, i32* %8, i64 1
store i32 1, i32* %19
%20 = getelementptr inbounds i32, i32* %8, i64 2
store i32 2, i32* %20
%21 = getelementptr inbounds i32, i32* %8, i64 0
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 1
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = load i8*, i8** %3
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__ESBMC_assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
char *strrchr(char *, char);
char *proc_stat_after_cmd(char *p) {
  p = strrchr(p, ')');
  if (p)
    *p++ = '\0';
  return p;
}


x86 assembly (clang, -O0):
<proc_stat_after_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x29,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <proc_stat_after_cmd+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_stat_after_cmd>:
push   %rax
mov    $0x29,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     112c <proc_stat_after_cmd+0x1c>
mov    %rax,%rcx
add    $0x1,%rax
movb   $0x0,(%rcx)
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @proc_stat_after_cmd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strrchr(i8* %3, i8 signext 41)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
store i8 0, i8* %8
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @proc_stat_after_cmd(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 41)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
store i8 0, i8* %2
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}