xunge/DecIR huggingface dataset:
void get_absorb_adios_(int *myrank, int *iregion, int *nimin, int *nimax,
                       int *njmin, int *njmax, int *nkmin_xi, int *nkmin_eta,
                       int *NSPEC2DMAX_XMIN_XMAX, int *NSPEC2DMAX_YMIN_YMAX) {}


x86 assembly (clang, -O0):
<get_absorb_adios_>:
push   %rbp
mov    %rsp,%rbp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @get_absorb_adios_(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9) {
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
store i32* %0, i32** %11
store i32* %1, i32** %12
store i32* %2, i32** %13
store i32* %3, i32** %14
store i32* %4, i32** %15
store i32* %5, i32** %16
store i32* %6, i32** %17
store i32* %7, i32** %18
store i32* %8, i32** %19
store i32* %9, i32** %20
ret void
}

LLVM IR (-O2):
define void @get_absorb_adios_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32* nocapture %6, i32* nocapture %7, i32* nocapture %8, i32* nocapture %9) {
ret void
}
int compare_double(double a, double b) {
  if (a < b) {
    return -1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<compare_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    112e <compare_double+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1135 <compare_double+0x35>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_double>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @compare_double(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %11
10: ; preds = %2
store i32 1, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @compare_double(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, i32 -1, i32 1
ret i32 %4
}
/* Variables and functions */
float fmaxf(float, float);
void __hv_max_f(float bIn0, float bIn1, float *bOut) {
  *bOut = fmaxf(bIn0, bIn1);
}


x86 assembly (clang, -O0):
<__hv_max_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordss %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxss  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_max_f>:
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
maxss  %xmm0,%xmm1
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
movss  %xmm2,(%rdi)
ret

LLVM IR (-O0):
define void @__hv_max_f(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 = load float, float* %5
%9 = call float @llvm.maxnum.f32(float %7, float %8)
%10 = load float*, float** %6
store float %9, float* %10
ret void
}

LLVM IR (-O2):
define void @__hv_max_f(float %0, float %1, float* nocapture writeonly %2) {
%4 = tail call float @llvm.maxnum.f32(float %0, float %1)
store float %4, float* %2
ret void
}
void overflow_3() {
  char buf[100];
  int i;
  for (i = 200; i > 100; ++i) {
    buf[i] = (char)(i + 4);
  }
}


x86 assembly (clang, -O0):
<overflow_3>:
push   %rbp
mov    %rsp,%rbp
movl   $0xc8,-0x74(%rbp)
cmpl   $0x64,-0x74(%rbp)
jle    1133 <overflow_3+0x33>
mov    -0x74(%rbp),%eax
add    $0x4,%eax
mov    %al,%cl
movslq -0x74(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    110b <overflow_3+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @overflow_3() {
%1 = alloca [100 x i8]
%2 = alloca i32
store i32 200, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 100
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 4
%9 = trunc i32 %8 to i8
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %11
store i8 %9, i8* %12
br label %13
13: ; preds = %6
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
int lw_sock_exit() { return 0; }


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

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

LLVM IR (-O0):
define i32 @lw_sock_exit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @lw_sock_exit() {
ret i32 0
}
unsigned short STREAM_TO_UINT16_f(char *p, unsigned short offset) {
  return (unsigned short)((unsigned short)((unsigned short)(*(p + offset + 1))
                                           << 8) +
                          (unsigned short)(*(p + offset)));
}


x86 assembly (clang, -O0):
<STREAM_TO_UINT16_f>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzwl -0xa(%rbp),%ecx
movslq %ecx,%rcx
movsbl 0x1(%rax,%rcx,1),%eax
movzwl %ax,%eax
shl    $0x8,%eax
movzwl %ax,%eax
mov    -0x8(%rbp),%rcx
movzwl -0xa(%rbp),%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
movzwl %cx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<STREAM_TO_UINT16_f>:
mov    %esi,%eax
movzbl 0x1(%rdi,%rax,1),%ecx
shl    $0x8,%ecx
movsbl (%rdi,%rax,1),%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @STREAM_TO_UINT16_f(i8* nocapture %0, i16 zeroext %1) {
%3 = zext i16 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = shl nuw i16 %7, 8
%9 = load i8, i8* %4
%10 = sext i8 %9 to i16
%11 = add i16 %8, %10
ret i16 %11
}
/* Variables and functions */
int toupper(int);
int internal_to_upper(int source) { return toupper(source); }


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

x86 assembly (clang, -O2):
<internal_to_upper>:
jmp    1030 <toupper@plt>

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

LLVM IR (-O2):
define i32 @internal_to_upper(i32 %0) {
%2 = tail call i32 @toupper(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cond_new() {
  printf("NOT IMPLEMENTED:"
         "pa_cond_new"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [28 x i8] c"NOT IMPLEMENTED:pa_cond_new\00"
define i32 @pa_cond_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int date_get_dayofyear();
int is_day_of_sun(void) { return date_get_dayofyear() % 2 == 0; }


x86 assembly (clang, -O0):
<is_day_of_sun>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <date_get_dayofyear@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_day_of_sun>:
push   %rax
xor    %eax,%eax
call   1030 <date_get_dayofyear@plt>
not    %eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_day_of_sun() {
%1 = call i32 (...) @date_get_dayofyear()
%2 = srem i32 %1, 2
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_day_of_sun() {
%1 = tail call i32 (...) @date_get_dayofyear()
%2 = and i32 %1, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int nums[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%d ", nums[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
int main(void) {
  int f();
  ;
  return f() ?: 4;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     113d <main+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114a <main+0x3a>
mov    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <main+0x3a>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
test   %eax,%eax
mov    $0x4,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %4
%7 = phi i32 [ %2, %4 ], [ 4, %5 ]
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i32 4, i32 %1
ret i32 %3
}
int get_count(int *words_len, int wordsSize, int querey) {
  for (int i = 0; i < wordsSize; i++)
    if (words_len[i] > querey)
      return wordsSize - i;
  return 0;
}


x86 assembly (clang, -O0):
<get_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1156 <get_count+0x56>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jle    1143 <get_count+0x43>
mov    -0x14(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <get_count+0x5d>
jmp    1148 <get_count+0x48>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <get_count+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_count>:
test   %esi,%esi
jle    111e <get_count+0x1e>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rcx,4)
jg     1121 <get_count+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <get_count+0x10>
xor    %eax,%eax
ret
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_count(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %15
%8 = phi i64 [ 0, %5 ], [ %16, %15 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp sgt i32 %10, %2
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = trunc i64 %8 to i32
%14 = sub nsw i32 %1, %13
br label %18
15: ; preds = %7
%16 = add nuw nsw i64 %8, 1
%17 = icmp eq i64 %16, %6
br i1 %17, label %18, label %7
18: ; preds = %15, %3, %12
%19 = phi i32 [ %14, %12 ], [ 0, %3 ], [ 0, %15 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x3d() {
  Assert_real((isupper(61) == 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_isupper.c",
              310, ("isupper should be 0 for ="));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x3d>:
push   %rax
mov    $0x3d,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x136,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for =\00"
define void @t_isupper_0x3d() {
%1 = call i64 @isupper(i32 61)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 310, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for =\00"
define void @t_isupper_0x3d() {
%1 = tail call i64 @isupper(i32 61)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 310, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long time() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_usec / 1000) + (tv.tv_sec * 1000);
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,-0x4(%rbp),%ecx
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
movslq 0x4(%rsp),%rcx
imul   $0x3e8,%rcx,%rcx
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
double bar(double x, double y) { return ((x * 5) + (1 + y)) - ((x * 5) + y); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeed(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xed8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xebe(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
movsd  0xef8(%rip),%xmm2
addsd  %xmm1,%xmm2
unpcklpd %xmm1,%xmm2
mulsd  0xef0(%rip),%xmm0
unpcklpd %xmm0,%xmm0
addpd  %xmm2,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @bar(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double 1.000000e+00, %6
%8 = call double @llvm.fmuladd.f64(double %5, double 5.000000e+00, double %7)
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call double @llvm.fmuladd.f64(double %9, double 5.000000e+00, double %10)
%12 = fsub double %8, %11
ret double %12
}

LLVM IR (-O2):
define double @bar(double %0, double %1) {
%3 = fadd double %1, 1.000000e+00
%4 = insertelement <2 x double> poison, double %0, i64 0
%5 = shufflevector <2 x double> %4, <2 x double> poison, <2 x i32> zeroinitializer
%6 = insertelement <2 x double> poison, double %1, i64 1
%7 = insertelement <2 x double> %6, double %3, i64 0
%8 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %5, <2 x double> <double 5.000000e+00, double 5.000000e+00>, <2 x double> %7)
%9 = shufflevector <2 x double> %8, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%10 = fsub <2 x double> %8, %9
%11 = extractelement <2 x double> %10, i64 0
ret double %11
}
int test_imm_73uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x73 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_73uint64_highword_reg>:
movabs $0x7300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_73uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 493921239040
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct type {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct type const *type_get_or_create(int /*<<< orphan*/);
int /*<<< orphan*/ type_new_function_type(struct type const *,
                                          struct list const *);
const struct type *type_get_function_type(const struct type *return_type,
                                          const struct list *type_param_list) {
  return type_get_or_create(
      type_new_function_type(return_type, type_param_list));
}


x86 assembly (clang, -O0):
<type_get_function_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <type_new_function_type@plt>
mov    %eax,%edi
call   1030 <type_get_or_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_get_function_type>:
push   %rax
call   1040 <type_new_function_type@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <type_get_or_create@plt>

LLVM IR (-O0):
%struct.type = type { i32 }
%struct.list = type { i32 }
define %struct.type* @type_get_function_type(%struct.type* %0, %struct.list* %1) {
%3 = alloca %struct.type*
%4 = alloca %struct.list*
store %struct.type* %0, %struct.type** %3
store %struct.list* %1, %struct.list** %4
%5 = load %struct.type*, %struct.type** %3
%6 = load %struct.list*, %struct.list** %4
%7 = call i32 @type_new_function_type(%struct.type* %5, %struct.list* %6)
%8 = call %struct.type* @type_get_or_create(i32 %7)
ret %struct.type* %8
}

LLVM IR (-O2):
%struct.type = type { i32 }
%struct.list = type { i32 }
define %struct.type* @type_get_function_type(%struct.type* %0, %struct.list* %1) {
%3 = tail call i32 @type_new_function_type(%struct.type* %0, %struct.list* %1)
%4 = tail call %struct.type* @type_get_or_create(i32 %3)
ret %struct.type* %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t vga_get_color(uint8_t text, uint8_t background) {
  return (background << 4) | text;
}


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

x86 assembly (clang, -O2):
<vga_get_color>:
mov    %esi,%eax
shl    $0x4,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @vga_get_color(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 4
%7 = load i32, i32* %3
%8 = or i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @vga_get_color(i32 %0, i32 %1) {
%3 = shl i32 %1, 4
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int ft_printf_c(char c) {
  ft_putchar(c);
  return (1);
}


x86 assembly (clang, -O0):
<ft_printf_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <ft_putchar@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_printf_c>:
push   %rax
call   1030 <ft_putchar@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ft_printf_c(i8 signext %0) {
%2 = tail call i32 @ft_putchar(i8 signext %0)
ret i32 1
}
int test_imm_4Fint16_mem(short *val) {
  return ((*val) & (-0x4F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Fint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffffb1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Fint16_mem>:
movzwl (%rdi),%eax
test   $0xffb1,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Fint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -79
%7 = icmp ne i32 %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_4Fint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -79
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ rcu_irq_enter();
void irq_enter(void) { rcu_irq_enter(); }


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

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

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

LLVM IR (-O2):
define void @irq_enter() {
%1 = tail call i32 (...) @rcu_irq_enter()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StrMaxCpy(char *, char const *, size_t);
size_t strlen(char *);
char *StrMaxCat(char *dst, const char *src, size_t maxLen) {
  size_t dstLen = strlen(dst);
  if (dstLen < maxLen) {
    StrMaxCpy(&dst[dstLen], src, maxLen - dstLen);
  }
  return dst;
}


x86 assembly (clang, -O0):
<StrMaxCat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1168 <StrMaxCat+0x48>
mov    -0x8(%rbp),%rdi
add    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    -0x20(%rbp),%rdx
call   1040 <StrMaxCpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrMaxCat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
call   1030 <strlen@plt>
cmp    %rbx,%rax
jae    114a <StrMaxCat+0x2a>
lea    (%r14,%rax,1),%rdi
sub    %rax,%rbx
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <StrMaxCpy@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @StrMaxCat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %7
%10 = load i64, i64* %7
%11 = load i64, i64* %6
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %22
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = load i64, i64* %7
%16 = getelementptr inbounds i8, i8* %14, i64 %15
%17 = load i8*, i8** %5
%18 = load i64, i64* %6
%19 = load i64, i64* %7
%20 = sub i64 %18, %19
%21 = call i32 @StrMaxCpy(i8* %16, i8* %17, i64 %20)
br label %22
22: ; preds = %13, %3
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @StrMaxCat(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp ult i64 %4, %2
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 %4
%8 = sub i64 %2, %4
%9 = tail call i32 @StrMaxCpy(i8* %7, i8* %1, i64 %8)
br label %10
10: ; preds = %6, %3
ret i8* %0
}
void clear_screen(char (*screen)[40]) {
  int i, j;
  for (i = 0; i < 40; i++) {
    for (j = 0; j < 4; j++) {
      screen[j][i] = ' ';
    }
  }
}


x86 assembly (clang, -O0):
<clear_screen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x28,-0xc(%rbp)
jge    1162 <clear_screen+0x62>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    114f <clear_screen+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <clear_screen+0x20>
jmp    1154 <clear_screen+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clear_screen+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_screen>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x90(%rdi)
movups %xmm0,0x80(%rdi)
movups %xmm0,0x70(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @clear_screen([40 x i8]* nocapture writeonly %0) {
%2 = getelementptr [40 x i8], [40 x i8]* %0, i64 0, i64 0
ret void
}
unsigned int ticks_to_usecs(unsigned int t) {
  t *= 61;
  return (t / 2);
}


x86 assembly (clang, -O0):
<ticks_to_usecs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3d,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ticks_to_usecs>:
imul   $0x3d,%edi,%eax
shr    %eax
ret

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

LLVM IR (-O2):
define i32 @ticks_to_usecs(i32 %0) {
%2 = mul i32 %0, 61
%3 = lshr i32 %2, 1
ret i32 %3
}
void f1(void) {
  int x, y, z;
#pragma unused(x)
#pragma unused(y, z)
  int w;
#pragma unused w
}


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

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

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
ret void
}

LLVM IR (-O2):
define void @f1() {
ret void
}
int fmTestCard(int errorLevel) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fmTestCard(i32 %0) {
ret i32 0
}
unsigned short inportw(unsigned short _port) {
  unsigned short rv;
  asm volatile("inw %1, %0" : "=a"(rv) : "dN"(_port));
  return rv;
}


x86 assembly (clang, -O0):
<inportw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inportw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define zeroext i16 @inportw(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inportw(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main(void) {
  char buf[1024] = {};
  fgets(buf, 1024, stdin);
  int n = strlen(buf);
  buf[n - 1] = 0;
  puts(buf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x400(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
lea    -0x400(%rbp),%rdi
mov    0x2e7c(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1060 <fgets@plt>
lea    -0x400(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x404(%rbp)
mov    -0x404(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,-0x400(%rbp,%rax,1)
lea    -0x400(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1060 <fgets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca i32
%3 = bitcast [1024 x i8]* %1 to i8*
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 1024, i32 %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %11
store i8 0, i8* %12
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%14 = call i32 @puts(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 1024, i32 %3)
%5 = call i32 @strlen(i8* %2)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %7
store i8 0, i8* %8
%9 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int f();
int main() {
  if (f() != 0x93)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f@plt>
cmp    $0x93,%eax
je     1158 <main+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
cmp    $0x93,%eax
jne    1146 <main+0x16>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = icmp ne i32 %2, 147
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = icmp eq i32 %1, 147
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_timestamp_t;
typedef int /*<<< orphan*/ xcb_connection_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ xembed_message_send(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/);
void xembed_embedded_notify(xcb_connection_t *c, xcb_window_t client,
                            xcb_timestamp_t timestamp, xcb_window_t embedder,
                            uint32_t version) {
  xembed_message_send(c, client, timestamp, 0, 0, embedder, version);
}


x86 assembly (clang, -O0):
<xembed_embedded_notify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%r9d
mov    -0x18(%rbp),%eax
xor    %r8d,%r8d
mov    %r8d,%ecx
mov    %eax,(%rsp)
call   1030 <xembed_message_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xembed_embedded_notify>:
push   %rax
mov    %ecx,%r9d
mov    %r8d,(%rsp)
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <xembed_message_send@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @xembed_embedded_notify(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @xembed_message_send(i32* %11, i32 %12, i32 %13, i32 0, i32 0, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @xembed_embedded_notify(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @xembed_message_send(i32* %0, i32 %1, i32 %2, i32 0, i32 0, i32 %3, i32 %4)
ret void
}
long long r4(void *x) { return *(long long *)(x + 32764); }


x86 assembly (clang, -O0):
<r4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x7ffc(%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r4>:
mov    0x7ffc(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @r4(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32764
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @r4(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32764
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
void wpas_dbus_register_p2p_group(struct wpa_supplicant *wpa_s,
                                  struct wpa_ssid *ssid) {}


x86 assembly (clang, -O0):
<wpas_dbus_register_p2p_group>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wpa_ssid = type opaque
define void @wpas_dbus_register_p2p_group(%struct.wpa_supplicant* %0, %struct.wpa_ssid* %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca %struct.wpa_ssid*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store %struct.wpa_ssid* %1, %struct.wpa_ssid** %4
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wpa_ssid = type opaque
define void @wpas_dbus_register_p2p_group(%struct.wpa_supplicant* nocapture %0, %struct.wpa_ssid* nocapture %1) {
ret void
}
/* Variables and functions */
char *strchr(char *, char);
void zero_comma(char *str) {
  char *comma_pos;
  comma_pos = strchr(str, ',');
  if (comma_pos != NULL) {
    *comma_pos = '\0';
  }
}


x86 assembly (clang, -O0):
<zero_comma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <zero_comma+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_comma>:
push   %rax
mov    $0x2c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <zero_comma+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @zero_comma(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 44)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @zero_comma(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 44)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
adr0adrreg1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((*((int *)10000000)) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0adrreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0x989680,%eax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    0x10f444(%rcx),%eax
jg     113b <adr0adrreg1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <adr0adrreg1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adrreg1>:
mov    0x989680,%ecx
xor    %eax,%eax
cmp    0x10f444(%r9),%ecx
setle  %al
ret

LLVM IR (-O0):
define i32 @adr0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* inttoptr (i64 10000000 to i32*)
%15 = load i32*, i32** %13
%16 = getelementptr inbounds i32, i32* %15, i64 277777
%17 = load i32, i32* %16
%18 = icmp sle i32 %14, %17
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @adr0adrreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = load i32, i32* inttoptr (i64 10000000 to i32*)
%8 = getelementptr inbounds i32, i32* %5, i64 277777
%9 = load i32, i32* %8
%10 = icmp sle i32 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int getch();
int GetCharacter() { return getch(); }


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

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

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

LLVM IR (-O2):
define i32 @GetCharacter() {
%1 = tail call i32 (...) @getch()
ret i32 %1
}
/* Variables and functions */
scalar_t__ compare(char *, char *);
char *compare_equal_emptyString() {
  do {
    if (!(compare("", "") == 0))
      return "Compare empty equal string";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<compare_equal_emptyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xefb(%rip),%rsi
mov    %rsi,%rdi
call   1030 <compare@plt>
cmp    $0x0,%rax
je     1141 <compare_equal_emptyString+0x31>
lea    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <compare_equal_emptyString+0x3e>
jmp    1146 <compare_equal_emptyString+0x36>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_equal_emptyString>:
push   %rax
lea    0xf02(%rip),%rdi
mov    %rdi,%rsi
call   1030 <compare@plt>
test   %rax,%rax
lea    0xed6(%rip),%rcx
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [27 x i8] c"Compare empty equal string\00"
define i8* @compare_equal_emptyString() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i64 @compare(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %2
br label %7
7: ; preds = %6
store i8* null, i8** %1
br label %8
8: ; preds = %7, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [27 x i8] c"Compare empty equal string\00"
define i8* @compare_equal_emptyString() {
%1 = tail call i64 @compare(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
void HTTP_flush_read_buffer(int sock) {}


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

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

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

LLVM IR (-O2):
define void @HTTP_flush_read_buffer(i32 %0) {
ret void
}
void STEAM_RegisterAppProgressCallback(void (*fpProgCallBack)(void), int freq) {
}


x86 assembly (clang, -O0):
<STEAM_RegisterAppProgressCallback>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @STEAM_RegisterAppProgressCallback(void ()* nocapture %0, i32 %1) {
ret void
}