xunge/DecIR huggingface dataset:
void __do_global_ctors(void) {
  extern void (*__CTOR_LIST__[])(void);
  extern void (*__CTOR_END__[])(void);
  int wctor;
  int nctor = __CTOR_END__ - __CTOR_LIST__;
  for (wctor = 0; wctor < nctor; wctor++)
    (*(__CTOR_LIST__[wctor]))();
}


x86 assembly (clang, -O0):
<__do_global_ctors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
lea    0x2f2a(%rip),%rcx
sub    %rcx,%rax
lea    0x2f20(%rip),%rcx
mov    0x2eb9(%rip),%rax
sub    %rcx,%rax
shr    $0x3,%rax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1160 <__do_global_ctors+0x60>
movslq -0x4(%rbp),%rcx
lea    0x2ef1(%rip),%rax
call   *(%rax,%rcx,8)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <__do_global_ctors+0x38>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__do_global_ctors>:
push   %r15
push   %r14
push   %rbx
mov    0x2ecc(%rip),%rcx
sub    0x2ed5(%rip),%rcx
lea    0x7(%rcx),%rax
test   %rcx,%rcx
mov    %rcx,%rdx
cmovs  %rax,%rdx
shr    $0x3,%rdx
test   %edx,%edx
jle    115d <__do_global_ctors+0x5d>
test   %rcx,%rcx
cmovns %rcx,%rax
shr    $0x3,%rax
cmp    $0x2,%eax
mov    $0x1,%r14d
cmovge %eax,%r14d
xor    %ebx,%ebx
lea    0x2ef6(%rip),%r15
nopw   0x0(%rax,%rax,1)
call   *(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1150 <__do_global_ctors+0x50>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__CTOR_END__ = external global [0 x void ()*]
@__CTOR_LIST__ = external global [0 x void ()*]
define void @__do_global_ctors() {
%1 = alloca i32
%2 = alloca i32
store i32 trunc (i64 sdiv exact (i64 sub (i64 ptrtoint ([0 x void ()*]* @__CTOR_END__ to i64), i64 ptrtoint ([0 x void ()*]* @__CTOR_LIST__ to i64)), i64 8) to i32), i32* %2
store i32 0, i32* %1
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = icmp slt i32 %4, %5
br i1 %6, label %7, label %15
7: ; preds = %3
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [0 x void ()*], [0 x void ()*]* @__CTOR_LIST__, i64 0, i64 %9
%11 = load void ()*, void ()** %10
br label %12
12: ; preds = %7
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
@__CTOR_END__ = external global [0 x void ()*]
@__CTOR_LIST__ = external global [0 x void ()*]
define void @__do_global_ctors() {
br i1 icmp sgt (i32 trunc (i64 sdiv (i64 sub (i64 ptrtoint ([0 x void ()*]* @__CTOR_END__ to i64), i64 ptrtoint ([0 x void ()*]* @__CTOR_LIST__ to i64)), i64 8) to i32), i32 0), label %1, label %10
1: ; preds = %0
%2 = call i32 @llvm.smax.i32(i32 trunc (i64 sdiv (i64 sub (i64 ptrtoint ([0 x void ()*]* @__CTOR_END__ to i64), i64 ptrtoint ([0 x void ()*]* @__CTOR_LIST__ to i64)), i64 8) to i32), i32 1)
%3 = zext i32 %2 to i64
br label %4
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %8, %4 ]
%6 = getelementptr inbounds [0 x void ()*], [0 x void ()*]* @__CTOR_LIST__, i64 0, i64 %5
%7 = load void ()*, void ()** %6
tail call void %7()
%8 = add nuw nsw i64 %5, 1
%9 = icmp eq i64 %8, %3
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret void
}
double ls_costN_nm5_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<ls_costN_nm5_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <ls_costN_nm5_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <ls_costN_nm5_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <ls_costN_nm5_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <ls_costN_nm5_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm5_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ls_costN_nm5_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @ls_costN_nm5_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void sprint_addc_data(char *str, uint8_t data) {
  sprintf(str,
          "ADDC  A, #"
          "0x%02X"
          "                  ",
          data);
}


x86 assembly (clang, -O0):
<sprint_addc_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_addc_data>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"ADDC A,x%02X \00"
define void @sprint_addc_data(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"ADDC A,x%02X \00"
define void @sprint_addc_data(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
char *xstrchr_tiny(char *src, int c) {
  char chr = (char)c;
  for (; *src; src++) {
    if (*src == chr) {
      return src;
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<xstrchr_tiny>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1154 <xstrchr_tiny+0x54>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <xstrchr_tiny+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115c <xstrchr_tiny+0x5c>
jmp    1143 <xstrchr_tiny+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1111 <xstrchr_tiny+0x11>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrchr_tiny>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <xstrchr_tiny+0x23>
mov    %rdi,%rax
movsbl %sil,%edx
nopl   (%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
je     1125 <xstrchr_tiny+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <xstrchr_tiny+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @xstrchr_tiny(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = trunc i32 %7 to i8
store i8 %8, i8* %6
br label %9
9: ; preds = %23, %2
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i8, i8* %6
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %16, %18
br i1 %19, label %20, label %22
20: ; preds = %13
%21 = load i8*, i8** %4
store i8* %21, i8** %3
br label %27
22: ; preds = %13
br label %23
23: ; preds = %22
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
br label %9
26: ; preds = %9
store i8* null, i8** %3
br label %27
27: ; preds = %26, %20
%28 = load i8*, i8** %3
ret i8* %28
}

LLVM IR (-O2):
define i8* @xstrchr_tiny(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %13
%9 = phi i8 [ %3, %5 ], [ %15, %13 ]
%10 = phi i8* [ %0, %5 ], [ %14, %13 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %13, %2
%18 = phi i8* [ null, %2 ], [ null, %13 ], [ %10, %8 ]
ret i8* %18
}
__attribute__((visibility("hidden"))) int func() { return 1; }


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

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

LLVM IR (-O0):
define hidden i32 @func() {
ret i32 1
}

LLVM IR (-O2):
define hidden i32 @func() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void ufs_usage() {
  (void)fprintf(stderr, "usage: mount_ufs [-o options] special node\n");
  exit(1);
}


x86 assembly (clang, -O0):
<ufs_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ufs_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage: mount_ufs [-o options] special node\0A\00"
define void @ufs_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"usage: mount_ufs [-o options] special node\0A\00"
define void @ufs_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int is_power_of_two(unsigned int x) {
  while (((x % 2) == 0) && x > 1) {
    x /= 2;
  }
  return (x == 1);
}


x86 assembly (clang, -O0):
<is_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1125 <is_power_of_two+0x25>
cmpl   $0x1,-0x4(%rbp)
seta   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1135 <is_power_of_two+0x35>
jmp    1143 <is_power_of_two+0x43>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <is_power_of_two+0x7>
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_two>:
mov    %edi,%ecx
cmp    $0x2,%edi
jb     1114 <is_power_of_two+0x14>
mov    %ecx,%eax
and    $0x1,%eax
mov    %ecx,%edi
shr    %edi
test   %eax,%eax
je     1100 <is_power_of_two>
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_power_of_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %12, %1
%4 = load i32, i32* %2
%5 = urem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp ugt i32 %8, 1
br label %10
10: ; preds = %7, %3
%11 = phi i1 [ false, %3 ], [ %9, %7 ]
br i1 %11, label %12, label %15
12: ; preds = %10
%13 = load i32, i32* %2
%14 = udiv i32 %13, 2
store i32 %14, i32* %2
br label %3
15: ; preds = %10
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 1
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_power_of_two(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %8, %2 ]
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
%6 = icmp ugt i32 %3, 1
%7 = and i1 %6, %5
%8 = lshr i32 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
%10 = icmp eq i32 %3, 1
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fusion(int, int, int);
void triFusion(int debut, int fin) {
  if (debut != fin) {
    int milieu = (debut + fin) / 2;
    triFusion(debut, milieu);
    triFusion(milieu + 1, fin);
    fusion(debut, milieu, fin);
  }
}


x86 assembly (clang, -O0):
<triFusion>:
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     1172 <triFusion+0x52>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <triFusion@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1030 <triFusion@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <fusion@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triFusion>:
cmp    %esi,%edi
jne    1125 <triFusion+0x5>
ret
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%r15d
lea    (%r14,%r15,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%esi
call   1030 <triFusion@plt>
lea    0x1(%rbx),%edi
mov    %r14d,%esi
call   1030 <triFusion@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fusion@plt>

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

LLVM IR (-O2):
define void @triFusion(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %4, label %5
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = add nsw i32 %1, %0
%7 = sdiv i32 %6, 2
tail call void @triFusion(i32 %0, i32 %7)
%8 = add nsw i32 %7, 1
tail call void @triFusion(i32 %8, i32 %1)
%9 = tail call i32 @fusion(i32 %0, i32 %7, i32 %1)
br label %4
}
void collision_avoidance() {}


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

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

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

LLVM IR (-O2):
define void @collision_avoidance() {
ret void
}
/* Variables and functions */
scalar_t__ isdigit(int);
int isxdigit(int c) {
  return isdigit(c) || (c >= 'a' && c >= 'f') || (c >= 'A' && c <= 'F');
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116d <isxdigit+0x5d>
cmpl   $0x61,-0x4(%rbp)
jl     114e <isxdigit+0x3e>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jge    116d <isxdigit+0x5d>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1167 <isxdigit+0x57>
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
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
cmp    $0x66,%ebx
setge  %cl
or     %al,%cl
add    $0xffffffbf,%ebx
cmp    $0x6,%ebx
setb   %al
or     %cl,%al
movzbl %al,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp sgt i32 %0, 101
%5 = or i1 %4, %3
%6 = add i32 %0, -65
%7 = icmp ult i32 %6, 6
%8 = or i1 %7, %5
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ process(int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
void ent_num() {
  int n1, n2;
  scanf("%d%d", &n1, &n2);
  process(n1, n2);
}


x86 assembly (clang, -O0):
<ent_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <process@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ent_num>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <process@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
define void @ent_num() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @process(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
define void @ent_num() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @process(i32 %6, i32 %7)
ret void
}
double creal(double _Complex z) { abort(); }


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

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

LLVM IR (-O0):
define double @creal(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
unreachable
}

LLVM IR (-O2):
define double @creal(double %0, double %1) {
tail call void @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int unixsocket(void) { return socket(AF_UNIX, SOCK_STREAM, 0); }


x86 assembly (clang, -O0):
<unixsocket>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unixsocket>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
define i32 @unixsocket() {
%1 = load i32, i32* @AF_UNIX
%2 = load i32, i32* @SOCK_STREAM
%3 = call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
define i32 @unixsocket() {
%1 = load i32, i32* @AF_UNIX
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Send_MPlayer_Command(int, int /*<<< orphan*/);
void MPlayer_Shutdown() { Send_MPlayer_Command(0x0C, 0); }


x86 assembly (clang, -O0):
<MPlayer_Shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
xor    %esi,%esi
call   1030 <Send_MPlayer_Command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPlayer_Shutdown>:
mov    $0xc,%edi
xor    %esi,%esi
jmp    1030 <Send_MPlayer_Command@plt>

LLVM IR (-O0):
define void @MPlayer_Shutdown() {
%1 = call i32 @Send_MPlayer_Command(i32 12, i32 0)
ret void
}

LLVM IR (-O2):
define void @MPlayer_Shutdown() {
%1 = tail call i32 @Send_MPlayer_Command(i32 12, i32 0)
ret void
}
/* Variables and functions */
double atof(char *const);
int numcmp_inv(const void *s1, const void *s2) {
  double v1, v2;
  v1 = atof((char *const)s1);
  v2 = atof((char *const)s2);
  if (v1 < v2)
    return 1;
  else if (v1 > v2)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<numcmp_inv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115c <numcmp_inv+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    117f <numcmp_inv+0x6f>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1178 <numcmp_inv+0x68>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <numcmp_inv+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp_inv>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <atof@plt>
xor    %ecx,%ecx
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @numcmp_inv(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call double @atof(i8* %8)
store double %9, double* %6
%10 = load i8*, i8** %5
%11 = call double @atof(i8* %10)
store double %11, double* %7
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fcmp olt double %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 1, i32* %3
br label %22
16: ; preds = %2
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fcmp ogt double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 -1, i32* %3
br label %22
21: ; preds = %16
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @numcmp_inv(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call double @atof(i8* %0)
%4 = tail call double @atof(i8* %1)
%5 = fcmp olt double %3, %4
%6 = fcmp ogt double %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
void delays(void) {
  sleep(1);
  printf("\t...\t");
  sleep(1);
  puts("...");
}


x86 assembly (clang, -O0):
<delays>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delays>:
push   %rax
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
lea    0xeae(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\09...\09\00"
@.str.1 = [4 x i8] c"...\00"
define void @delays() {
%1 = call i32 @sleep(i32 1)
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sleep(i32 1)
%4 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\09...\09\00"
@.str.1 = [4 x i8] c"...\00"
define void @delays() {
%1 = tail call i32 @sleep(i32 1)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int iswgraph(int /*<<< orphan*/);
int iswgraph_l(wint_t c, locale_t l) { return iswgraph(c); }


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

x86 assembly (clang, -O2):
<iswgraph_l>:
jmp    1030 <iswgraph@plt>

LLVM IR (-O0):
define i32 @iswgraph_l(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 = call i32 @iswgraph(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @iswgraph_l(i32 %0, i32 %1) {
%3 = tail call i32 @iswgraph(i32 %0)
ret i32 %3
}
/* Variables and functions */
int rand();
int roll_dice(void) {
  int num1, num2;
  num1 = (rand() % 6) + 1;
  num2 = (rand() % 6) + 1;
  int number = num1 + num2;
  return number;
}


x86 assembly (clang, -O0):
<roll_dice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roll_dice>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rbx
imul   $0x2aaaaaab,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
add    %ebx,%eax
add    $0x2,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @roll_dice() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 6
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 6
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = add nsw i32 %10, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @roll_dice() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %2, 2
%6 = add nsw i32 %5, %4
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t select_uint16_t() { return 0 | (1 << 1); }


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

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

LLVM IR (-O0):
define i32 @select_uint16_t() {
ret i32 2
}

LLVM IR (-O2):
define i32 @select_uint16_t() {
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
ssize_t getxattr(const char *path, const char *name, void *value, size_t size) {
  return (errno = ENOSYS, -1);
}


x86 assembly (clang, -O0):
<getxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getxattr>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getxattr(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* @ENOSYS
store i32 %9, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getxattr(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  printf("你好！\a\a\a\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"\E4\BD\A0\E5\A5\BD\EF\BC\81\07\07\07\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"\E4\BD\A0\E5\A5\BD\EF\BC\81\07\07\07\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
short and_h(short *, short *);
short intr_wrap_508(short p1, short p2) { return and_h(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_508>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
lea    -0x2(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <and_h@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_508>:
push   %rax
mov    %di,0x6(%rsp)
mov    %si,0x4(%rsp)
lea    0x6(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1030 <and_h@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @intr_wrap_508(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @and_h(i16* %3, i16* %4)
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @intr_wrap_508(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @and_h(i16* %3, i16* %4)
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void wl_compile(void) {
  errx(1, "The compile workload isn't implemented yet.");
}


x86 assembly (clang, -O0):
<wl_compile>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_compile>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"The compile workload isn't implemented yet.\00"
define void @wl_compile() {
%1 = call i32 @errx(i32 1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"The compile workload isn't implemented yet.\00"
define void @wl_compile() {
%1 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int calc_compensation(int);
unsigned srl(unsigned x, int k) {
  unsigned xsra = (int)x >> k;
  int xsra_int = xsra;
  if (xsra_int > 0) {
    return xsra;
  } else {
    return xsra - calc_compensation(k);
  }
}


x86 assembly (clang, -O0):
<srl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1144 <srl+0x34>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <srl+0x4c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <calc_compensation@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srl>:
push   %rbx
mov    %esi,%ecx
mov    %edi,%ebx
sar    %cl,%ebx
test   %ebx,%ebx
jg     1124 <srl+0x14>
mov    %ecx,%edi
call   1030 <calc_compensation@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @srl(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = icmp sgt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @calc_compensation(i32 %1)
%7 = sub i32 %3, %6
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ %3, %2 ]
ret i32 %9
}
void RTAvlrFileOffsetGetRight(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrFileOffsetGetRight() {
ret void
}
/* Variables and functions */
void *memchr(const void *s, int c, size_t n) {
  const unsigned char *src = s;
  unsigned char uc = c;
  while (n-- != 0) {
    if (*src == uc)
      return (void *)src;
    src++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x29(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     1167 <memchr+0x67>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x29(%rbp),%ecx
cmp    %ecx,%eax
jne    1156 <memchr+0x56>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <memchr+0x6f>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    111d <memchr+0x1d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %rdx,%rdx
je     1122 <memchr+0x22>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %sil,(%rax)
je     1124 <memchr+0x24>
add    $0xffffffffffffffff,%rdx
add    $0x1,%rax
test   %rdx,%rdx
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %13
%8 = phi i64 [ %2, %5 ], [ %10, %13 ]
%9 = phi i8* [ %0, %5 ], [ %14, %13 ]
%10 = add i64 %8, -1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, %6
br i1 %12, label %16, label %13
13: ; preds = %7
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = icmp eq i64 %10, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %13, %3
%17 = phi i8* [ null, %3 ], [ null, %13 ], [ %9, %7 ]
ret i8* %17
}
int func(void) {
  int n = 3;
  int m = 5;
  n &m;
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
void Exit(int status) {
  msg_work(138,
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/tumi8/trumanbox/refs/heads/master/src/"
           "wrapper.c",
           __PRETTY_FUNCTION__, __func__, 3,
           "process %d will exit now with status %d", getpid(), status);
  exit(status);
}


x86 assembly (clang, -O0):
<Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%r10d
mov    -0x4(%rbp),%eax
mov    $0x8a,%edi
lea    0xeac(%rip),%rsi
lea    0xf2f(%rip),%rdx
lea    0xf37(%rip),%rcx
mov    $0x3,%r8d
lea    0xf2f(%rip),%r9
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <msg_work@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<Exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %eax,%r10d
lea    0xebc(%rip),%rsi
lea    0xf3f(%rip),%rdx
lea    0xf47(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x8a,%edi
mov    $0x3,%r8d
xor    %eax,%eax
push   %rbx
push   %r10
call   1030 <msg_work@plt>
add    $0x10,%rsp
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tumi8/trumanbox/refs/heads/master/src/wrapper.c\00"
@__PRETTY_FUNCTION__.Exit = [15 x i8] c"void Exit(int)\00"
@__func__.Exit = [5 x i8] c"Exit\00"
@.str.1 = [40 x i8] c"process %d will exit now with status %d\00"
define void @Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = call i32 (i32, i8*, i8*, i8*, i32, i8*, i32, i32, ...) bitcast (i32 (...)* @msg_work to i32 (i32, i8*, i8*, i8*, i32, i8*, i32, i32, ...)*)(i32 138, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__PRETTY_FUNCTION__.Exit, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.Exit, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tumi8/trumanbox/refs/heads/master/src/wrapper.c\00"
@__PRETTY_FUNCTION__.Exit = [15 x i8] c"void Exit(int)\00"
@__func__.Exit = [5 x i8] c"Exit\00"
@.str.1 = [40 x i8] c"process %d will exit now with status %d\00"
define void @Exit(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (i32, i8*, i8*, i8*, i32, i8*, i32, i32, ...) bitcast (i32 (...)* @msg_work to i32 (i32, i8*, i8*, i8*, i32, i8*, i32, i32, ...)*)(i32 138, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__PRETTY_FUNCTION__.Exit, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.Exit, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %2, i32 %0)
tail call void @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *block = malloc(size);
  if (block == NULL && size != 0)
    fail("out of memory");
  return block;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <xmalloc+0x3b>
cmpq   $0x0,-0x8(%rbp)
je     115b <xmalloc+0x3b>
lea    0xeaa(%rip),%rdi
call   1030 <fail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <xmalloc+0x25>
test   %r14,%r14
jne    1145 <xmalloc+0x25>
lea    0xec0(%rip),%rdi
call   1030 <fail@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* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @fail(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* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @fail(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %2
}
int *my_GetModemDefault(void) {
  char *retval;
  retval = GetConfigVar("ModemDefault");
  if (*retval == 'y')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<my_GetModemDefault>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <GetConfigVar@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x79,%eax
jne    114a <my_GetModemDefault+0x3a>
mov    $0x1,%eax
mov    %rax,-0x8(%rbp)
jmp    1152 <my_GetModemDefault+0x42>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_GetModemDefault>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <GetConfigVar@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmpb   $0x79,(%rcx)
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"ModemDefault\00"
define i32* @my_GetModemDefault() {
%1 = alloca i32*
%2 = alloca i8*
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @GetConfigVar to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 121
br i1 %9, label %10, label %11
10: ; preds = %0
store i32* inttoptr (i64 1 to i32*), i32** %1
br label %12
11: ; preds = %0
store i32* null, i32** %1
br label %12
12: ; preds = %11, %10
%13 = load i32*, i32** %1
ret i32* %13
}

LLVM IR (-O2):
@.str = [13 x i8] c"ModemDefault\00"
define i32* @my_GetModemDefault() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @GetConfigVar to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8*
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 121
%6 = select i1 %5, i32* inttoptr (i64 1 to i32*), i32* null
ret i32* %6
}
/* Variables and functions */
int /*<<< orphan*/ __emit_string_literal_range(char *, int, int, int);
void test_hex(void) { __emit_string_literal_range("01234\x35 789", 4, 3, 7); }


x86 assembly (clang, -O0):
<test_hex>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x7,%ecx
call   1030 <__emit_string_literal_range@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_hex>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x7,%ecx
jmp    1030 <__emit_string_literal_range@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"012345 789\00"
define void @test_hex() {
%1 = call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4, i32 3, i32 7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"012345 789\00"
define void @test_hex() {
%1 = tail call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4, i32 3, i32 7)
ret void
}
unsigned long buf32_to_ulong(const void *buffer) {
  const unsigned char *p = buffer;
  return (((unsigned long)p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
}


x86 assembly (clang, -O0):
<buf32_to_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%rax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf32_to_ulong>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @buf32_to_ulong(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i64
%9 = shl i64 %8, 24
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 16
%15 = sext i32 %14 to i64
%16 = or i64 %9, %15
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 2
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = shl i32 %20, 8
%22 = sext i32 %21 to i64
%23 = or i64 %16, %22
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = zext i8 %26 to i64
%28 = or i64 %23, %27
ret i64 %28
}

LLVM IR (-O2):
define i64 @buf32_to_ulong(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = shl nuw nsw i64 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 16
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %12, 8
%14 = or i64 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}