xunge/DecIR huggingface dataset:
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perror(char *);
void closefd(int fd) {
  if (close(fd) == -1) {
    perror("close");
  }
}


x86 assembly (clang, -O0):
<closefd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1148 <closefd+0x28>
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closefd>:
push   %rax
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     112d <closefd+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"close\00"
define void @closefd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"close\00"
define void @closefd(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_start_tx();
int /*<<< orphan*/ serial_write_char(char);
int serial_put_char(char c) {
  if (!serial_write_char(c)) {
    serial_start_tx();
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<serial_put_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <serial_write_char@plt>
cmp    $0x0,%eax
jne    1153 <serial_put_char+0x33>
mov    $0x0,%al
call   1040 <serial_start_tx@plt>
movl   $0x0,-0x4(%rbp)
jmp    115a <serial_put_char+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_put_char>:
push   %rbx
call   1030 <serial_write_char@plt>
mov    $0xffffffff,%ebx
test   %eax,%eax
jne    1138 <serial_put_char+0x18>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <serial_start_tx@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @serial_put_char(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i32 @serial_write_char(i8 signext %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 (...) @serial_start_tx()
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @serial_put_char(i8 signext %0) {
%2 = tail call i32 @serial_write_char(i8 signext %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @serial_start_tx()
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
char *stringLocal(void) {
  char str[] = "Hello world";
  return str;
}


x86 assembly (clang, -O0):
<stringLocal>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xef3(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLocal>:
lea    -0xc(%rsp),%rax
ret

LLVM IR (-O0):
@__const.stringLocal.str = [12 x i8] c"Hello world\00"
define i8* @stringLocal() {
%1 = alloca [12 x i8]
%2 = bitcast [12 x i8]* %1 to i8*
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @stringLocal() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
ret i8* %2
}
/* Type definitions */
struct Cyc_Set_Set {
  int dummy;
};

/* Variables and functions */
struct Cyc_Set_Set *Cyc_AssnDef_assn_fr_logicvar(void *);
int Cyc_Set_member(struct Cyc_Set_Set *, void *);
int Cyc_AssnDef_logicvar_in_assn(void *lvar, void *a) {
  int _T0;
  struct Cyc_Set_Set *lvset = Cyc_AssnDef_assn_fr_logicvar(a);
  _T0 = Cyc_Set_member(lvset, lvar);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_AssnDef_logicvar_in_assn>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <Cyc_AssnDef_assn_fr_logicvar@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <Cyc_Set_member@plt>

LLVM IR (-O0):
%struct.Cyc_Set_Set = type { i32 }
define i32 @Cyc_AssnDef_logicvar_in_assn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.Cyc_Set_Set*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call %struct.Cyc_Set_Set* @Cyc_AssnDef_assn_fr_logicvar(i8* %7)
store %struct.Cyc_Set_Set* %8, %struct.Cyc_Set_Set** %6
%9 = load %struct.Cyc_Set_Set*, %struct.Cyc_Set_Set** %6
%10 = load i8*, i8** %3
%11 = call i32 @Cyc_Set_member(%struct.Cyc_Set_Set* %9, i8* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
%struct.Cyc_Set_Set = type { i32 }
define i32 @Cyc_AssnDef_logicvar_in_assn(i8* %0, i8* %1) {
%3 = tail call %struct.Cyc_Set_Set* @Cyc_AssnDef_assn_fr_logicvar(i8* %1)
%4 = tail call i32 @Cyc_Set_member(%struct.Cyc_Set_Set* %3, i8* %0)
ret i32 %4
}
/* Variables and functions */
int inToCm(float);
float inToM(float in) { return inToCm(in) / 100; }


x86 assembly (clang, -O0):
<inToM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <inToCm@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inToM>:
push   %rax
call   1030 <inToCm@plt>
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @inToM(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @inToCm(float %3)
%5 = sdiv i32 %4, 100
%6 = sitofp i32 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @inToM(float %0) {
%2 = tail call i32 @inToCm(float %0)
%3 = sdiv i32 %2, 100
%4 = sitofp i32 %3 to float
ret float %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t stun_make_type(uint16_t method) {
  method = method & 0x0FFF;
  return ((method & 0x000F) | ((method & 0x0070) << 1) |
          ((method & 0x0380) << 2) | ((method & 0x0C00) << 2));
}


x86 assembly (clang, -O0):
<stun_make_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    -0x4(%rbp),%ecx
and    $0x70,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x380,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xc00,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stun_make_type>:
mov    %edi,%ecx
lea    0x0(,%rdi,4),%eax
and    $0xf,%edi
and    $0x70,%ecx
lea    (%rdi,%rcx,2),%ecx
mov    %eax,%edx
and    $0xe00,%edx
or     %ecx,%edx
and    $0x3000,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @stun_make_type(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 4095
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 15
%7 = load i32, i32* %2
%8 = and i32 %7, 112
%9 = shl i32 %8, 1
%10 = or i32 %6, %9
%11 = load i32, i32* %2
%12 = and i32 %11, 896
%13 = shl i32 %12, 2
%14 = or i32 %10, %13
%15 = load i32, i32* %2
%16 = and i32 %15, 3072
%17 = shl i32 %16, 2
%18 = or i32 %14, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @stun_make_type(i32 %0) {
%2 = and i32 %0, 15
%3 = shl i32 %0, 1
%4 = and i32 %3, 224
%5 = or i32 %4, %2
%6 = shl i32 %0, 2
%7 = and i32 %6, 3584
%8 = or i32 %5, %7
%9 = and i32 %6, 12288
%10 = or i32 %8, %9
ret i32 %10
}
int dlaset(char uplo, int m, int n, double alpha, double beta, double *A,
           int lda) {
  extern int dlaset_(char *uplo, int *m, int *n, double *alpha, double *beta,
                     double *A, int *lda);
  return dlaset_(&uplo, &m, &n, &alpha, &beta, A, &lda);
}


x86 assembly (clang, -O0):
<dlaset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x28(%rbp),%r9
lea    -0x1(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x20(%rbp),%r8
lea    -0x2c(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <dlaset_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlaset>:
sub    $0x28,%rsp
mov    %rcx,%r9
mov    %dil,0xb(%rsp)
mov    %esi,0x14(%rsp)
mov    %edx,0x10(%rsp)
movsd  %xmm0,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
mov    %r8d,0xc(%rsp)
lea    0xc(%rsp),%rax
mov    %rax,(%rsp)
lea    0xb(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x20(%rsp),%rcx
lea    0x18(%rsp),%r8
call   1030 <dlaset_@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @dlaset(i8 signext %0, i32 %1, i32 %2, double %3, double %4, double* %5, i32 %6) {
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double*
%14 = alloca i32
store i8 %0, i8* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store double %3, double* %11
store double %4, double* %12
store double* %5, double** %13
store i32 %6, i32* %14
%15 = load double*, double** %13
%16 = call i32 @dlaset_(i8* %8, i32* %9, i32* %10, double* %11, double* %12, double* %15, i32* %14)
ret i32 %16
}

LLVM IR (-O2):
define i32 @dlaset(i8 signext %0, i32 %1, i32 %2, double %3, double %4, double* %5, i32 %6) {
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca i32
store i8 %0, i8* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store double %3, double* %11
store double %4, double* %12
store i32 %6, i32* %13
%14 = call i32 @dlaset_(i8* %8, i32* %9, i32* %10, double* %11, double* %12, double* %5, i32* %13)
ret i32 %14
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c)) {
    return c - 'A' + 'a';
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113e <tolower+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <tolower+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isupper(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 65
%10 = add nsw i32 %9, 97
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
struct zip_source {
  int dummy;
};
struct zip_error {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _zip_error_set(struct zip_error *, int, int);
int /*<<< orphan*/ zip_source_error(struct zip_source *, int *, int *);
void _zip_error_set_from_source(struct zip_error *err, struct zip_source *src) {
  int ze, se;
  zip_source_error(src, &ze, &se);
  _zip_error_set(err, ze, se);
}


x86 assembly (clang, -O0):
<_zip_error_set_from_source>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <zip_source_error@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <_zip_error_set@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zip_error_set_from_source>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
call   1040 <zip_source_error@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1030 <_zip_error_set@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.zip_error = type { i32 }
%struct.zip_source = type { i32 }
define void @_zip_error_set_from_source(%struct.zip_error* %0, %struct.zip_source* %1) {
%3 = alloca %struct.zip_error*
%4 = alloca %struct.zip_source*
%5 = alloca i32
%6 = alloca i32
store %struct.zip_error* %0, %struct.zip_error** %3
store %struct.zip_source* %1, %struct.zip_source** %4
%7 = load %struct.zip_source*, %struct.zip_source** %4
%8 = call i32 @zip_source_error(%struct.zip_source* %7, i32* %5, i32* %6)
%9 = load %struct.zip_error*, %struct.zip_error** %3
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @_zip_error_set(%struct.zip_error* %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.zip_error = type { i32 }
%struct.zip_source = type { i32 }
define void @_zip_error_set_from_source(%struct.zip_error* %0, %struct.zip_source* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @zip_source_error(%struct.zip_source* %1, i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @_zip_error_set(%struct.zip_error* %0, i32 %8, i32 %9)
ret void
}
/* Variables and functions */
double EvalAngCor_alpha0_0plus_0plus_15097_L0(double);
double funcAngCor_alpha0_0plus_0plus_15097_L0(double *x, double *par) {
  double result;
  result = par[0] * EvalAngCor_alpha0_0plus_0plus_15097_L0(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngCor_alpha0_0plus_0plus_15097_L0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngCor_alpha0_0plus_0plus_15097_L0@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngCor_alpha0_0plus_0plus_15097_L0>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngCor_alpha0_0plus_0plus_15097_L0@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngCor_alpha0_0plus_0plus_15097_L0(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngCor_alpha0_0plus_0plus_15097_L0(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngCor_alpha0_0plus_0plus_15097_L0(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngCor_alpha0_0plus_0plus_15097_L0(double %4)
%6 = fmul double %3, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xa2() {
  Assert_real((isdigit(162) == 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_isdigit.c",
              815, ("isdigit should be 0 for 0xa2"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xa2>:
push   %rax
mov    $0xa2,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x32f,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xa2\00"
define void @t_isdigit_0xa2() {
%1 = call i64 @isdigit(i32 162)
%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 815, i8* getelementptr inbounds ([29 x i8], [29 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xa2\00"
define void @t_isdigit_0xa2() {
%1 = tail call i64 @isdigit(i32 162)
%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 815, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ts_packet_get_cont(uint8_t *ts_packet) {
  return (ts_packet[3] & ~0xF0);
}


x86 assembly (clang, -O0):
<ts_packet_get_cont>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0xffffff0f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_packet_get_cont>:
mov    $0xffffff0f,%eax
and    0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ts_packet_get_cont(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = and i32 %5, -241
ret i32 %6
}

LLVM IR (-O2):
define i32 @ts_packet_get_cont(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = and i32 %3, -241
ret i32 %4
}
int calculate_tapered_eval(int phase, int score_mg, int score_eg) {
  return ((score_mg * (256 - phase)) + (score_eg * phase)) / 256;
}


x86 assembly (clang, -O0):
<calculate_tapered_eval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x100,%ecx
sub    -0x4(%rbp),%ecx
imul   %ecx,%eax
mov    -0xc(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    %ecx,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_tapered_eval>:
mov    $0x100,%ecx
sub    %edi,%ecx
imul   %esi,%ecx
imul   %edi,%edx
lea    (%rdx,%rcx,1),%eax
add    $0xff,%eax
add    %ecx,%edx
cmovns %edx,%eax
sar    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @calculate_tapered_eval(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = sub nsw i32 256, %8
%10 = mul nsw i32 %7, %9
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = mul nsw i32 %11, %12
%14 = add nsw i32 %10, %13
%15 = sdiv i32 %14, 256
ret i32 %15
}

LLVM IR (-O2):
define i32 @calculate_tapered_eval(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 256, %0
%5 = mul nsw i32 %4, %1
%6 = mul nsw i32 %2, %0
%7 = add nsw i32 %6, %5
%8 = sdiv i32 %7, 256
ret i32 %8
}
int do_389() { return 389; }


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

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

LLVM IR (-O0):
define i32 @do_389() {
ret i32 389
}

LLVM IR (-O2):
define i32 @do_389() {
ret i32 389
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xe8() {
  Assert_real((isbdigit(232) == 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_isbdigit.c",
              1165, ("isbdigit should be 0 for 0xe8"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xe8>:
push   %rax
mov    $0xe8,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x48d,%edx
pop    %rax
jmp    1030 <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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xe8\00"
define void @t_isbdigit_0xe8() {
%1 = call i64 @isbdigit(i32 232)
%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 1165, i8* getelementptr inbounds ([30 x i8], [30 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xe8\00"
define void @t_isbdigit_0xe8() {
%1 = tail call i64 @isbdigit(i32 232)
%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 1165, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int lace_builtin_zec_main(unsigned int, char **, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *);
int lace_main_zec(unsigned argc, char **argv) {
  return lace_builtin_zec_main(argc, argv, NULL, NULL);
}


x86 assembly (clang, -O0):
<lace_main_zec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <lace_builtin_zec_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lace_main_zec>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <lace_builtin_zec_main@plt>

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

LLVM IR (-O2):
define i32 @lace_main_zec(i32 %0, i8** %1) {
%3 = tail call i32 @lace_builtin_zec_main(i32 %0, i8** %1, i32* null, i32* null)
ret i32 %3
}
void INT_Excep_PERIB_INTB185(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB185() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, unsigned char, int);
void memset_io(volatile void *addr, unsigned char val, int count) {
  memset((void *)addr, val, count);
}


x86 assembly (clang, -O0):
<memset_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%edx
movzbl %al,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset_io>:
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @memset_io(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %5
%9 = load i32, i32* %6
%10 = call i32 @memset(i8* %7, i8 zeroext %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @memset_io(i8* %0, i8 zeroext %1, i32 %2) {
%4 = tail call i32 @memset(i8* %0, i8 zeroext %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ parse_size_str(char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
uint64_t get_param_input() {
  char input[14];
  fgets(&input[0], 14, stdin);
  input[strlen(input) - 1] = 0;
  return parse_size_str(input);
}


x86 assembly (clang, -O0):
<get_param_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xe(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
mov    $0xe,%esi
call   1040 <fgets@plt>
lea    -0xe(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0xe(%rbp,%rax,1)
lea    -0xe(%rbp),%rdi
call   1050 <parse_size_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_param_input>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
lea    0x2(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xe,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
call   1050 <parse_size_str@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@stdin = global i32 0
define i32 @get_param_input() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 14, i32 %3)
%5 = call i32 @strlen(i8* %2)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 %7
store i8 0, i8* %8
%9 = call i32 @parse_size_str(i8* %2)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int wait_posedge(void *data) { printf("Posedge.\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"Posedge.\00"
define i32 @wait_posedge(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, ...);
int ker_call(int call_nr, int src, void *m_ptr) {
  int result = 0;
  kprintf("kernel call is working.\n");
  kprintf("paras: %d %d %d\n", call_nr, src, m_ptr);
  return result;
}


x86 assembly (clang, -O0):
<ker_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <kprintf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <kprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ker_call>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xede(%rip),%rdi
xor    %eax,%eax
call   1030 <kprintf@plt>
lea    0xee9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <kprintf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"kernel call is working.\0A\00"
@.str.1 = [17 x i8] c"paras: %d %d %d\0A\00"
define i32 @ker_call(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i32 0, i32* %7
%8 = call i32 (i8*, ...) @kprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) @kprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10, i8* %11)
%13 = load i32, i32* %7
ret i32 %13
}

LLVM IR (-O2):
@.str = [25 x i8] c"kernel call is working.\0A\00"
@.str.1 = [17 x i8] c"paras: %d %d %d\0A\00"
define i32 @ker_call(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 (i8*, ...) @kprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @kprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1, i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void convertAndPrintNumber(int number, int positions) {
  char str[positions];
  sprintf(str, "%d", number);
  printf(str);
}


x86 assembly (clang, -O0):
<convertAndPrintNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edx
lea    0xea2(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertAndPrintNumber>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %edi,%edx
mov    %esi,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @convertAndPrintNumber(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = load i32, i32* %3
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @printf(i8* %10)
%14 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @convertAndPrintNumber(i32 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = alloca i8, i64 %3
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = call i32 @printf(i8* %4)
ret void
}
int d_bgt_mr1(double *a1, double a2) { return (__builtin_isgreater(*a1, a2)); }


x86 assembly (clang, -O0):
<d_bgt_mr1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bgt_mr1>:
movsd  (%rdi),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @d_bgt_mr1(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* %5
%7 = load double, double* %4
%8 = fcmp ogt double %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_bgt_mr1(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ogt double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int max_water_surface(int, int, int **);
int test_all_water() {
  int map[5][5] = {{0, 0, 0, 0, 0},
                   {0, 0, 0, 0, 0},
                   {0, 0, 0, 0, 0},
                   {0, 0, 0, 0, 0},
                   {0, 0, 0, 0, 0}};
  return 25 == max_water_surface(5, 5, map);
}


x86 assembly (clang, -O0):
<test_all_water>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1030 <memset@plt>
lea    -0x70(%rbp),%rdx
mov    $0x5,%esi
mov    %esi,%edi
call   1040 <max_water_surface@plt>
mov    %eax,%ecx
mov    $0x19,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all_water>:
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    %rsp,%rdx
mov    $0x5,%edi
mov    $0x5,%esi
call   1030 <max_water_surface@plt>
xor    %ecx,%ecx
cmp    $0x19,%eax
sete   %cl
mov    %ecx,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @test_all_water() {
%1 = alloca [5 x [5 x i32]]
%2 = bitcast [5 x [5 x i32]]* %1 to i8*
%3 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 0
%4 = bitcast [5 x i32]* %3 to i32**
%5 = call i32 @max_water_surface(i32 5, i32 5, i32** %4)
%6 = icmp eq i32 25, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_all_water() {
%1 = alloca [5 x [5 x i32]]
%2 = bitcast [5 x [5 x i32]]* %1 to i8*
%3 = bitcast [5 x [5 x i32]]* %1 to i32**
%4 = call i32 @max_water_surface(i32 5, i32 5, i32** %3)
%5 = icmp eq i32 %4, 25
%6 = zext i1 %5 to i32
ret i32 %6
}
__attribute__((always_)) int pcie_aspm_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pcie_aspm_enabled() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *uwsgi_malloc(int);
char *uwsgi_num2str(int num) {
  char *str = uwsgi_malloc(11);
  snprintf(str, 11, "%d", num);
  return str;
}


x86 assembly (clang, -O0):
<uwsgi_num2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xb,%edi
call   1040 <uwsgi_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0xb,%esi
lea    0xeb4(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_num2str>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xb,%edi
call   1040 <uwsgi_malloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rdx
mov    %rax,%rdi
mov    $0xb,%esi
mov    %ebp,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @uwsgi_num2str(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @uwsgi_malloc(i32 11)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* %2
%7 = call i32 @snprintf(i8* %5, i32 11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @uwsgi_num2str(i32 %0) {
%2 = tail call i8* @uwsgi_malloc(i32 11)
%3 = tail call i32 @snprintf(i8* %2, i32 11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int main() {
  int i[10];
  foo(i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%3 = call i32 @foo(i32* %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int f3(int x, int y, int z) {
  printf("f3 received: %d %d %d\n", x, y, z);
  return (x * y) + z;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xede(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <printf@plt>
imul   %ebx,%ebp
add    %r14d,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"f3 received: %d %d %d\0A\00"
define i32 @f3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
@.str = [23 x i8] c"f3 received: %d %d %d\0A\00"
define i32 @f3(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
%5 = mul nsw i32 %1, %0
%6 = add nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strerr_die(int, char *, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void usage() {
  strerr_die((100),
             ("setlock: usage: setlock [ -nNxX ] file program [ arg ... ]"), 0,
             0, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
lea    0xedc(%rip),%rsi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <strerr_die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x64,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <strerr_die@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [59 x i8] c"setlock: usage: setlock [ -nNxX ] file program [ arg ... ]\00"
define void @usage() {
%1 = call i32 @strerr_die(i32 100, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"setlock: usage: setlock [ -nNxX ] file program [ arg ... ]\00"
define void @usage() {
%1 = tail call i32 @strerr_die(i32 100, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
void Strupr(str) char *str;
{
  while (*str) {
    *str = toupper(*str);
    ++str;
  }
  return;
}


x86 assembly (clang, -O0):
<Strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <Strupr+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <Strupr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strupr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <Strupr+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <Strupr+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @Strupr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = call i32 @toupper(i32 %10)
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %2
store i8 %12, i8* %13
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @Strupr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @toupper(i32 %7)
%9 = trunc i32 %8 to i8
store i8 %9, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int, int);
uint8_t *ts_section_data_alloc_section() {
  uint8_t *data = malloc(4096);
  memset(data, 0x30, 4096);
  return data;
}


x86 assembly (clang, -O0):
<ts_section_data_alloc_section>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x30,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_section_data_alloc_section>:
push   %rbx
mov    $0x1000,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x30,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @ts_section_data_alloc_section() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 4096)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @memset(i32* %3, i32 48, i32 4096)
%5 = load i32*, i32** %1
ret i32* %5
}

LLVM IR (-O2):
define i32* @ts_section_data_alloc_section() {
%1 = tail call i32* @malloc(i32 4096)
%2 = tail call i32 @memset(i32* %1, i32 48, i32 4096)
ret i32* %1
}
/* Type definitions */
typedef size_t uint;

/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void os_get_random(char *s, size_t length) {
  uint i;
  srand(time(NULL));
  for (i = 0; i < length; i++) {
    s[i] = rand() % 256;
  }
}


x86 assembly (clang, -O0):
<os_get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1191 <os_get_random+0x61>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1158 <os_get_random+0x28>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_get_random>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
test   %r15,%r15
je     1164 <os_get_random+0x34>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1150 <os_get_random+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @os_get_random(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
store i64 0, i64* %5
br label %8
8: ; preds = %19, %2
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = call i32 (...) @rand()
%14 = srem i32 %13, 256
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = load i64, i64* %5
%18 = getelementptr inbounds i8, i8* %16, i64 %17
store i8 %15, i8* %18
br label %19
19: ; preds = %12
%20 = load i64, i64* %5
%21 = add i64 %20, 1
store i64 %21, i64* %5
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @os_get_random(i8* nocapture writeonly %0, i64 %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = icmp eq i64 %1, 0
br i1 %5, label %13, label %6
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = tail call i32 (...) @rand()
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %9, i8* %10
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex32(int, unsigned int);
void print_notice_hex32(unsigned int value) { __console_tx_hex32(5, value); }


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

x86 assembly (clang, -O2):
<print_notice_hex32>:
mov    %edi,%esi
mov    $0x5,%edi
jmp    1030 <__console_tx_hex32@plt>

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

LLVM IR (-O2):
define void @print_notice_hex32(i32 %0) {
%2 = tail call i32 @__console_tx_hex32(i32 5, i32 %0)
ret void
}