xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(int, int);
char **allocMatrix(int m, int n) {
  int i;
  char **matrix = calloc(m, sizeof(char **));
  for (i = 0; i < m; i++) {
    matrix[i] = calloc(n, sizeof(char *));
  }
  return matrix;
}


x86 assembly (clang, -O0):
<allocMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116c <allocMatrix+0x5c>
mov    -0x8(%rbp),%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <allocMatrix+0x26>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r15d
mov    %edi,%r14d
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,%r12
test   %r14d,%r14d
jle    115a <allocMatrix+0x4a>
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15d,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,(%r12,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <allocMatrix+0x30>
mov    %r12,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8** @allocMatrix(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 8)
%4 = bitcast i8* %3 to i8**
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = tail call i8* @calloc(i32 %1, i32 8)
%11 = getelementptr inbounds i8*, i8** %4, i64 %9
store i8* %10, i8** %11
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %2
ret i8** %4
}
void rb_bf_mark_table_finalize() {}


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

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

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

LLVM IR (-O2):
define void @rb_bf_mark_table_finalize() {
ret void
}
/* Variables and functions */
int vartonum(char);
int varValue(char var, int V[3]) {
  int varnum = vartonum(var);
  return V[varnum];
}


x86 assembly (clang, -O0):
<varValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <vartonum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<varValue>:
push   %rbx
mov    %rsi,%rbx
call   1030 <vartonum@plt>
cltq
mov    (%rbx,%rax,4),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @varValue(i8 signext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
%5 = alloca i32
store i8 %0, i8* %3
store i32* %1, i32** %4
%6 = load i8, i8* %3
%7 = call i32 @vartonum(i8 signext %6)
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @varValue(i8 signext %0, i32* nocapture %1) {
%3 = tail call i32 @vartonum(i8 signext %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", f(3));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @f(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int maxsolutions(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  printf("%d\n", maxsolutions(1000));
  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)
mov    $0x3e8,%edi
call   1040 <maxsolutions@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @maxsolutions(i32 1000)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @maxsolutions(i32 1000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned int BMAP_CEIL_SIZE(unsigned int bits) {
  unsigned int tmp = bits + 64;
  assert(tmp != 0);
  return (64 * (tmp / 64));
}


x86 assembly (clang, -O0):
<BMAP_CEIL_SIZE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
shr    $0x6,%eax
shl    $0x6,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMAP_CEIL_SIZE>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
add    $0x40,%ebx
setne  %dil
call   1030 <assert@plt>
and    $0xffffffc0,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @BMAP_CEIL_SIZE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 64
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %3
%11 = udiv i32 %10, 64
%12 = mul i32 64, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @BMAP_CEIL_SIZE(i32 %0) {
%2 = add i32 %0, 64
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = and i32 %2, -64
ret i32 %6
}
float warp_maxf(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<warp_maxf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <warp_maxf+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <warp_maxf+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<warp_maxf>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @warp_maxf(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int system(char *);
int main(int argc, char **argv) { return system(argv[1]); }


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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x8(%rsi),%rdi
jmp    1030 <system@plt>

LLVM IR (-O0):
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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @system(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @system(i8* %4)
ret i32 %5
}
void gtk_icon_view_get_selected_items() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_get_selected_items() {
ret void
}
int convert_to_hex(int r, int g, int b) {
  long mask = (r << 16) + (g << 8) + (b & 0xFF);
  return mask;
}


x86 assembly (clang, -O0):
<convert_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_hex>:
shl    $0x10,%edi
shl    $0x8,%esi
lea    (%rsi,%rdi,1),%ecx
movzbl %dl,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @convert_to_hex(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = shl i32 %8, 16
%10 = load i32, i32* %5
%11 = shl i32 %10, 8
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %6
%14 = and i32 %13, 255
%15 = add nsw i32 %12, %14
%16 = sext i32 %15 to i64
store i64 %16, i64* %7
%17 = load i64, i64* %7
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @convert_to_hex(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 16
%5 = shl i32 %1, 8
%6 = add nsw i32 %5, %4
%7 = and i32 %2, 255
%8 = or i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
void func(char *p) {
  printf("%s\n", p);
  free(p);
}


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

x86 assembly (clang, -O2):
<func>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @func(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
int main() {
  int i;
  int i2 = i;
  i = -1;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
float filter_bin(const float bin, const float bin_old, const float cutoff_hz) {
  return bin *
             (((((float)1024) / ((float)44100)) * 6.283185307179586) /
              (1 + ((((float)1024) / ((float)44100)) * 6.283185307179586))) *
             cutoff_hz +
         (1 -
          cutoff_hz *
              (((((float)1024) / ((float)44100)) * 6.283185307179586) /
               (1 + ((((float)1024) / ((float)44100)) * 6.283185307179586)))) *
             bin_old;
}


x86 assembly (clang, -O0):
<filter_bin>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedc(%rip),%xmm1
mulsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xea7(%rip),%xmm3
mulsd  %xmm3,%xmm1
movsd  0xea3(%rip),%xmm3
addsd  %xmm3,%xmm1
movss  -0x8(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_bin>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm3
mulsd  %xmm3,%xmm0
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm3
movsd  0xee8(%rip),%xmm4
subsd  %xmm3,%xmm4
cvtss2sd %xmm1,%xmm1
mulsd  %xmm4,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @filter_bin(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = fmul double %8, 0x3FC04C04C199F2CE
%10 = load float, float* %6
%11 = fpext float %10 to double
%12 = load float, float* %6
%13 = fpext float %12 to double
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %14, double 0x3FC04C04C199F2CE, double 1.000000e+00)
%16 = load float, float* %5
%17 = fpext float %16 to double
%18 = fmul double %15, %17
%19 = call double @llvm.fmuladd.f64(double %9, double %11, double %18)
%20 = fptrunc double %19 to float
ret float %20
}

LLVM IR (-O2):
define float @filter_bin(float %0, float %1, float %2) {
%4 = fpext float %0 to double
%5 = fmul double %4, 0x3FC04C04C199F2CE
%6 = fpext float %2 to double
%7 = fneg double %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x3FC04C04C199F2CE, double 1.000000e+00)
%9 = fpext float %1 to double
%10 = fmul double %8, %9
%11 = tail call double @llvm.fmuladd.f64(double %5, double %6, double %10)
%12 = fptrunc double %11 to float
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x51() {
  Assert_real((isxdigit(81) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              410, ("isxdigit should be 0 for Q"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x51>:
push   %rbp
mov    %rsp,%rbp
mov    $0x51,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x19a,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x51>:
push   %rax
mov    $0x51,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x19a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for Q\00"
define void @t_isxdigit_0x51() {
%1 = call i64 @isxdigit(i32 81)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 410, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for Q\00"
define void @t_isxdigit_0x51() {
%1 = tail call i64 @isxdigit(i32 81)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 410, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
abs(arg) {
  if (arg < 0)
    arg = -arg;
  return (arg);
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1119 <abs+0x19>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void key_pressed(unsigned char key, int x __attribute__((unused)),
                 int y __attribute__((unused))) {
  switch (key) {
  case 27:
    exit(0);
  }
}


x86 assembly (clang, -O0):
<key_pressed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113b <key_pressed+0x2b>
jmp    1134 <key_pressed+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_pressed>:
cmp    $0x1b,%dil
je     1117 <key_pressed+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @key_pressed(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @key_pressed(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ res;

/* Variables and functions */
int atoi(char *);
scalar_t__ wpa_command_resp(char const *, char *, char *, int);
int add_network(const char *ifname) {
  char res[30];
  if (wpa_command_resp(ifname, "ADD_NETWORK", res, sizeof(res)) < 0)
    return -1;
  return atoi(res);
}


x86 assembly (clang, -O0):
<add_network>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    0xec5(%rip),%rsi
mov    $0x1e,%ecx
call   1040 <wpa_command_resp@plt>
cmp    $0x0,%rax
jge    115b <add_network+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <add_network+0x47>
lea    -0x30(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_network>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rsi
mov    %rsp,%rdx
mov    $0x1e,%ecx
call   1040 <wpa_command_resp@plt>
test   %rax,%rax
js     114a <add_network+0x2a>
mov    %rsp,%rdi
call   1030 <atoi@plt>
add    $0x28,%rsp
ret
mov    $0xffffffff,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"ADD_NETWORK\00"
define i32 @add_network(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [30 x i8]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%7 = call i64 @wpa_command_resp(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6, i32 30)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %13
10: ; preds = %1
%11 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"ADD_NETWORK\00"
define i32 @add_network(i8* %0) {
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%4 = call i64 @wpa_command_resp(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3, i32 30)
%5 = icmp slt i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @atoi(i8* %3)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ -1, %1 ]
ret i32 %9
}
void ai_dummy(int side) {}


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

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

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

LLVM IR (-O2):
define void @ai_dummy(i32 %0) {
ret void
}
void av_bitstream_filter_filter() {}


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

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

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

LLVM IR (-O2):
define void @av_bitstream_filter_filter() {
ret void
}
int prog_rbyte(int a) {
  int p0 = (a >> 24) & 0x000000FF;
  int p1 = ((a & 0x00FF0000) >> 8);
  int p2 = ((a & 0x0000FF00) << 8);
  int p3 = ((a & 0x000000FF) << 24);
  return (p3) | (p2) | (p1) | (p0);
}


x86 assembly (clang, -O0):
<prog_rbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
or     -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prog_rbyte>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @prog_rbyte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 24
%9 = and i32 %8, 255
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 8
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = and i32 %13, 65280
%15 = shl i32 %14, 8
store i32 %15, i32* %5
%16 = load i32, i32* %2
%17 = and i32 %16, 255
%18 = shl i32 %17, 24
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = load i32, i32* %5
%21 = or i32 %19, %20
%22 = load i32, i32* %4
%23 = or i32 %21, %22
%24 = load i32, i32* %3
%25 = or i32 %23, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @prog_rbyte(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int getmaxmode(void) { return 12; }


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

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

LLVM IR (-O0):
define i32 @getmaxmode() {
ret i32 12
}

LLVM IR (-O2):
define i32 @getmaxmode() {
ret i32 12
}
/* Variables and functions */
int /*<<< orphan*/ CALC_appendString(char *);
void CALC_addRPth() { CALC_appendString(")"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c")\00"
define void @CALC_addRPth() {
%1 = tail call i32 @CALC_appendString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int makeInt();
int main(void) { return makeInt(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @makeInt()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @makeInt()
ret i32 %1
}
/* Type definitions */
typedef unsigned long long __u8;
typedef unsigned long long __u64;

/* Variables and functions */
__u8 hea_get_u8_bits(__u8 val, int start, int end) {
  return ((((__u64)(val)) &
           ((~0ULL << (63 - (end + 56))) & (~0ULL >> (start + 56)))) >>
          (63 - (end + 56)));
}


x86 assembly (clang, -O0):
<hea_get_u8_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%edx
add    $0x38,%edx
mov    $0x3f,%ecx
sub    %edx,%ecx
mov    %ecx,%ecx
mov    $0xffffffffffffffff,%rdx
shl    %cl,%rdx
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x38,%ecx
mov    %ecx,%ecx
mov    $0xffffffffffffffff,%rdx
shr    %cl,%rdx
mov    -0x18(%rbp),%rcx
and    %rdx,%rcx
and    %rcx,%rax
mov    -0x10(%rbp),%edx
add    $0x38,%edx
mov    $0x3f,%ecx
sub    %edx,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_get_u8_bits>:
mov    %rdi,%rax
lea    0x38(%rsi),%ecx
shl    %cl,%rax
mov    $0x7,%sil
shr    %cl,%rax
sub    %dl,%sil
mov    %esi,%ecx
shr    %cl,%rax
shl    %cl,%rax
shr    %cl,%rax
ret

LLVM IR (-O0):
define i64 @hea_get_u8_bits(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 56
%10 = sub nsw i32 63, %9
%11 = zext i32 %10 to i64
%12 = shl i64 -1, %11
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 56
%15 = zext i32 %14 to i64
%16 = lshr i64 -1, %15
%17 = and i64 %12, %16
%18 = and i64 %7, %17
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 56
%21 = sub nsw i32 63, %20
%22 = zext i32 %21 to i64
%23 = lshr i64 %18, %22
ret i64 %23
}

LLVM IR (-O2):
define i64 @hea_get_u8_bits(i64 %0, i32 %1, i32 %2) {
%4 = sub i32 7, %2
%5 = zext i32 %4 to i64
%6 = shl nsw i64 -1, %5
%7 = add nsw i32 %1, 56
%8 = zext i32 %7 to i64
%9 = lshr i64 -1, %8
%10 = and i64 %9, %0
%11 = and i64 %10, %6
%12 = lshr i64 %11, %5
ret i64 %12
}
int do_618() { return 618; }


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

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

LLVM IR (-O0):
define i32 @do_618() {
ret i32 618
}

LLVM IR (-O2):
define i32 @do_618() {
ret i32 618
}
/* Variables and functions */
char *memcpy(int /*<<< orphan*/, char *, int);
int strlen(char *);
int /*<<< orphan*/ tmpalloc(int);
char *tmpstrdup(char *str) {
  int len;
  len = strlen(str) + 1;
  return memcpy(tmpalloc(len), str, len);
}


x86 assembly (clang, -O0):
<tmpstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <tmpalloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmpstrdup>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <tmpalloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define i8* @tmpstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @tmpalloc(i32 %7)
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = call i8* @memcpy(i32 %8, i8* %9, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @tmpstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i32 @tmpalloc(i32 %3)
%5 = tail call i8* @memcpy(i32 %4, i8* %0, i32 %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void platform_sleep(int seconds) { sleep(seconds); }


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

x86 assembly (clang, -O2):
<platform_sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @platform_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
void X509_REVOKED_new(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REVOKED_new() {
ret void
}
/* Variables and functions */
bool is_digit(int x) { return x >= '0' && x <= '9'; }


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

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

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

LLVM IR (-O2):
define i32 @is_digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double __ocml_tgamma_f64(double);
double tgamma(double x) { return __ocml_tgamma_f64(x); }


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

x86 assembly (clang, -O2):
<tgamma>:
jmp    1030 <__ocml_tgamma_f64@plt>

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

LLVM IR (-O2):
define double @tgamma(double %0) {
%2 = tail call double @__ocml_tgamma_f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argcv[]) {
  printf("This is ISO-8859-1 encoded é\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 = [31 x i8] c"This is ISO-8859-1 encoded \C3\A9\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 ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"This is ISO-8859-1 encoded \C3\A9\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int g(int x) { int y$1; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("qwe"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"qwe\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("%d", &number);
  printf("%d", prime(number));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
call   1050 <prime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *createString(const char *src) {
  int length = strlen(src);
  char *dst = (char *)malloc(sizeof(char) * (length + 1));
  strcpy(dst, src);
  return dst;
}


x86 assembly (clang, -O0):
<createString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createString>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @createString(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @createString(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
int get_year(float R) {
  int i = 0;
  double area = 3.1415926 * R / 2;
  int sum;
  while ((sum = i * 50) < area) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<get_year>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xed3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
imul   $0x32,-0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cvtsi2sd %eax,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115e <get_year+0x5e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <get_year+0x36>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_year>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
mov    $0xffffffff,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
add    $0x1,%eax
add    $0x32,%ecx
ucomisd %xmm1,%xmm0
ja     1120 <get_year+0x20>
ret

LLVM IR (-O0):
define i32 @get_year(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
store float %0, float* %2
store i32 0, i32* %3
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fmul double 0x400921FB4D12D84A, %7
%9 = fdiv double %8, 2.000000e+00
store double %9, double* %4
br label %10
10: ; preds = %16, %1
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 50
store i32 %12, i32* %5
%13 = sitofp i32 %12 to double
%14 = load double, double* %4
%15 = fcmp olt double %13, %14
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %10
19: ; preds = %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @get_year(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x400921FB4D12D84A
%4 = fmul double %3, 5.000000e-01
br label %5
5: ; preds = %5, %1
%6 = phi i32 [ 0, %1 ], [ %10, %5 ]
%7 = mul nsw i32 %6, 50
%8 = sitofp i32 %7 to double
%9 = fcmp ogt double %4, %8
%10 = add nuw nsw i32 %6, 1
br i1 %9, label %5, label %11
11: ; preds = %5
ret i32 %6
}
int test_imm_43uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x43 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_43uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 287762808832
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
_Bool not(_Bool b) { return !b; }


x86 assembly (clang, -O0):
<not>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<not>:
mov    %edi,%eax
xor    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i1 @not(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = xor i1 %5, true
ret i1 %6
}

LLVM IR (-O2):
define zeroext i1 @not(i1 zeroext %0) {
%2 = xor i1 %0, true
ret i1 %2
}
float(wcheck_float)(float to_check) { return to_check; }


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

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

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

LLVM IR (-O2):
define float @wcheck_float(float returned %0) {
ret float %0
}
/* Variables and functions */
int /*<<< orphan*/ test_arrays_and_pointers();
int /*<<< orphan*/ test_list_of_strings();
int /*<<< orphan*/ test_pointer_arrays();
int /*<<< orphan*/ test_simple_pointers();
int /*<<< orphan*/ test_void_pointers();
int main(void) {
  test_simple_pointers();
  test_void_pointers();
  test_arrays_and_pointers();
  test_pointer_arrays();
  test_list_of_strings();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <test_simple_pointers@plt>
mov    $0x0,%al
call   1050 <test_void_pointers@plt>
mov    $0x0,%al
call   1060 <test_arrays_and_pointers@plt>
mov    $0x0,%al
call   1040 <test_pointer_arrays@plt>
mov    $0x0,%al
call   1030 <test_list_of_strings@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_simple_pointers@plt>
xor    %eax,%eax
call   1050 <test_void_pointers@plt>
xor    %eax,%eax
call   1060 <test_arrays_and_pointers@plt>
xor    %eax,%eax
call   1040 <test_pointer_arrays@plt>
xor    %eax,%eax
call   1030 <test_list_of_strings@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_simple_pointers()
%2 = call i32 (...) @test_void_pointers()
%3 = call i32 (...) @test_arrays_and_pointers()
%4 = call i32 (...) @test_pointer_arrays()
%5 = call i32 (...) @test_list_of_strings()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_simple_pointers()
%2 = tail call i32 (...) @test_void_pointers()
%3 = tail call i32 (...) @test_arrays_and_pointers()
%4 = tail call i32 (...) @test_pointer_arrays()
%5 = tail call i32 (...) @test_list_of_strings()
ret i32 0
}
/* Variables and functions */
int __send_to_ppe(int, int, int *);
int close(int file) { return __send_to_ppe(0x2101, 2, &file); }


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2101,%edi
mov    $0x2,%esi
lea    -0x4(%rbp),%rdx
call   1030 <__send_to_ppe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x2101,%edi
mov    $0x2,%esi
call   1030 <__send_to_ppe@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 2, i32* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__send_to_ppe(i32 8449, i32 2, i32* %2)
ret i32 %3
}
void tegra_serial_debug_init(unsigned int base, int fiq, struct clk *clk,
                             int signal_irq, int wakeup_irq) {}


x86 assembly (clang, -O0):
<tegra_serial_debug_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.clk = type opaque
define void @tegra_serial_debug_init(i32 %0, i32 %1, %struct.clk* nocapture %2, i32 %3, i32 %4) {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *_hi_alloc(size_t size, const char *name, int line) {
  void *p;
  ;
  p = malloc(size);
  if (name == NULL && line == 1) {
  }
  return p;
}


x86 assembly (clang, -O0):
<_hi_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114a <_hi_alloc+0x3a>
cmpl   $0x1,-0x14(%rbp)
jne    114a <_hi_alloc+0x3a>
jmp    114a <_hi_alloc+0x3a>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hi_alloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @_hi_alloc(i64 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i8* @malloc(i64 %0)
ret i8* %4
}