xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ DrawBlock(int, int, int, int, char);
void DrawRecommend(int y, int x, int blockID, int blockRotate) {
  DrawBlock(y, x, blockID, blockRotate, 'R');
}


x86 assembly (clang, -O0):
<DrawRecommend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x52,%r8d
call   1030 <DrawBlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawRecommend>:
mov    $0x52,%r8d
jmp    1030 <DrawBlock@plt>

LLVM IR (-O0):
define void @DrawRecommend(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 @DrawBlock(i32 %9, i32 %10, i32 %11, i32 %12, i8 signext 82)
ret void
}

LLVM IR (-O2):
define void @DrawRecommend(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @DrawBlock(i32 %0, i32 %1, i32 %2, i32 %3, i8 signext 82)
ret void
}
int examPassed(unsigned numericGrade) {
  int result, isValidGrade = 0;
  if (numericGrade >= 1 && numericGrade <= 6) {
    isValidGrade = 1;
  } else {
    isValidGrade = 0;
  }
  if (isValidGrade) {
    if (numericGrade <= 4) {
      result = 1;
    } else {
      result = 0;
    }
  } else {
    result = -1;
  }
  return result;
}


x86 assembly (clang, -O0):
<examPassed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x4(%rbp)
jb     112e <examPassed+0x2e>
cmpl   $0x6,-0x4(%rbp)
ja     112e <examPassed+0x2e>
movl   $0x1,-0xc(%rbp)
jmp    1135 <examPassed+0x35>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1161 <examPassed+0x61>
cmpl   $0x4,-0x4(%rbp)
ja     1155 <examPassed+0x55>
movl   $0x1,-0x8(%rbp)
jmp    115c <examPassed+0x5c>
movl   $0x0,-0x8(%rbp)
jmp    1168 <examPassed+0x68>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<examPassed>:
lea    -0x1(%rdi),%eax
xor    %ecx,%ecx
cmp    $0x5,%edi
setb   %cl
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @examPassed(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 6
%4 = icmp ult i32 %0, 5
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 %5, i32 -1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int status();
int main(void) {
  printf("Hello, world.\n");
  return status();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <status@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @status()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ smp_test_semget();
void smp_test_sem_main() {
  smp_test_semget();
  printf("finished test\n");
}


x86 assembly (clang, -O0):
<smp_test_sem_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <smp_test_semget@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<smp_test_sem_main>:
push   %rax
xor    %eax,%eax
call   1040 <smp_test_semget@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"finished test\0A\00"
define void @smp_test_sem_main() {
%1 = call i32 (...) @smp_test_semget()
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"finished test\00"
define void @smp_test_sem_main() {
%1 = tail call i32 (...) @smp_test_semget()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void lcd_goto_position(uint8_t row, uint8_t col) {
  printf("%s:%d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/"
         "mock/lcd.c",
         7);
}


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

x86 assembly (clang, -O2):
<lcd_goto_position>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x7,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/lcd.c\00"
define void @lcd_goto_position(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 7)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/lcd.c\00"
define void @lcd_goto_position(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UARTprintf(char *);
void IntDefaultHandler(void) {
  UARTprintf("Default interrupt handler called\r\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<IntDefaultHandler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <UARTprintf@plt>
jmp    1120 <IntDefaultHandler+0x10>

x86 assembly (clang, -O2):
<IntDefaultHandler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <UARTprintf@plt>
nopl   (%rax)
jmp    1120 <IntDefaultHandler+0x10>

LLVM IR (-O0):
@.str = [35 x i8] c"Default interrupt handler called\0D\0A\00"
define void @IntDefaultHandler() {
%1 = call i32 @UARTprintf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [35 x i8] c"Default interrupt handler called\0D\0A\00"
define void @IntDefaultHandler() {
%1 = tail call i32 @UARTprintf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
double g_He(t)
double t;
{
  if (t == 0.0) {
    return 0.0;
  }
  return 2.38e-11 * sqrt(t) * exp(-285335.4 / t) / (1.0 + sqrt(t / 1e5));
}


x86 assembly (clang, -O0):
<g_He>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1152 <g_He+0x32>
jp     1152 <g_He+0x32>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11c6 <g_He+0xa6>
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe98(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe68(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movsd  0xe47(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_He>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1131 <g_He+0x11>
jp     1131 <g_He+0x11>
movapd %xmm1,%xmm0
ret
sub    $0x18,%rsp
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
jb     114b <g_He+0x2b>
sqrtsd %xmm0,%xmm0
jmp    1150 <g_He+0x30>
call   1040 <sqrt@plt>
mulsd  0xea8(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xea2(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
call   1030 <exp@plt>
movapd %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm1
divsd  0xe87(%rip),%xmm0
ucomisd 0xe8f(%rip),%xmm0
jb     1199 <g_He+0x79>
sqrtsd %xmm0,%xmm0
jmp    11aa <g_He+0x8a>
movsd  %xmm1,0x8(%rsp)
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
addsd  0xe66(%rip),%xmm0
divsd  %xmm0,%xmm1
add    $0x18,%rsp
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @g_He(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %20
7: ; preds = %1
%8 = load double, double* %3
%9 = call double @sqrt(double %8)
%10 = fmul double 2.380000e-11, %9
%11 = load double, double* %3
%12 = fdiv double 0xC1116A5D9999999A, %11
%13 = call double @exp(double %12)
%14 = fmul double %10, %13
%15 = load double, double* %3
%16 = fdiv double %15, 1.000000e+05
%17 = call double @sqrt(double %16)
%18 = fadd double 1.000000e+00, %17
%19 = fdiv double %14, %18
store double %19, double* %2
br label %20
20: ; preds = %7, %6
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @g_He(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = tail call double @sqrt(double %0)
%5 = fmul double %4, 2.380000e-11
%6 = fdiv double 0xC1116A5D9999999A, %0
%7 = tail call double @exp(double %6)
%8 = fmul double %5, %7
%9 = fdiv double %0, 1.000000e+05
%10 = tail call double @sqrt(double %9)
%11 = fadd double %10, 1.000000e+00
%12 = fdiv double %8, %11
br label %13
13: ; preds = %1, %3
%14 = phi double [ %12, %3 ], [ 0.000000e+00, %1 ]
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ doupdate();
int /*<<< orphan*/ update_panels();
void pflush(void) {
  update_panels();
  doupdate();
}


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

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

LLVM IR (-O0):
define void @pflush() {
%1 = call i32 (...) @update_panels()
%2 = call i32 (...) @doupdate()
ret void
}

LLVM IR (-O2):
define void @pflush() {
%1 = tail call i32 (...) @update_panels()
%2 = tail call i32 (...) @doupdate()
ret void
}
/* Variables and functions */
long double __lgamma(double);
long double __q_lgamma(long double *arg) { return (__lgamma((double)(*arg))); }


x86 assembly (clang, -O0):
<__q_lgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fstpl  -0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <__lgamma@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__q_lgamma>:
fldt   (%rdi)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <__lgamma@plt>

LLVM IR (-O0):
define x86_fp80 @__q_lgamma(x86_fp80* %0) {
%2 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %2
%3 = load x86_fp80*, x86_fp80** %2
%4 = load x86_fp80, x86_fp80* %3
%5 = fptrunc x86_fp80 %4 to double
%6 = call x86_fp80 @__lgamma(double %5)
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @__q_lgamma(x86_fp80* nocapture %0) {
%2 = load x86_fp80, x86_fp80* %0
%3 = fptrunc x86_fp80 %2 to double
%4 = tail call x86_fp80 @__lgamma(double %3)
ret x86_fp80 %4
}
void d2i_PKCS7_ISSUER_AND_SERIAL(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_PKCS7_ISSUER_AND_SERIAL() {
ret void
}
void busy_wait(void) {
  volatile int i = 10000;
  while (i)
    i--;
}


x86 assembly (clang, -O0):
<busy_wait>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2710,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1125 <busy_wait+0x25>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <busy_wait+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<busy_wait>:
movl   $0x2710,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
je     111c <busy_wait+0x1c>
nop
addl   $0xffffffff,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
jne    1110 <busy_wait+0x10>
ret

LLVM IR (-O0):
define void @busy_wait() {
%1 = alloca i32
store volatile i32 10000, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load volatile i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load volatile i32, i32* %1
%7 = add nsw i32 %6, -1
store volatile i32 %7, i32* %1
br label %2
8: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @busy_wait() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 10000, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0, %5
%6 = load volatile i32, i32* %1
%7 = add nsw i32 %6, -1
store volatile i32 %7, i32* %1
%8 = load volatile i32, i32* %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %0
ret void
}
int ft_isxdigit(int c) {
  return (('0' <= c && c <= '9') || ('a' <= c && c <= 'f') ||
          ('A' <= c && c <= 'F'));
}


x86 assembly (clang, -O0):
<ft_isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x30,%eax
cmp    -0x4(%rbp),%eax
jg     1124 <ft_isxdigit+0x24>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1164 <ft_isxdigit+0x64>
mov    $0x61,%eax
cmp    -0x4(%rbp),%eax
jg     1141 <ft_isxdigit+0x41>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1164 <ft_isxdigit+0x64>
xor    %eax,%eax
mov    $0x41,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x6(%rbp)
jg     115e <ft_isxdigit+0x5e>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ft_isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 48, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sle i32 97, %9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 102
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sle i32 65, %15
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 70
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @ft_isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_init(pthread_attr_t *__attr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_attr_init(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
double Eval(int);
int /*<<< orphan*/ printf(char *, double);
main() {
  printf("%f\n", Eval(10));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <Eval@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call double @Eval(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
int test_imm_71int16_reg(short val) {
  return ((val) & (0x71 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_71int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x71,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_71int16_reg>:
test   $0x71,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_71int16_reg(i16 signext %0) {
%2 = and i16 %0, 113
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void empty() { printf("Test Empty"); }


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

x86 assembly (clang, -O2):
<empty>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Test Empty\00"
define void @empty() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Test Empty\00"
define void @empty() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delete ();
int getch();
int insertch(int);
int replace(void) {
  int c = getch();
  if (c < 0 || c > 255)
    return 1;
  if (!delete ())
    return insertch(c);
  return 0;
}


x86 assembly (clang, -O0):
<replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1159 <replace+0x29>
cmpl   $0xff,-0x8(%rbp)
jle    1165 <replace+0x35>
movl   $0x1,-0x4(%rbp)
jmp    118c <replace+0x5c>
mov    $0x0,%al
call   1050 <delete@plt>
cmp    $0x0,%eax
jne    1185 <replace+0x55>
mov    -0x8(%rbp),%edi
call   1030 <insertch@plt>
mov    %eax,-0x4(%rbp)
jmp    118c <replace+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace>:
push   %rbx
xor    %eax,%eax
call   1040 <getch@plt>
mov    %eax,%ebx
mov    $0x1,%eax
cmp    $0xff,%ebx
ja     1159 <replace+0x29>
xor    %eax,%eax
call   1050 <delete@plt>
mov    %eax,%ecx
mov    $0x0,%eax
test   %ecx,%ecx
je     115b <replace+0x2b>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <insertch@plt>

LLVM IR (-O0):
define i32 @replace() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getch()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 255
br i1 %8, label %9, label %10
9: ; preds = %6, %0
store i32 1, i32* %1
br label %17
10: ; preds = %6
%11 = call i32 (...) @delete()
%12 = icmp ne i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %2
%15 = call i32 @insertch(i32 %14)
store i32 %15, i32* %1
br label %17
16: ; preds = %10
store i32 0, i32* %1
br label %17
17: ; preds = %16, %13, %9
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @replace() {
%1 = tail call i32 (...) @getch()
%2 = icmp ugt i32 %1, 255
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 (...) @delete()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @insertch(i32 %1)
br label %8
8: ; preds = %3, %0, %6
%9 = phi i32 [ %7, %6 ], [ 1, %0 ], [ 0, %3 ]
ret i32 %9
}
__typeof__(memset(1, 1, (void *)1)) test_memset_127(void) {
  return memset(1, 1, (void *)1);
}


x86 assembly (clang, -O0):
<test_memset_127>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    $0x1,%esi
mov    %rdx,%rdi
call   1030 <memset@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_memset_127>:
movb   $0x1,0x1
01
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i8* @test_memset_127() {
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
define i8* @test_memset_127() {
store i8 1, i8* inttoptr (i64 1 to i8*)
ret i8* inttoptr (i64 1 to i8*)
}
int roi_set_sensor(char *buff, unsigned char packet_id) {
  buff[0] = (142);
  buff[1] = packet_id;
  return 2;
}


x86 assembly (clang, -O0):
<roi_set_sensor>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x8e,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roi_set_sensor>:
movb   $0x8e,(%rdi)
mov    %sil,0x1(%rdi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @roi_set_sensor(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 -114, i8* %6
%7 = load i8, i8* %4
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %7, i8* %9
ret i32 2
}

LLVM IR (-O2):
define i32 @roi_set_sensor(i8* nocapture writeonly %0, i8 zeroext %1) {
store i8 -114, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %1, i8* %3
ret i32 2
}
int WTRACK_fxtext_track_width(const int fontwidth) {
  return (3 * fontwidth) + 2;
}


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

x86 assembly (clang, -O2):
<WTRACK_fxtext_track_width>:
lea    (%rdi,%rdi,2),%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @WTRACK_fxtext_track_width(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void usage(char *av0, int exvalue) {
  fprintf(stderr,
          "Usage: %s [-n <n>]\n"
          " -n number of threads in pool, default %d\n",
          av0, 1);
  exit(exvalue);
}


x86 assembly (clang, -O0):
<usage>:
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
lea    0xebd(%rip),%rsi
mov    $0x1,%ecx
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
mov    $0x1,%ecx
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [62 x i8] c"Usage: %s [-n <n>]\0A -n number of threads in pool, default %d\0A\00"
define void @usage(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 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %6, i32 1)
%8 = load i32, i32* %4
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [62 x i8] c"Usage: %s [-n <n>]\0A -n number of threads in pool, default %d\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
int lockd_init_lv_args(struct cmd_context *cmd, struct volume_group *vg,
                       struct logical_volume *lv, const char *lock_type,
                       const char **lock_args) {
  return 1;
}


x86 assembly (clang, -O0):
<lockd_init_lv_args>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cmd_context = type opaque
%struct.volume_group = type opaque
%struct.logical_volume = type opaque
define i32 @lockd_init_lv_args(%struct.cmd_context* %0, %struct.volume_group* %1, %struct.logical_volume* %2, i8* %3, i8** %4) {
%6 = alloca %struct.cmd_context*
%7 = alloca %struct.volume_group*
%8 = alloca %struct.logical_volume*
%9 = alloca i8*
%10 = alloca i8**
store %struct.cmd_context* %0, %struct.cmd_context** %6
store %struct.volume_group* %1, %struct.volume_group** %7
store %struct.logical_volume* %2, %struct.logical_volume** %8
store i8* %3, i8** %9
store i8** %4, i8*** %10
ret i32 1
}

LLVM IR (-O2):
%struct.cmd_context = type opaque
%struct.volume_group = type opaque
%struct.logical_volume = type opaque
define i32 @lockd_init_lv_args(%struct.cmd_context* nocapture readnone %0, %struct.volume_group* nocapture readnone %1, %struct.logical_volume* nocapture readnone %2, i8* nocapture readnone %3, i8** nocapture readnone %4) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ error();
void foo(int x, int y) {
  if (x != y) {
    if (2 * x == x + 10)
      error();
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     114a <foo+0x3a>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
add    $0xa,%ecx
cmp    %ecx,%eax
jne    1145 <foo+0x35>
mov    $0x0,%al
call   1030 <error@plt>
jmp    114a <foo+0x3a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    %esi,%edi
je     1125 <foo+0x15>
lea    (%rdi,%rdi,1),%eax
add    $0xa,%edi
cmp    %edi,%eax
jne    1125 <foo+0x15>
xor    %eax,%eax
jmp    1030 <error@plt>
ret

LLVM IR (-O0):
define void @foo(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 = icmp ne i32 %5, %6
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i32, i32* %3
%10 = mul nsw i32 2, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 10
%13 = icmp eq i32 %10, %12
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = call i32 (...) @error()
br label %16
16: ; preds = %14, %8
br label %17
17: ; preds = %16, %2
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = shl nsw i32 %0, 1
%6 = add nsw i32 %0, 10
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 (...) @error()
br label %10
10: ; preds = %4, %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_set_source_mute_by_name() {
  printf("NOT IMPLEMENTED:"
         "pa_context_set_source_mute_by_name"
         "\n");
}


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

x86 assembly (clang, -O2):
<pa_context_set_source_mute_by_name>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [51 x i8] c"NOT IMPLEMENTED:pa_context_set_source_mute_by_name\00"
define i32 @pa_context_set_source_mute_by_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int __builtin_mips_cabs_seq_d(double, double);
int test10(double a, double b) { return __builtin_mips_cabs_seq_d(a, b); }


x86 assembly (clang, -O0):
<test10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__builtin_mips_cabs_seq_d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test10>:
jmp    1030 <__builtin_mips_cabs_seq_d@plt>

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

LLVM IR (-O2):
define i32 @test10(double %0, double %1) {
%3 = tail call i32 @__builtin_mips_cabs_seq_d(double %0, double %1)
ret i32 %3
}
unsigned assign_bit_TXBRK(unsigned reg_value, int set) {
  return (reg_value & ~0x400) | (set ? 0x400 : 0);
}


x86 assembly (clang, -O0):
<assign_bit_TXBRK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffbff,%eax
mov    -0x8(%rbp),%esi
xor    %ecx,%ecx
mov    $0x400,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_bit_TXBRK>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
and    $0xfffffbff,%edi
shl    $0xa,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @assign_bit_TXBRK(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 = and i32 %5, -1025
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1024, i32 0
%11 = or i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @assign_bit_TXBRK(i32 %0, i32 %1) {
%3 = and i32 %0, -1025
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 0, i32 1024
%6 = or i32 %5, %3
ret i32 %6
}
void set_capabilities(void) {}


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

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

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

LLVM IR (-O2):
define void @set_capabilities() {
ret void
}
int test_imm_9Cuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x9C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Cuint64_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, 156
%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_9Cuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10223616
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int check_prime(int num) {
  int i;
  for (i = 2; i < num; i++) {
    if (num % i == 0) {
      num = 1;
      goto end;
    }
  }
end:
  return num;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1149 <check_prime+0x49>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1136 <check_prime+0x36>
movl   $0x1,-0x4(%rbp)
jmp    114e <check_prime+0x4e>
jmp    113b <check_prime+0x3b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <check_prime+0xe>
jmp    114e <check_prime+0x4e>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
cmp    $0x3,%edi
jl     1120 <check_prime+0x20>
mov    $0x2,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1123 <check_prime+0x23>
add    $0x1,%ecx
cmp    %ecx,%edi
jne    1110 <check_prime+0x10>
mov    %edi,%eax
ret
mov    $0x1,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %3, %5, %1
%11 = phi i32 [ %0, %1 ], [ 1, %5 ], [ %0, %3 ]
ret i32 %11
}
int main(void) {
  volatile unsigned long long a = 0x1000000000000ULL;
  volatile unsigned long long b = 0xffffffffffffffffULL;
  unsigned __int128 c = (((unsigned __int128)a) << 64) | b;
  __float128 d = c;
  if (d != 0x1.000000000000ffffffffffffffffp112q)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x1000000000000,%rax
mov    %rax,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1190 <__floatuntitf>
movaps %xmm0,-0x40(%rbp)
movaps -0x40(%rbp),%xmm0
movaps 0xe8f(%rip),%xmm1
call   1480 <__eqtf2>
test   %eax,%eax
je     1188 <main+0x68>
jmp    1183 <main+0x63>
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>
nop

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x1000000000000,%rax
mov    %rax,0x10(%rsp)
movq   $0xffffffffffffffff,0x8(%rsp)
ff ff
xor    0x10(%rsp),%rax
mov    0x8(%rsp),%rcx
not    %rcx
or     %rax,%rcx
jne    1155 <main+0x35>
xor    %edi,%edi
call   1040 <exit@plt>
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i128
%5 = alloca fp128
store i32 0, i32* %1
store volatile i64 281474976710656, i64* %2
store volatile i64 -1, i64* %3
%6 = load volatile i64, i64* %2
%7 = zext i64 %6 to i128
%8 = shl i128 %7, 64
%9 = load volatile i64, i64* %3
%10 = zext i64 %9 to i128
%11 = or i128 %8, %10
store i128 %11, i128* %4
%12 = load i128, i128* %4
%13 = uitofp i128 %12 to fp128
store fp128 %13, fp128* %5
%14 = load fp128, fp128* %5
%15 = fcmp une fp128 %14, 0xLFFFFFFFFFFFFFFFF406F000000000000
br i1 %15, label %16, label %17
16: ; preds = %0
unreachable
17: ; preds = %0
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store volatile i64 281474976710656, i64* %1
%4 = bitcast i64* %2 to i8*
store volatile i64 -1, i64* %2
%5 = load volatile i64, i64* %1
%6 = zext i64 %5 to i128
%7 = shl nuw i128 %6, 64
%8 = load volatile i64, i64* %2
%9 = zext i64 %8 to i128
%10 = or i128 %7, %9
%11 = icmp eq i128 %10, 5192296858534846075274570038771711
br i1 %11, label %13, label %12
12: ; preds = %0
tail call void @abort()
unreachable
13: ; preds = %0
tail call void @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *message) {
  char *red_color = "\x1b[31;1m";
  char *reset_color = "\x1b[0m";
  fprintf(stderr, "Ella Error: %s%s%s\n", red_color, message, reset_color);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xeea(%rip),%rsi
lea    0xed6(%rip),%rdx
lea    0xed7(%rip),%r8
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[31;1m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
@stderr = global i32 0
@.str.2 = [20 x i8] c"Ella Error: %s%s%s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = load i8*, i8** %4
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[31;1m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
@stderr = global i32 0
@.str.2 = [20 x i8] c"Ella Error: %s%s%s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef scalar_t__ u_int;
typedef int /*<<< orphan*/ bool_t;
struct TYPE_3__ {
  int /*<<< orphan*/ x_handy;
};
typedef TYPE_1__ XDR;

/* Variables and functions */
int /*<<< orphan*/ TRUE;
bool_t x_putbytes(XDR *xdrs, const char *bp, u_int len) {
  xdrs->x_handy += len;
  return TRUE;
}


x86 assembly (clang, -O0):
<x_putbytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
add    %rdx,%rcx
mov    %ecx,(%rax)
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_putbytes>:
add    %edx,(%rdi)
mov    0x2edf(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@TRUE = global i32 0
define i32 @x_putbytes(%struct.TYPE_3__* %0, i8* %1, i64 %2) {
%4 = alloca %struct.TYPE_3__*
%5 = alloca i8*
%6 = alloca i64
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %7
%13 = trunc i64 %12 to i32
store i32 %13, i32* %9
%14 = load i32, i32* @TRUE
ret i32 %14
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@TRUE = global i32 0
define i32 @x_putbytes(%struct.TYPE_3__* nocapture %0, i8* nocapture readnone %1, i64 %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = trunc i64 %2 to i32
%7 = add i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* @TRUE
ret i32 %8
}
int main() {
  extern struct X x;
  return &x != 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.X = type opaque
@x = external global %struct.X
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ panic(char *);
void *allot(size_t size) {
  void *result = malloc(size);
  if (NULL == result && 0 != size)
    panic("Out of memory");
  return result;
}


x86 assembly (clang, -O0):
<allot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    115d <allot+0x3d>
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     115d <allot+0x3d>
lea    0xea8(%rip),%rdi
call   1030 <panic@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allot>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <allot+0x25>
test   %r14,%r14
jne    1145 <allot+0x25>
lea    0xec0(%rip),%rdi
call   1030 <panic@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @allot(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* null, %6
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ne i64 0, %9
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @panic(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @allot(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @panic(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %2
}
void RTAvlroGCPtrRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroGCPtrRemove() {
ret void
}
int getGbLenOfUniStr(const unsigned short *p) {
  int len = 0;
  while (*p) {
    if (*p < 0x80) {
      len += 1;
    } else {
      len += 2;
    }
    p++;
  }
  return len;
}


x86 assembly (clang, -O0):
<getGbLenOfUniStr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpw   $0x0,(%rax)
je     1157 <getGbLenOfUniStr+0x57>
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
cmp    $0x80,%eax
jge    113d <getGbLenOfUniStr+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <getGbLenOfUniStr+0x46>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <getGbLenOfUniStr+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getGbLenOfUniStr>:
movzwl (%rdi),%ecx
test   %cx,%cx
je     112c <getGbLenOfUniStr+0x2c>
add    $0x2,%rdi
xor    %eax,%eax
xchg   %ax,%ax
movzwl %cx,%ecx
cmp    $0x80,%ecx
sbb    $0x0,%eax
add    $0x2,%eax
movzwl (%rdi),%ecx
add    $0x2,%rdi
test   %cx,%cx
jne    1110 <getGbLenOfUniStr+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @getGbLenOfUniStr(i16* %0) {
%2 = alloca i16*
%3 = alloca i32
store i16* %0, i16** %2
store i32 0, i32* %3
br label %4
4: ; preds = %19, %1
%5 = load i16*, i16** %2
%6 = load i16, i16* %5
%7 = icmp ne i16 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %4
%9 = load i16*, i16** %2
%10 = load i16, i16* %9
%11 = zext i16 %10 to i32
%12 = icmp slt i32 %11, 128
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %19
16: ; preds = %8
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 2
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %13
%20 = load i16*, i16** %2
%21 = getelementptr inbounds i16, i16* %20, i32 1
store i16* %21, i16** %2
br label %4
22: ; preds = %4
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @getGbLenOfUniStr(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp eq i16 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i16 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i16* [ %11, %4 ], [ %0, %1 ]
%8 = icmp ult i16 %5, 128
%9 = select i1 %8, i32 1, i32 2
%10 = add nuw nsw i32 %9, %6
%11 = getelementptr inbounds i16, i16* %7, i64 1
%12 = load i16, i16* %11
%13 = icmp eq i16 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
float _LittleFloat(float);
float LittleFloat(float l) { return _LittleFloat(l); }


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

x86 assembly (clang, -O2):
<LittleFloat>:
jmp    1030 <_LittleFloat@plt>

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

LLVM IR (-O2):
define float @LittleFloat(float %0) {
%2 = tail call float @_LittleFloat(float %0)
ret float %2
}