xunge/DecIR huggingface dataset:
/* Type definitions */
struct cri_mutex {
  int dummy;
};

/* Variables and functions */
int ENOTSUP;
int cri_mutex_unlock(struct cri_mutex *mutex) { return -ENOTSUP; }


x86 assembly (clang, -O0):
<cri_mutex_unlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cri_mutex_unlock>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.cri_mutex = type { i32 }
@ENOTSUP = global i32 0
define i32 @cri_mutex_unlock(%struct.cri_mutex* %0) {
%2 = alloca %struct.cri_mutex*
store %struct.cri_mutex* %0, %struct.cri_mutex** %2
%3 = load i32, i32* @ENOTSUP
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.cri_mutex = type { i32 }
@ENOTSUP = global i32 0
define i32 @cri_mutex_unlock(%struct.cri_mutex* nocapture readnone %0) {
%2 = load i32, i32* @ENOTSUP
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void yaz(int sayi) { printf("%d\n", sayi); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @yaz(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
unsigned char foo3(int);
__attribute__((no)) unsigned char bar3(int x) { return foo3(x + 6); }


x86 assembly (clang, -O0):
<bar3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x6,%edi
call   1030 <foo3@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar3>:
add    $0x6,%edi
jmp    1030 <foo3@plt>

LLVM IR (-O0):
define zeroext i8 @bar3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 6
%5 = call zeroext i8 @foo3(i32 %4)
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @bar3(i32 %0) {
%2 = add nsw i32 %0, 6
%3 = tail call zeroext i8 @foo3(i32 %2)
ret i8 %3
}
int hexCharToInt(char c) {
  if (c <= 57)
    return c - 48;
  return c - 87;
}


x86 assembly (clang, -O0):
<hexCharToInt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1126 <hexCharToInt+0x26>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <hexCharToInt+0x30>
movsbl -0x5(%rbp),%eax
sub    $0x57,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexCharToInt>:
lea    -0x57(%rdi),%ecx
lea    -0x30(%rdi),%eax
cmp    $0x3a,%dil
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hexCharToInt(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 %5, 57
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 48
store i32 %10, i32* %2
br label %15
11: ; preds = %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 87
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %7
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @hexCharToInt(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp slt i8 %0, 58
%4 = select i1 %3, i32 -48, i32 -87
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Type definitions */
struct vmbuf {
  int dummy;
};

/* Variables and functions */
scalar_t__ vmbuf_mem(struct vmbuf *);
char *vmbuf_str(struct vmbuf *vmbuf) { return (char *)vmbuf_mem(vmbuf); }


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

x86 assembly (clang, -O2):
<vmbuf_str>:
jmp    1030 <vmbuf_mem@plt>

LLVM IR (-O0):
%struct.vmbuf = type { i32 }
define i8* @vmbuf_str(%struct.vmbuf* %0) {
%2 = alloca %struct.vmbuf*
store %struct.vmbuf* %0, %struct.vmbuf** %2
%3 = load %struct.vmbuf*, %struct.vmbuf** %2
%4 = call i64 @vmbuf_mem(%struct.vmbuf* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
%struct.vmbuf = type { i32 }
define i8* @vmbuf_str(%struct.vmbuf* %0) {
%2 = tail call i64 @vmbuf_mem(%struct.vmbuf* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int Get32(int);
int /*<<< orphan*/ Set32(int, int);
void set_next_tick(uint32_t time_ms) {
  uint32_t date_lowbits = Get32(0x20003004);
  date_lowbits += (uint32_t)(time_ms * 250000);
  Set32(0x20003010, date_lowbits);
}


x86 assembly (clang, -O0):
<set_next_tick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x20003004,%edi
call   1030 <Get32@plt>
mov    %eax,-0x8(%rbp)
imul   $0x3d090,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x20003010,%edi
call   1040 <Set32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_next_tick>:
push   %rbx
mov    %edi,%ebx
mov    $0x20003004,%edi
call   1030 <Get32@plt>
imul   $0x3d090,%ebx,%esi
add    %eax,%esi
mov    $0x20003010,%edi
pop    %rbx
jmp    1040 <Set32@plt>

LLVM IR (-O0):
define void @set_next_tick(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @Get32(i32 536883204)
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 250000
%7 = load i32, i32* %3
%8 = add nsw i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @Set32(i32 536883216, i32 %9)
ret void
}

LLVM IR (-O2):
define void @set_next_tick(i32 %0) {
%2 = tail call i32 @Get32(i32 536883204)
%3 = mul nsw i32 %0, 250000
%4 = add nsw i32 %2, %3
%5 = tail call i32 @Set32(i32 536883216, i32 %4)
ret void
}
/* Variables and functions */
double fmod(double, double);
double reg_mod_angle(double ang) {
  double angle;
  angle = fmod(ang, 360.0);
  if (angle < 0.0)
    angle += 360.0;
  return angle;
}


x86 assembly (clang, -O0):
<reg_mod_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <fmod@plt>
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1154 <reg_mod_angle+0x44>
movsd  0xeb6(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_mod_angle>:
push   %rax
movsd  0xee7(%rip),%xmm1
call   1030 <fmod@plt>
movsd  0xeda(%rip),%xmm3
addsd  %xmm0,%xmm3
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm1
cmpltsd %xmm2,%xmm1
andpd  %xmm1,%xmm3
andnpd %xmm0,%xmm1
orpd   %xmm3,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @reg_mod_angle(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @fmod(double %4, double 3.600000e+02)
store double %5, double* %3
%6 = load double, double* %3
%7 = fcmp olt double %6, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = fadd double %9, 3.600000e+02
store double %10, double* %3
br label %11
11: ; preds = %8, %1
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @reg_mod_angle(double %0) {
%2 = tail call double @fmod(double %0, double 3.600000e+02)
%3 = fcmp olt double %2, 0.000000e+00
%4 = fadd double %2, 3.600000e+02
%5 = select i1 %3, double %4, double %2
ret double %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int dobldobl_witness_set_to_system_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(637, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<dobldobl_witness_set_to_system_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x27d,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_witness_set_to_system_container>:
mov    $0x27d,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @dobldobl_witness_set_to_system_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 637, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @dobldobl_witness_set_to_system_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 637, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int read_integer(char const *);
int get_max() {
  int max;
  const char prompt[] = "Enter size of chessboard: ";
  max = read_integer(prompt);
  return max;
}


x86 assembly (clang, -O0):
<get_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%ax
mov    %ax,-0x8(%rbp)
mov    0xed0(%rip),%al
mov    %al,-0x6(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <read_integer@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_max>:
sub    $0x28,%rsp
movups 0xef0(%rip),%xmm0
movups %xmm0,0xb(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <read_integer@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.get_max.prompt = [27 x i8] c"Enter size of chessboard: \00"
define i32 @get_max() {
%1 = alloca i32
%2 = alloca [27 x i8]
%3 = bitcast [27 x i8]* %2 to i8*
%4 = getelementptr inbounds [27 x i8], [27 x i8]* %2, i64 0, i64 0
%5 = call i32 @read_integer(i8* %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@__const.get_max.prompt = [27 x i8] c"Enter size of chessboard: \00"
define i32 @get_max() {
%1 = alloca [27 x i8]
%2 = getelementptr inbounds [27 x i8], [27 x i8]* %1, i64 0, i64 0
%3 = call i32 @read_integer(i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ extern_func1_8(int, char *, unsigned long);
void extern_func1_7(int a, char *b, unsigned long c) {
  extern_func1_8(a, b, c);
}


x86 assembly (clang, -O0):
<extern_func1_7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <extern_func1_8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extern_func1_7>:
jmp    1030 <extern_func1_8@plt>

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

LLVM IR (-O2):
define void @extern_func1_7(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @extern_func1_8(i32 %0, i8* %1, i64 %2)
ret void
}
void main() {
  int y;
  int x = 5;
  if (y > 1) {
    x = 1;
  } else {
    x = -1;
  }
  int z = y;
  while (y < 5) {
    if (z > 1) {
      x = x + 1;
    } else {
      x = x - 1;
    }
    y = y + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1121 <main+0x21>
movl   $0x1,-0x8(%rbp)
jmp    1128 <main+0x28>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1167 <main+0x67>
cmpl   $0x1,-0xc(%rbp)
jle    1150 <main+0x50>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1159 <main+0x59>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112e <main+0x2e>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
void g_type_set_qdata() {}


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

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

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

LLVM IR (-O2):
define void @g_type_set_qdata() {
ret void
}
/* Variables and functions */
float __ocml_erfcinv_f32(float);
float erfcinvf(float x) { return __ocml_erfcinv_f32(x); }


x86 assembly (clang, -O0):
<erfcinvf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__ocml_erfcinv_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erfcinvf>:
jmp    1030 <__ocml_erfcinv_f32@plt>

LLVM IR (-O0):
define float @erfcinvf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__ocml_erfcinv_f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @erfcinvf(float %0) {
%2 = tail call float @__ocml_erfcinv_f32(float %0)
ret float %2
}
long long int twoPow(long long int exp) {
  long long int base = 2;
  long long int result = 1;
  while (exp) {
    if (exp & 1)
      result *= base;
    exp >>= 1;
    base *= base;
  }
  return result;
}


x86 assembly (clang, -O0):
<twoPow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x2,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1160 <twoPow+0x60>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1142 <twoPow+0x42>
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <twoPow+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<twoPow>:
test   %rdi,%rdi
je     1140 <twoPow+0x40>
mov    $0x2,%edx
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %rdi,%rsi
nopl   0x0(%rax,%rax,1)
test   $0x1,%dil
mov    %rdx,%rcx
cmove  %r8,%rcx
imul   %rcx,%rax
sar    %rsi
imul   %rdx,%rdx
cmp    $0x1,%rdi
mov    %rsi,%rdi
ja     1120 <twoPow+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @twoPow(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %10, %3 ], [ 1, %1 ]
%5 = phi i64 [ %12, %3 ], [ 2, %1 ]
%6 = phi i64 [ %11, %3 ], [ %0, %1 ]
%7 = and i64 %6, 1
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i64 1, i64 %5
%10 = mul nsw i64 %9, %4
%11 = ashr i64 %6, 1
%12 = mul nsw i64 %5, %5
%13 = icmp ult i64 %6, 2
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i64 [ 1, %1 ], [ %10, %3 ]
ret i64 %15
}
/* Type definitions */
typedef int volatile uint32_t;

/* Variables and functions */
uint32_t volatile_fetch_xor_u32(volatile uint32_t *dest, uint32_t val) {
  uint32_t result = *dest;
  *dest = result ^ val;
  return result;
}


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

x86 assembly (clang, -O2):
<volatile_fetch_xor_u32>:
mov    %esi,-0x4(%rsp)
mov    (%rdi),%eax
mov    %eax,-0x8(%rsp)
mov    -0x8(%rsp),%eax
xor    -0x4(%rsp),%eax
mov    %eax,(%rdi)
mov    -0x8(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @volatile_fetch_xor_u32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store volatile i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load volatile i32, i32* %6
store volatile i32 %7, i32* %5
%8 = load volatile i32, i32* %5
%9 = load volatile i32, i32* %4
%10 = xor i32 %8, %9
%11 = load i32*, i32** %3
store volatile i32 %10, i32* %11
%12 = load volatile i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @volatile_fetch_xor_u32(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store volatile i32 %1, i32* %3
%5 = bitcast i32* %4 to i8*
%6 = load volatile i32, i32* %0
store volatile i32 %6, i32* %4
%7 = load volatile i32, i32* %4
%8 = load volatile i32, i32* %3
%9 = xor i32 %8, %7
store volatile i32 %9, i32* %0
%10 = load volatile i32, i32* %4
ret i32 %10
}
/* Variables and functions */
int __syscall(int, char const *, int, int);
int errno;
int _open(const char *buf, int flags, int mode) {
  int err;
  err = __syscall(5, buf, flags, mode);
  if (err < 0) {
    errno = -err;
    return -1;
  }
  return err;
}


x86 assembly (clang, -O0):
<_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x5,%edi
call   1030 <__syscall@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    115d <_open+0x4d>
xor    %ecx,%ecx
sub    -0x1c(%rbp),%ecx
mov    0x2e91(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <_open+0x53>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_open>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x5,%edi
call   1030 <__syscall@plt>
test   %eax,%eax
js     1128 <_open+0x18>
pop    %rcx
ret
neg    %eax
mov    0x2eaf(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @_open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @__syscall(i32 5, i8* %0, i32 %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = sub nsw i32 0, %4
store i32 %7, i32* @errno
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ -1, %6 ], [ %4, %3 ]
ret i32 %9
}
double comma(double a, double b) {
  (void)a;
  return b;
}


x86 assembly (clang, -O0):
<comma>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<comma>:
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @comma(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
ret double %6
}

LLVM IR (-O2):
define double @comma(double %0, double returned %1) {
ret double %1
}
/* Variables and functions */
size_t my_strlen(char *s) {
  char *p = s;
  while (*p)
    ++p;
  return (p - s);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <my_strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <my_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <my_strlen+0x10>
ret

LLVM IR (-O0):
define i64 @my_strlen(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 = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
br label %5
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @my_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int min(int, int);
int /*<<< orphan*/ printf(char *, int);
void print_min(int first, int second) { printf("%d\n", min(first, second)); }


x86 assembly (clang, -O0):
<print_min>:
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   1040 <min@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_min>:
push   %rax
call   1040 <min@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print_min(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 @min(i32 %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_min(i32 %0, i32 %1) {
%3 = tail call i32 @min(i32 %0, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void asm_mipsfree(void *ptr) { free((char *)ptr); }


x86 assembly (clang, -O0):
<asm_mipsfree>:
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):
<asm_mipsfree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @asm_mipsfree(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 @asm_mipsfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("Usage: b2c bin_img tar_file.h symname\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: b2c bin_img tar_file.h symname\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [38 x i8] c"Usage: b2c bin_img tar_file.h symname\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ display_all_cmd();
int /*<<< orphan*/ printError();
void call_history(char **shArgs) {
  if (shArgs[1] == NULL) {
    display_all_cmd();
  } else {
    printError();
  }
}


x86 assembly (clang, -O0):
<call_history>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    1147 <call_history+0x27>
mov    $0x0,%al
call   1030 <display_all_cmd@plt>
jmp    114e <call_history+0x2e>
mov    $0x0,%al
call   1040 <printError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_history>:
cmpq   $0x0,0x8(%rdi)
je     112e <call_history+0xe>
xor    %eax,%eax
jmp    1040 <printError@plt>
xor    %eax,%eax
jmp    1030 <display_all_cmd@plt>

LLVM IR (-O0):
define void @call_history(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @display_all_cmd()
br label %11
9: ; preds = %1
%10 = call i32 (...) @printError()
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
define void @call_history(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @display_all_cmd()
br label %9
7: ; preds = %1
%8 = tail call i32 (...) @printError()
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(_Bool);
f(_Bool x) { exit(x); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<f>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @f(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = call i32 @exit(i1 zeroext %5)
unreachable
}

LLVM IR (-O2):
define i32 @f(i1 zeroext %0) {
%2 = tail call i32 @exit(i1 zeroext %0)
unreachable
}
/* Type definitions */
typedef unsigned int uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
size_t aeron_int64_to_ptr_hash_map_hash_key(int64_t key, size_t mask) {
  return (size_t)(((uint64_t)key * 31u) & mask);
}


x86 assembly (clang, -O0):
<aeron_int64_to_ptr_hash_map_hash_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x1f,%eax,%eax
mov    %eax,%eax
and    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_int64_to_ptr_hash_map_hash_key>:
mov    %edi,%eax
shl    $0x5,%eax
sub    %edi,%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i64 @aeron_int64_to_ptr_hash_map_hash_key(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 = trunc i64 %5 to i32
%7 = mul i32 %6, 31
%8 = zext i32 %7 to i64
%9 = load i64, i64* %4
%10 = and i64 %8, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @aeron_int64_to_ptr_hash_map_hash_key(i64 %0, i64 %1) {
%3 = mul i64 %0, 31
%4 = and i64 %3, 4294967295
%5 = and i64 %4, %1
ret i64 %5
}
int isdigit(int c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ is_index(char *);
int strtoll(char *, int /*<<< orphan*/ *, int);
ssize_t att_index(char *key) {
  if (!is_index(key))
    return -1;
  return strtoll(key + 1, NULL, 10);
}


x86 assembly (clang, -O0):
<att_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_index@plt>
cmp    $0x0,%eax
jne    114a <att_index+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <att_index+0x43>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<att_index>:
push   %rbx
mov    %rdi,%rbx
call   1030 <is_index@plt>
test   %eax,%eax
je     1141 <att_index+0x21>
add    $0x1,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
pop    %rbx
jmp    1040 <strtoll@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @att_index(i8* %0) {
%2 = tail call i32 @is_index(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = tail call i32 @strtoll(i8* nocapture %5, i32* null, i32 10)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Emit1(int);
void Emit2(int v) {
  Emit1(v & 255);
  Emit1((v >> 8) & 255);
}


x86 assembly (clang, -O0):
<Emit2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <Emit1@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <Emit1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Emit2>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <Emit1@plt>
movzbl %bh,%edi
pop    %rbx
jmp    1030 <Emit1@plt>

LLVM IR (-O0):
define void @Emit2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 @Emit1(i32 %4)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 @Emit1(i32 %8)
ret void
}

LLVM IR (-O2):
define void @Emit2(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @Emit1(i32 %2)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 @Emit1(i32 %5)
ret void
}
/* Variables and functions */
int PnameDef();
PsimulateNameDef() {
  int b = -1;
  ;
  b = PnameDef();
  return (b);
}


x86 assembly (clang, -O0):
<PsimulateNameDef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1030 <PnameDef@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @PsimulateNameDef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 (...) @PnameDef()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @PsimulateNameDef() {
%1 = tail call i32 (...) @PnameDef()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, unsigned int);
int /*<<< orphan*/ stderr;
void badassertion(char *file, unsigned int line) {
  fprintf(stderr, "assertion failed file %s, line %u\n", file, line);
  error("assertion");
}


x86 assembly (clang, -O0):
<badassertion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xed1(%rip),%rdi
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badassertion>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xee1(%rip),%rdi
pop    %rax
jmp    1040 <error@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"assertion failed file %s, line %u\0A\00"
@.str.1 = [10 x i8] c"assertion\00"
define void @badassertion(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 i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = call i32 @error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"assertion failed file %s, line %u\0A\00"
@.str.1 = [10 x i8] c"assertion\00"
define void @badassertion(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), i8* %0, i32 %1)
%5 = tail call i32 @error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_AEuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xAE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_AEuint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xae,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_AEuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 174
%7 = icmp ne i64 %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_AEuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11403264
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int n;
  int k;
  int i;
  i = 0;
  int flag;
  assume(n > 0 && n < 10);
  while (i < n) {
    i++;
    if (flag)
      k += 4000;
    else
      k += 2000;
  }
  assert(k > n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jle    114f <main+0x2f>
cmpl   $0xa,-0x8(%rbp)
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    119b <main+0x7b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     118b <main+0x6b>
mov    -0xc(%rbp),%eax
add    $0xfa0,%eax
mov    %eax,-0xc(%rbp)
jmp    1196 <main+0x76>
mov    -0xc(%rbp),%eax
add    $0x7d0,%eax
mov    %eax,-0xc(%rbp)
jmp    115c <main+0x3c>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
int lm_lock_sanlock(struct lockspace *ls, struct resource *r, int ld_mode,
                    struct val_blk *vb_out, int *retry, int adopt) {
  return -1;
}


x86 assembly (clang, -O0):
<lm_lock_sanlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.lockspace = type opaque
%struct.resource = type opaque
%struct.val_blk = type opaque
define i32 @lm_lock_sanlock(%struct.lockspace* %0, %struct.resource* %1, i32 %2, %struct.val_blk* %3, i32* %4, i32 %5) {
%7 = alloca %struct.lockspace*
%8 = alloca %struct.resource*
%9 = alloca i32
%10 = alloca %struct.val_blk*
%11 = alloca i32*
%12 = alloca i32
store %struct.lockspace* %0, %struct.lockspace** %7
store %struct.resource* %1, %struct.resource** %8
store i32 %2, i32* %9
store %struct.val_blk* %3, %struct.val_blk** %10
store i32* %4, i32** %11
store i32 %5, i32* %12
ret i32 -1
}

LLVM IR (-O2):
%struct.lockspace = type opaque
%struct.resource = type opaque
%struct.val_blk = type opaque
define i32 @lm_lock_sanlock(%struct.lockspace* nocapture readnone %0, %struct.resource* nocapture readnone %1, i32 %2, %struct.val_blk* nocapture readnone %3, i32* nocapture readnone %4, i32 %5) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, char *);
int main(void) {
  char sa[] = "hello";
  char sb[] = "world";
  print(sa, sb);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xedc(%rip),%ax
mov    %ax,-0x2(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x8(%rbp)
lea    -0x6(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movw   $0x6f,0x14(%rsp)
movl   $0x6c6c6568,0x10(%rsp)
6c
movw   $0x64,0xc(%rsp)
movl   $0x6c726f77,0x8(%rsp)
6c
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.sa = [6 x i8] c"hello\00"
@__const.main.sb = [6 x i8] c"world\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [6 x i8]
%3 = bitcast [6 x i8]* %1 to i8*
%4 = bitcast [6 x i8]* %2 to i8*
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call i32 @print(i8* %5, i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.sa = [6 x i8] c"hello\00"
@__const.main.sb = [6 x i8] c"world\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @print(i8* %3, i8* %4)
ret i32 0
}
_Bool sb_check_cb(char *issue, void *context __attribute__((unused))) {
  printf("\t%s\n", issue);
  free(issue);
  return 1;
}


x86 assembly (clang, -O0):
<sb_check_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb_check_cb>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x1,%al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\09%s\0A\00"
define zeroext i1 @sb_check_cb(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
ret i1 true
}

LLVM IR (-O2):
@.str = [5 x i8] c"\09%s\0A\00"
define zeroext i1 @sb_check_cb(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
tail call void @free(i8* %0)
ret i1 true
}
int test_si(int a, int b) { return (a << 5) | ((unsigned int)b >> 27); }


x86 assembly (clang, -O0):
<test_si>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%ecx
shr    $0x1b,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_si>:
mov    %edi,%eax
shld   $0x5,%esi,%eax
ret

LLVM IR (-O0):
define i32 @test_si(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 = shl i32 %5, 5
%7 = load i32, i32* %4
%8 = lshr i32 %7, 27
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_si(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %1, i32 5)
ret i32 %3
}
pad(s, len) char *s;
int len;
{
  while (strlen(s) < len) {
    strcat(s, "          ");
    s[len] = 0;
  }
}


x86 assembly (clang, -O0):
<pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
jae    1166 <pad+0x46>
mov    -0x10(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    112f <pad+0xf>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
movslq %esi,%r14
call   1030 <strlen@plt>
cmp    %r14,%rax
jae    1156 <pad+0x46>
movabs $0x2020202020202020,%r15
20 20 20
nop
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r15,(%rbx,%rax,1)
movl   $0x202020,0x7(%rbx,%rax,1)
movb   $0x0,(%rbx,%r14,1)
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %r14,%rax
jb     1130 <pad+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c" \00"
define i32 @pad(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
br label %6
6: ; preds = %12, %2
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = icmp ult i64 %8, %10
br i1 %11, label %12, label %19
12: ; preds = %6
%13 = load i8*, i8** %4
%14 = call i8* @strcat(i8* %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
br label %6
19: ; preds = %6
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [11 x i8] c" \00"
define i32 @pad(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp ult i64 %4, %3
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 %3
br label %8
8: ; preds = %6, %8
%9 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%10 = getelementptr i8, i8* %0, i64 %9
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(11) %10, i8* align 1 dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 11, i1 false)
store i8 0, i8* %7
%11 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%12 = icmp ult i64 %11, %3
br i1 %12, label %8, label %13
13: ; preds = %8, %2
ret i32 undef
}
void XmbTextExtents() {}


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

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

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

LLVM IR (-O2):
define void @XmbTextExtents() {
ret void
}
int SIDE_TAG(int sd) { return 8 + (sd << 3); }


x86 assembly (clang, -O0):
<SIDE_TAG>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIDE_TAG>:
lea    0x8(,%rdi,8),%eax
ret

LLVM IR (-O0):
define i32 @SIDE_TAG(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 3
%5 = add nsw i32 8, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @SIDE_TAG(i32 %0) {
%2 = shl i32 %0, 3
%3 = add nsw i32 %2, 8
ret i32 %3
}
void ff_hevc_put_hevc_bi_qpel_v32_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_v32_10_avx2() {
ret void
}