xunge/DecIR huggingface dataset:
int xmlUCSIsYijingHexagramSymbols(int code) {
  return (((code >= 0x4DC0) && (code <= 0x4DFF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsYijingHexagramSymbols>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x4dc0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsYijingHexagramSymbols+0x26>
cmpl   $0x4dff,-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):
<xmlUCSIsYijingHexagramSymbols>:
and    $0xffffffc0,%edi
xor    %eax,%eax
cmp    $0x4dc0,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsYijingHexagramSymbols(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 19904
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 19967
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 @xmlUCSIsYijingHexagramSymbols(i32 %0) {
%2 = and i32 %0, -64
%3 = icmp eq i32 %2, 19904
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int f(int number) {
  if (number == 1)
    return 1;
  if (number > 1) {
    printf("\ni %d %d", number, f(number - 1));
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <f+0x21>
movl   $0x1,-0x4(%rbp)
jmp    116d <f+0x4d>
cmpl   $0x1,-0x8(%rbp)
jle    116d <f+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x1,%edi
jle    1144 <f+0x24>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <f@plt>
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1040 <printf@plt>
pop    %rbx
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"\0Ai %d %d\00"
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %4, label %3
3: ; preds = %1, %4
ret i32 1
4: ; preds = %1
%5 = add nsw i32 %0, -1
%6 = tail call i32 @f(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 1)
br label %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int leeMemoria(uint8_t opCode) {
  switch (opCode) {
  case 0x02:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<leeMemoria>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
jne    1124 <leeMemoria+0x24>
jmp    1118 <leeMemoria+0x18>
movl   $0x1,-0x4(%rbp)
jmp    112b <leeMemoria+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leeMemoria>:
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @leeMemoria(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dsb();
int /*<<< orphan*/ reg_dummy_read();
void mt_reg_sync_writew(unsigned short v, unsigned int a) {
  *(volatile unsigned short *)(a) = (v);
  dsb();
  reg_dummy_read();
}


x86 assembly (clang, -O0):
<mt_reg_sync_writew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x8(%rbp),%eax
mov    %cx,(%rax)
mov    $0x0,%al
call   1040 <dsb@plt>
mov    $0x0,%al
call   1030 <reg_dummy_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_reg_sync_writew>:
push   %rax
mov    %esi,%eax
mov    %di,(%rax)
xor    %eax,%eax
call   1040 <dsb@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <reg_dummy_read@plt>

LLVM IR (-O0):
define void @mt_reg_sync_writew(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i16*
store volatile i16 %5, i16* %8
%9 = call i32 (...) @dsb()
%10 = call i32 (...) @reg_dummy_read()
ret void
}

LLVM IR (-O2):
define void @mt_reg_sync_writew(i16 zeroext %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = inttoptr i64 %3 to i16*
store volatile i16 %0, i16* %4
%5 = tail call i32 (...) @dsb()
%6 = tail call i32 (...) @reg_dummy_read()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int ff_rate_control_init(void *s, int old_bitrate) { exit(1); }


x86 assembly (clang, -O0):
<ff_rate_control_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<ff_rate_control_init>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @ff_rate_control_init(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @ff_rate_control_init(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ scanf(char *, char *);
char *le_linha(void) {
  char *s;
  s = (char *)malloc(121 * sizeof(char));
  scanf(" %120[^\n]", s);
  return s;
}


x86 assembly (clang, -O0):
<le_linha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x79,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_linha>:
push   %rbx
mov    $0x79,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdi
mov    %rax,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c" %120[^\0A]\00"
define i8* @le_linha() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 121)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %1
ret i8* %6
}

LLVM IR (-O2):
@.str = [10 x i8] c" %120[^\0A]\00"
define i8* @le_linha() {
%1 = tail call i64 @malloc(i32 121)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Q_init();
void Q_clear() { Q_init(); }


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

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

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

LLVM IR (-O2):
define void @Q_clear() {
%1 = tail call i32 (...) @Q_init()
ret void
}
int sameSign(double x, double y) {
  return (x > 0 && y > 0) || (x < 0 && y < 0);
}


x86 assembly (clang, -O0):
<sameSign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1137 <sameSign+0x37>
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
ja     115e <sameSign+0x5e>
xor    %eax,%eax
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x12(%rbp)
jbe    1158 <sameSign+0x58>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sameSign>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
seta   %al
ucomisd %xmm2,%xmm1
seta   %cl
and    %al,%cl
ucomisd %xmm0,%xmm2
seta   %al
ucomisd %xmm1,%xmm2
seta   %dl
and    %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @sameSign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp ogt double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load double, double* %4
%9 = fcmp ogt double %8, 0.000000e+00
br i1 %9, label %18, label %10
10: ; preds = %7, %2
%11 = load double, double* %3
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load double, double* %4
%15 = fcmp olt double %14, 0.000000e+00
br label %16
16: ; preds = %13, %10
%17 = phi i1 [ false, %10 ], [ %15, %13 ]
br label %18
18: ; preds = %16, %7
%19 = phi i1 [ true, %7 ], [ %17, %16 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @sameSign(double %0, double %1) {
%3 = fcmp ogt double %0, 0.000000e+00
%4 = fcmp ogt double %1, 0.000000e+00
%5 = and i1 %3, %4
%6 = fcmp olt double %0, 0.000000e+00
%7 = fcmp olt double %1, 0.000000e+00
%8 = and i1 %6, %7
%9 = or i1 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
void uninit_h2lib() {}


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

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

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

LLVM IR (-O2):
define void @uninit_h2lib() {
ret void
}
char *na(char *fname) {
  char *tc = strrchr(fname, '.');
  char *retc = calloc(3 + strlen(fname), sizeof(char));
  sprintf(retc, "%.*s_2%s", (int)(tc - fname), fname, tc);
  return retc;
}


x86 assembly (clang, -O0):
<na>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x3,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xe64(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<na>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x3(%rax),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%r15
mov    %r14d,%edx
sub    %ebx,%edx
lea    0xe86(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%.*s_2%s\00"
define i8* @na(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strrchr(i8* %5, i32 46)
store i8* %6, i8** %3
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = add i64 3, %8
%10 = call i8* @calloc(i64 %9, i64 1)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
%17 = trunc i64 %16 to i32
%18 = load i8*, i8** %2
%19 = load i8*, i8** %3
%20 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %17, i8* %18, i8* %19)
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
@.str = [9 x i8] c"%.*s_2%s\00"
define noalias i8* @na(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 46)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add i64 %3, 3
%5 = tail call i8* @calloc(i64 %4, i64 1)
%6 = ptrtoint i8* %2 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %0, i8* %2)
ret i8* %5
}
/* Variables and functions */
double pow(double const, double);
double exner_c(const double p0) {
  return pow((p0 / 100000.0), 0.2859561752988048);
}


x86 assembly (clang, -O0):
<exner_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeca(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exner_c>:
divsd  0xee8(%rip),%xmm0
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @exner_c(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+05
%5 = call double @pow(double %4, double 0x3FD24D1B213FD8D6)
ret double %5
}

LLVM IR (-O2):
define double @exner_c(double %0) {
%2 = fdiv double %0, 1.000000e+05
%3 = tail call double @pow(double %2, double 0x3FD24D1B213FD8D6)
ret double %3
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int __fxstatat(int, int, char const *, struct stat *, int);
int fstatat(int fd, const char *path, struct stat *buf, int flag) {
  return __fxstatat(1, fd, path, buf, flag);
}


x86 assembly (clang, -O0):
<fstatat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%edi
call   1030 <__fxstatat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstatat>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <__fxstatat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fstatat(i32 %0, i8* %1, %struct.stat* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.stat*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.stat* %2, %struct.stat** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load %struct.stat*, %struct.stat** %7
%12 = load i32, i32* %8
%13 = call i32 @__fxstatat(i32 1, i32 %9, i8* %10, %struct.stat* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fstatat(i32 %0, i8* %1, %struct.stat* %2, i32 %3) {
%5 = tail call i32 @__fxstatat(i32 1, i32 %0, i8* %1, %struct.stat* %2, i32 %3)
ret i32 %5
}
unsigned RSHash(char *str) {
  unsigned b = 378551;
  unsigned a = 63689;
  unsigned hash = 0;
  while (*str) {
    hash = hash * a + (*str++);
    a *= b;
  }
  return (hash & 0x7fffffff);
}


x86 assembly (clang, -O0):
<RSHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x5c6b7,-0xc(%rbp)
movl   $0xf8c9,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <RSHash+0x57>
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    111d <RSHash+0x1d>
mov    -0x14(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1141 <RSHash+0x41>
add    $0x1,%rdi
mov    $0xf8c9,%edx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%esi
imul   %edx,%esi
movsbl %cl,%eax
add    %esi,%eax
imul   $0x5c6b7,%edx,%edx
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <RSHash+0x20>
and    $0x7fffffff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @RSHash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 378551, i32* %3
store i32 63689, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %10, %1
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = mul i32 %11, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
%16 = load i8, i8* %14
%17 = sext i8 %16 to i32
%18 = add i32 %13, %17
store i32 %18, i32* %5
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = mul i32 %20, %19
store i32 %21, i32* %4
br label %6
22: ; preds = %6
%23 = load i32, i32* %5
%24 = and i32 %23, 2147483647
ret i32 %24
}

LLVM IR (-O2):
define i32 @RSHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i32 [ %13, %4 ], [ 63689, %1 ]
%8 = phi i8* [ %10, %4 ], [ %0, %1 ]
%9 = mul i32 %6, %7
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = sext i8 %5 to i32
%12 = add i32 %9, %11
%13 = mul i32 %7, 378551
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = and i32 %12, 2147483647
br label %18
18: ; preds = %16, %1
%19 = phi i32 [ 0, %1 ], [ %17, %16 ]
ret i32 %19
}
void XSetTextProperty() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @brkpoint() {
ret void
}
/* Variables and functions */
size_t ass_align(size_t alignment, size_t s) {
  if (s > ((size_t)-1) - (alignment - 1))
    return s;
  return (s + (alignment - 1)) & ~(alignment - 1);
}


x86 assembly (clang, -O0):
<ass_align>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
mov    $0xffffffffffffffff,%rcx
sub    %rdx,%rcx
cmp    %rcx,%rax
jbe    1138 <ass_align+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115a <ass_align+0x5a>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ass_align>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rdi
and    %rdi,%rax
cmp    %rsi,%rdi
cmovb  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @ass_align(i64 %0, i64 %1) {
%3 = sub i64 0, %0
%4 = icmp ult i64 %3, %1
%5 = add i64 %0, -1
%6 = add i64 %5, %1
%7 = and i64 %6, %3
%8 = select i1 %4, i64 %1, i64 %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void degistir(int *first, int *second, int *third) {
  int *x;
  x = second;
  second = first;
  first = third;
  third = x;
  printf("A = %d , B = %d , C = %d \n", *first, *second, *third);
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"A = %d , B = %d , C = %d \0A\00"
define void @degistir(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %5
store i32* %8, i32** %7
%9 = load i32*, i32** %4
store i32* %9, i32** %5
%10 = load i32*, i32** %6
store i32* %10, i32** %4
%11 = load i32*, i32** %7
store i32* %11, i32** %6
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
%16 = load i32*, i32** %6
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %15, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"A = %d , B = %d , C = %d \0A\00"
define void @degistir(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
long sys_epoll_wait(va_list ap) {
  assert(!"sys_epoll_wait not implemented");
  return 0;
}


x86 assembly (clang, -O0):
<sys_epoll_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"sys_epoll_wait not implemented\00"
define i64 @sys_epoll_wait(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @assert(i32 0)
ret i64 0
}

LLVM IR (-O2):
define i64 @sys_epoll_wait(i32 %0) {
%2 = tail call i32 @assert(i32 0)
ret i64 0
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/pippijn/cyclone/refs/heads/master/old/bin/"
        "cyc-lib/vc_cyc_include.h",
        259));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x103,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x103,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pippijn/cyclone/refs/heads/master/old/bin/cyc-lib/vc_cyc_include.h\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i32 259)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pippijn/cyclone/refs/heads/master/old/bin/cyc-lib/vc_cyc_include.h\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i32 259)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Type definitions */
struct vm_page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ get_current_proc();
struct vm_page *get_vm_page_proc(int /*<<< orphan*/, int);
struct vm_page *get_vm_page(int vpg) {
  return get_vm_page_proc(get_current_proc(), vpg);
}


x86 assembly (clang, -O0):
<get_vm_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_current_proc@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1030 <get_vm_page_proc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_vm_page>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <get_current_proc@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <get_vm_page_proc@plt>

LLVM IR (-O0):
%struct.vm_page = type { i32 }
define %struct.vm_page* @get_vm_page(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @get_current_proc()
%4 = load i32, i32* %2
%5 = call %struct.vm_page* @get_vm_page_proc(i32 %3, i32 %4)
ret %struct.vm_page* %5
}

LLVM IR (-O2):
%struct.vm_page = type { i32 }
define %struct.vm_page* @get_vm_page(i32 %0) {
%2 = tail call i32 (...) @get_current_proc()
%3 = tail call %struct.vm_page* @get_vm_page_proc(i32 %2, i32 %0)
ret %struct.vm_page* %3
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void EPIAddressMapSet(unsigned long ulBase, unsigned long ulMap) {
  DEBUG_ASSERT(ulBase == 0x400D0000);
  DEBUG_ASSERT(ulMap < 0x100);
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) = ulMap;
}


x86 assembly (clang, -O0):
<EPIAddressMapSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x400d0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x100,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x1c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIAddressMapSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x400d0000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x100,%r14
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,0x1c(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @EPIAddressMapSet(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 = icmp eq i64 %5, 1074593792
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = icmp ult i64 %9, 256
%11 = zext i1 %10 to i32
%12 = call i32 @DEBUG_ASSERT(i32 %11)
%13 = load i64, i64* %4
%14 = load i64, i64* %3
%15 = add i64 %14, 28
%16 = inttoptr i64 %15 to i64*
store volatile i64 %13, i64* %16
ret void
}

LLVM IR (-O2):
define void @EPIAddressMapSet(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074593792
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = icmp ult i64 %1, 256
%7 = zext i1 %6 to i32
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = add i64 %0, 28
%10 = inttoptr i64 %9 to i64*
store volatile i64 %1, i64* %10
ret void
}
/* Variables and functions */
int getchar();
__attribute__((always_)) int tu_getch(void) { return getchar(); }


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

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

LLVM IR (-O0):
define i32 @tu_getch() {
%1 = call i32 (...) @getchar()
ret i32 %1
}

LLVM IR (-O2):
define i32 @tu_getch() {
%1 = tail call i32 (...) @getchar()
ret i32 %1
}
void store64_bigendian(unsigned char *y, unsigned long long x) {
  long long i;
  for (i = 7; i >= 0; --i) {
    y[i] = x;
    x >>= 8;
  }
}


x86 assembly (clang, -O0):
<store64_bigendian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x7,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jl     114d <store64_bigendian+0x4d>
mov    -0x10(%rbp),%rax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <store64_bigendian+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<store64_bigendian>:
bswap  %rsi
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @store64_bigendian(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 7, i64* %5
br label %6
6: ; preds = %17, %2
%7 = load i64, i64* %5
%8 = icmp sge i64 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i64, i64* %4
%11 = trunc i64 %10 to i8
%12 = load i8*, i8** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8 %11, i8* %14
%15 = load i64, i64* %4
%16 = lshr i64 %15, 8
store i64 %16, i64* %4
br label %17
17: ; preds = %9
%18 = load i64, i64* %5
%19 = add nsw i64 %18, -1
store i64 %19, i64* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @store64_bigendian(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %3, i8* %4
%5 = lshr i64 %1, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %6, i8* %7
%8 = lshr i64 %1, 16
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %9, i8* %10
%11 = lshr i64 %1, 24
%12 = trunc i64 %11 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %12, i8* %13
%14 = lshr i64 %1, 32
%15 = trunc i64 %14 to i8
%16 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %15, i8* %16
%17 = lshr i64 %1, 40
%18 = trunc i64 %17 to i8
%19 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %18, i8* %19
%20 = lshr i64 %1, 48
%21 = trunc i64 %20 to i8
%22 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %21, i8* %22
%23 = lshr i64 %1, 56
%24 = trunc i64 %23 to i8
store i8 %24, i8* %0
ret void
}
int test_imm_70uint8_reg(unsigned char val) {
  return ((val) & (-0x70 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_70uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff90,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_70uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -112
%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_70uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -112
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int gob_encode_unsigned_long_long(char *, size_t, unsigned long long);
int gob_encode_unsigned_int(char *buf, size_t buf_size, unsigned int i) {
  return gob_encode_unsigned_long_long(buf, buf_size, (unsigned long long)i);
}


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

x86 assembly (clang, -O2):
<gob_encode_unsigned_int>:
mov    %edx,%edx
jmp    1030 <gob_encode_unsigned_long_long@plt>

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

LLVM IR (-O2):
define i32 @gob_encode_unsigned_int(i8* %0, i64 %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = tail call i32 @gob_encode_unsigned_long_long(i8* %0, i64 %1, i64 %4)
ret i32 %5
}
void foo237(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo237(i32 %0) {
ret void
}
void foo(int *a) { *(a + 1) = 8; }


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

x86 assembly (clang, -O2):
<foo>:
movl   $0x8,0x4(%rdi)
ret

LLVM IR (-O0):
define void @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32 8, i32* %4
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
store i32 8, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  extern int i;
  i = 20;
  printf("%d", sizeof i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
movl   $0x14,(%rax)
lea    0xed8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@i = external global i32
@.str = [3 x i8] c"%d\00"
define i32 @main() {
store i32 20, i32* @i
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fred(int arg) { printf("fred: you passed %d\n", arg); }


x86 assembly (clang, -O0):
<fred>:
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):
<fred>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"fred: you passed %d\0A\00"
define void @fred(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
double Kelvin(double);
double exp(double);
double PresEfromPresS(double TempS, double Press, double HeightEye) {
  return Press *
         exp(-9.80665 * 0.0289644 / (Kelvin(TempS) + 3.25 * HeightEye / 1000) /
             8.31441 * HeightEye);
}


x86 assembly (clang, -O0):
<PresEfromPresS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <Kelvin@plt>
movaps %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xead(%rip),%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm0,%xmm1
movsd  0xe95(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xe81(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PresEfromPresS>:
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
call   1040 <Kelvin@plt>
movsd  0xec3(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm1
divsd  0xeb9(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
divsd  %xmm1,%xmm0
divsd  0xeb1(%rip),%xmm0
mulsd  %xmm2,%xmm0
call   1030 <exp@plt>
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @PresEfromPresS(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %4
%9 = call double @Kelvin(double %8)
%10 = load double, double* %6
%11 = fmul double 3.250000e+00, %10
%12 = fdiv double %11, 1.000000e+03
%13 = fadd double %9, %12
%14 = fdiv double 0xBFD22DC5C43F1192, %13
%15 = fdiv double %14, 8.314410e+00
%16 = load double, double* %6
%17 = fmul double %15, %16
%18 = call double @exp(double %17)
%19 = fmul double %7, %18
ret double %19
}

LLVM IR (-O2):
define double @PresEfromPresS(double %0, double %1, double %2) {
%4 = tail call double @Kelvin(double %0)
%5 = fmul double %2, 3.250000e+00
%6 = fdiv double %5, 1.000000e+03
%7 = fadd double %6, %4
%8 = fdiv double 0xBFD22DC5C43F1192, %7
%9 = fdiv double %8, 8.314410e+00
%10 = fmul double %9, %2
%11 = tail call double @exp(double %10)
%12 = fmul double %11, %1
ret double %12
}
int foo(_Bool a, _Bool b) { return (a | !a) | (!b | b); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
and    $0x1,%cl
mov    %cl,-0x1(%rbp)
and    $0x1,%al
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x1(%rbp),%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
mov    -0x2(%rbp),%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    -0x2(%rbp),%dl
and    $0x1,%dl
movzbl %dl,%edx
or     %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i1 zeroext %0, i1 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = zext i1 %0 to i8
store i8 %5, i8* %3
%6 = zext i1 %1 to i8
store i8 %6, i8* %4
%7 = load i8, i8* %3
%8 = trunc i8 %7 to i1
%9 = zext i1 %8 to i32
%10 = load i8, i8* %3
%11 = trunc i8 %10 to i1
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = or i32 %9, %13
%15 = load i8, i8* %4
%16 = trunc i8 %15 to i1
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
%19 = load i8, i8* %4
%20 = trunc i8 %19 to i1
%21 = zext i1 %20 to i32
%22 = or i32 %18, %21
%23 = or i32 %14, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @foo(i1 zeroext %0, i1 zeroext %1) {
ret i32 1
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ perror(char const *);
void warn(const char *msg) {
  int error = errno;
  perror(msg);
  errno = error;
}


x86 assembly (clang, -O0):
<warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    -0xc(%rbp),%ecx
mov    0x2ea5(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <perror@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define void @warn(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @perror(i8* %5)
%7 = load i32, i32* %3
store i32 %7, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @warn(i8* nocapture %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @perror(i8* %0)
store i32 %2, i32* @errno
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *xrealloc(void *ptr, size_t size) {
  void *buf;
  buf = realloc(ptr, size);
  if (buf == NULL) {
    fprintf(stderr, "It is not enough memory\n");
    exit(1);
  }
  return buf;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117b <xrealloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"It is not enough memory\0A\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"It is not enough memory\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
int power_of_two(unsigned value) { return (value & (value - 1)) == 0; }


x86 assembly (clang, -O0):
<power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_of_two>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @power_of_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @power_of_two(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void sig_int_handler(int sig) {
  printf("Received SIGINT... ");
  exit(-1);
}


x86 assembly (clang, -O0):
<sig_int_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [20 x i8] c"Received SIGINT... \00"
define void @sig_int_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"Received SIGINT... \00"
define void @sig_int_handler(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void jx_core_tool_args(int argc, char *argv[]) {}


x86 assembly (clang, -O0):
<jx_core_tool_args>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @jx_core_tool_args(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @jx_core_tool_args(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int fcntl(int, int);
int fcntl_int(int fd, int cmd) { return fcntl(fd, cmd); }


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

x86 assembly (clang, -O2):
<fcntl_int>:
jmp    1030 <fcntl@plt>

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

LLVM IR (-O2):
define i32 @fcntl_int(i32 %0, i32 %1) {
%3 = tail call i32 @fcntl(i32 %0, i32 %1)
ret i32 %3
}
int test_03(unsigned char *a) { return a[0] + (a[0] > 127); }


x86 assembly (clang, -O0):
<test_03>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
cmp    $0x7f,%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_03>:
movzbl (%rdi),%ecx
mov    %ecx,%eax
shr    $0x7,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_03(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = icmp sgt i32 %10, 127
%12 = zext i1 %11 to i32
%13 = add nsw i32 %6, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @test_03(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = lshr i8 %2, 7
%5 = zext i8 %4 to i32
%6 = add nuw nsw i32 %5, %3
ret i32 %6
}