xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isLower(int const);
scalar_t__ isUpper(int const);
int isAlpha(const int c) { return isLower(c) || isUpper(c); }


x86 assembly (clang, -O0):
<isAlpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isLower@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isAlpha+0x37>
mov    -0x4(%rbp),%edi
call   1040 <isUpper@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAlpha>:
push   %rbx
mov    %edi,%ebx
call   1030 <isLower@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isAlpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <isUpper@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isAlpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isLower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isUpper(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isAlpha(i32 %0) {
%2 = tail call i64 @isLower(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isUpper(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int link1(int n) { return n + 1; }


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

x86 assembly (clang, -O2):
<link1>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @link1(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XCrossingEvent;

/* Variables and functions */
void set_XCrossingEvent_y(void *_p, int _v) {
  ((XCrossingEvent *)_p)->y = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XCrossingEvent_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XCrossingEvent_y(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XCrossingEvent_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pprint(char *);
void yes_no(int condition) {
  if (condition)
    pprint("   yes    ");
  else
    pprint("   no     ");
}


x86 assembly (clang, -O0):
<yes_no>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <yes_no+0x26>
lea    0xed4(%rip),%rdi
call   1030 <pprint@plt>
jmp    1142 <yes_no+0x32>
lea    0xece(%rip),%rdi
call   1030 <pprint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yes_no>:
test   %edi,%edi
lea    0xef2(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <pprint@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c" yes \00"
@.str.1 = [11 x i8] c" no \00"
define void @yes_no(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @pprint(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/
passphrase_explicit_memset________________(char *, int /*<<< orphan*/, size_t);
__attribute__((optimize("-O0"))) void passphrase_wipe(char *ptr, size_t n) {
  passphrase_explicit_memset________________(ptr, 0, n);
}


x86 assembly (clang, -O0):
<passphrase_wipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <passphrase_explicit_memset________________@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<passphrase_wipe>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <passphrase_explicit_memset________________@plt>

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

LLVM IR (-O2):
define void @passphrase_wipe(i8* %0, i64 %1) {
%3 = tail call i32 @passphrase_explicit_memset________________(i8* %0, i32 0, i64 %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_clear_dobldobl_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(347, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_clear_dobldobl_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x15b,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_clear_dobldobl_solutions>:
mov    $0x15b,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_clear_dobldobl_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 347, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_clear_dobldobl_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 347, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *exe_name) {
  printf("Usage: %s [-c config] [-r log] [-d] [-f] [-v|-h]\n"
         " -c, --config         selects a different configuration file.\n"
         " -d, --debug          enables debug mode.\n"
         " -f, --foreground     run srvx in the foreground.\n"
         " -h, --help           prints this usage message.\n"
         " -k, --check          checks the configuration file's syntax.\n"
         " -r, --replay         replay a log file (for debugging).\n"
         " -v, --version        prints this program's version.\n",
         exe_name);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [425 x i8] c"Usage: %s [-c config] [-r log] [-d] [-f] [-v|-h]\0A -c, --config selects a different configuration file.\0A -d, --debug enables debug mode.\0A -f, --foreground run srvx in the foreground.\0A -h, --help prints this usage message.\0A -k, --check checks the configuration file's syntax.\0A -r, --replay replay a log file (for debugging).\0A -v, --version prints this program's version.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([425 x i8], [425 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [425 x i8] c"Usage: %s [-c config] [-r log] [-d] [-f] [-v|-h]\0A -c, --config selects a different configuration file.\0A -d, --debug enables debug mode.\0A -f, --foreground run srvx in the foreground.\0A -h, --help prints this usage message.\0A -k, --check checks the configuration file's syntax.\0A -r, --replay replay a log file (for debugging).\0A -v, --version prints this program's version.\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([425 x i8], [425 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double M_PI;
int fabs(double);
double sin(double);
double sinc(double x) {
  double arg = x * M_PI;
  if (fabs(arg) < 1e-10)
    return 1;
  return sin(arg) / arg;
}


x86 assembly (clang, -O0):
<sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    0x2eaf(%rip),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xea8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1174 <sinc+0x54>
movsd  0xe9e(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1188 <sinc+0x68>
movsd  -0x18(%rbp),%xmm0
call   1040 <sin@plt>
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinc>:
push   %rax
mov    0x2ec0(%rip),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <fabs@plt>
test   %eax,%eax
jle    114b <sinc+0x2b>
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret
movsd  0xead(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @sinc(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = load double, double* @M_PI
%7 = fmul double %5, %6
store double %7, double* %4
%8 = load double, double* %4
%9 = call i32 @fabs(double %8)
%10 = sitofp i32 %9 to double
%11 = fcmp olt double %10, 1.000000e-10
br i1 %11, label %12, label %13
12: ; preds = %1
store double 1.000000e+00, double* %2
br label %18
13: ; preds = %1
%14 = load double, double* %4
%15 = call double @sin(double %14)
%16 = load double, double* %4
%17 = fdiv double %15, %16
store double %17, double* %2
br label %18
18: ; preds = %13, %12
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @sinc(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = tail call i32 @fabs(double %3)
%5 = icmp slt i32 %4, 1
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call double @sin(double %3)
%8 = fdiv double %7, %3
br label %9
9: ; preds = %1, %6
%10 = phi double [ %8, %6 ], [ 1.000000e+00, %1 ]
ret double %10
}
/* Variables and functions */
double vabs(double *);
void unit(double *r) {
  double d;
  d = vabs(r);
  r[0] /= d;
  r[1] /= d;
  r[2] /= d;
}


x86 assembly (clang, -O0):
<unit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vabs@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unit>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vabs@plt>
movupd (%rbx),%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movupd %xmm1,(%rbx)
movsd  0x10(%rbx),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @unit(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = call double @vabs(double* %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = fdiv double %9, %6
store double %10, double* %8
%11 = load double, double* %3
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fdiv double %14, %11
store double %15, double* %13
%16 = load double, double* %3
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = fdiv double %19, %16
store double %20, double* %18
ret void
}

LLVM IR (-O2):
define void @unit(double* %0) {
%2 = tail call double @vabs(double* %0)
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %2, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fdiv <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fdiv double %10, %2
store double %11, double* %9
ret void
}
void libera_matriz(char **M, int m) {
  int i;
  for (i = 0; i < m; i++) {
    free(M[i]);
  }
  free(M);
}


x86 assembly (clang, -O0):
<libera_matriz>:
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    1151 <libera_matriz+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <libera_matriz+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libera_matriz>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <libera_matriz+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <libera_matriz+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @libera_matriz(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool read_defect_data_10_is_glist_valid(uint8_t *data) {
  return data[1] & 0x08;
}


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

x86 assembly (clang, -O2):
<read_defect_data_10_is_glist_valid>:
mov    0x4(%rdi),%eax
and    $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @read_defect_data_10_is_glist_valid(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = and i32 %3, 8
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int getcpu_vdso(unsigned int *, unsigned int *, void *);
void getcpu_vdso_nofail(unsigned *cpu, unsigned *node, void *tcache) {
  int err;
  err = getcpu_vdso(cpu, node, tcache);
  if (err)
    error(EXIT_FAILURE, errno, "getcpu");
}


x86 assembly (clang, -O0):
<getcpu_vdso_nofail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <getcpu_vdso@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1170 <getcpu_vdso_nofail+0x50>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
lea    0xe95(%rip),%rdx
call   1040 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcpu_vdso_nofail>:
push   %rax
call   1030 <getcpu_vdso@plt>
test   %eax,%eax
je     1149 <getcpu_vdso_nofail+0x29>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdx
pop    %rax
jmp    1040 <error@plt>
pop    %rax
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [7 x i8] c"getcpu\00"
define void @getcpu_vdso_nofail(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
%8 = load i32*, i32** %4
%9 = load i32*, i32** %5
%10 = load i8*, i8** %6
%11 = call i32 @getcpu_vdso(i32* %8, i32* %9, i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %3
%15 = load i32, i32* @EXIT_FAILURE
%16 = load i32, i32* @errno
%17 = call i32 @error(i32 %15, i32 %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %14, %3
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@errno = global i32 0
@.str = [7 x i8] c"getcpu\00"
define void @getcpu_vdso_nofail(i32* %0, i32* %1, i8* %2) {
%4 = tail call i32 @getcpu_vdso(i32* %0, i32* %1, i8* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = load i32, i32* @EXIT_FAILURE
%8 = load i32, i32* @errno
%9 = tail call i32 @error(i32 %7, i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %6, %3
ret void
}
void create_erc5a_set_speed(int speed) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g_signal_get_invocation_hint() {
ret void
}
func2() {}


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

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

LLVM IR (-O0):
define i32 @func2() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @func2() {
ret i32 undef
}
void local() {
  void before_local_1(char);
  void before_local_2(char) __attribute__((overloadable));
  void before_local_3(char) __attribute__((overloadable));
  void after_local_1(char);
  void after_local_2(char) __attribute__((overloadable));
  void after_local_3(char) __attribute__((overloadable));
}


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

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

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

LLVM IR (-O2):
define void @local() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ skeleton_daemon();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int main() {
  skeleton_daemon();
  while (1) {
    syslog(LOG_NOTICE, "First daemon started.");
    sleep(200);
    break;
  }
  syslog(LOG_NOTICE, "First daemon terminated.");
  closelog();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <skeleton_daemon@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1050 <syslog@plt>
mov    $0xc8,%edi
call   1060 <sleep@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <skeleton_daemon@plt>
mov    0x2e91(%rip),%rbx
mov    (%rbx),%edi
lea    0xea8(%rip),%rsi
call   1050 <syslog@plt>
mov    $0xc8,%edi
call   1060 <sleep@plt>
mov    (%rbx),%edi
lea    0xea6(%rip),%rsi
call   1050 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
@.str = [22 x i8] c"First daemon started.\00"
@.str.1 = [25 x i8] c"First daemon terminated.\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @skeleton_daemon()
br label %3
3: ; preds = %0
%4 = load i32, i32* @LOG_NOTICE
%5 = call i32 @syslog(i32 %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @sleep(i32 200)
br label %7
7: ; preds = %3
%8 = load i32, i32* @LOG_NOTICE
%9 = call i32 @syslog(i32 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (...) @closelog()
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
@.str = [22 x i8] c"First daemon started.\00"
@.str.1 = [25 x i8] c"First daemon terminated.\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @skeleton_daemon()
%2 = load i32, i32* @LOG_NOTICE
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 200)
%5 = load i32, i32* @LOG_NOTICE
%6 = tail call i32 @syslog(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (...) @closelog()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ target_clear_breakpoint();
int /*<<< orphan*/ write_resp(int, char *);
void cmd_clear_breakpoint(int fd, const char *cmd) {
  target_clear_breakpoint();
  write_resp(fd, "OK");
}


x86 assembly (clang, -O0):
<cmd_clear_breakpoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <target_clear_breakpoint@plt>
mov    -0x4(%rbp),%edi
lea    0xec0(%rip),%rsi
call   1030 <write_resp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_clear_breakpoint>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <target_clear_breakpoint@plt>
lea    0xecf(%rip),%rsi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <write_resp@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
define void @cmd_clear_breakpoint(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 (...) @target_clear_breakpoint()
%6 = load i32, i32* %3
%7 = call i32 @write_resp(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
define void @cmd_clear_breakpoint(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @target_clear_breakpoint()
%4 = tail call i32 @write_resp(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xbf() {
  Assert_real((isxdigit(191) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              960, ("isxdigit should be 0 for 0xbf"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xbf\00"
define void @t_isxdigit_0xbf() {
%1 = call i64 @isxdigit(i32 191)
%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 960, 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xbf\00"
define void @t_isxdigit_0xbf() {
%1 = tail call i64 @isxdigit(i32 191)
%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 960, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int mailsem_internal_wait(struct mailsem_internal *s) { return -1; }


x86 assembly (clang, -O0):
<mailsem_internal_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mailsem_internal = type opaque
define i32 @mailsem_internal_wait(%struct.mailsem_internal* %0) {
%2 = alloca %struct.mailsem_internal*
store %struct.mailsem_internal* %0, %struct.mailsem_internal** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.mailsem_internal = type opaque
define i32 @mailsem_internal_wait(%struct.mailsem_internal* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *tor_malloc_(size_t);
void *tor_malloc_zero_(size_t size) {
  void *result = tor_malloc_(size);
  memset(result, 0, size);
  return result;
}


x86 assembly (clang, -O0):
<tor_malloc_zero_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <tor_malloc_@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tor_malloc_zero_>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <tor_malloc_@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @tor_malloc_zero_(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @tor_malloc_(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @tor_malloc_zero_(i64 %0) {
%2 = tail call i8* @tor_malloc_(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_getegid(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_getegid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_getegid>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_getegid(i32 %0, %struct.target* %1) {
%3 = alloca i32
%4 = alloca %struct.target*
%5 = alloca i8*
store i32 %0, i32* %3
store %struct.target* %1, %struct.target** %4
%6 = call i8* @malloc(i32 5)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @snprintf(i8* %7, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_getegid(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void notice(void) {
  printf("@(#) trim: tab manipulator\n");
  printf("@(#) $Id: trim.c,v 1.6 2016/02/21 04:04:12 lucio Exp $\n");
  printf("@(#) Copyright (C) 1988-2016 Lucio de Re\n");
  printf("@(#) Author (A) Lucio De Re, 2016.\n");
}


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

x86 assembly (clang, -O2):
<notice>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf22(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"@(#) trim: tab manipulator\0A\00"
@.str.1 = [56 x i8] c"@(#) $Id: trim.c,v 1.6 2016/02/21 04:04:12 lucio Exp $\0A\00"
@.str.2 = [42 x i8] c"@(#) Copyright (C) 1988-2016 Lucio de Re\0A\00"
@.str.3 = [36 x i8] c"@(#) Author (A) Lucio De Re, 2016.\0A\00"
define void @notice() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"@(#) trim: tab manipulator\00"
@str.4 = [55 x i8] c"@(#) $Id: trim.c,v 1.6 2016/02/21 04:04:12 lucio Exp $\00"
@str.5 = [41 x i8] c"@(#) Copyright (C) 1988-2016 Lucio de Re\00"
@str.6 = [35 x i8] c"@(#) Author (A) Lucio De Re, 2016.\00"
define void @notice() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *px_strndup(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *px_strdup(const char *s) {
  if (!s)
    return NULL;
  return px_strndup(s, strlen(s));
}


x86 assembly (clang, -O0):
<px_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <px_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1164 <px_strdup+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <px_strndup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<px_strdup>:
test   %rdi,%rdi
je     1139 <px_strdup+0x19>
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <px_strndup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @px_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %12
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
%11 = call i8* @px_strndup(i8* %8, i32 %10)
store i8* %11, i8** %2
br label %12
12: ; preds = %7, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @px_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i8* @px_strndup(i8* %0, i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %5, %3 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
void strtoupper(char *str) {
  int i;
  for (i = 0; i < strlen(str); ++i) {
    str[i] = toupper(str[i]);
  }
}


x86 assembly (clang, -O0):
<strtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <strtoupper+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <strtoupper+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoupper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <strtoupper+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <strtoupper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strtoupper(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *os_zmalloc(size_t size) {
  void *p = malloc(size);
  if (p != NULL)
    memset(p, 0, size);
  return p;
}


x86 assembly (clang, -O0):
<os_zmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <os_zmalloc+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_zmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <os_zmalloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @os_zmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int Pop();
int /*<<< orphan*/ ThingCount(int, int);
int CmdThingCount(void) {
  int tid;
  tid = Pop();
  ThingCount(Pop(), tid);
  return 0;
}


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

x86 assembly (clang, -O2):
<CmdThingCount>:
push   %rbx
xor    %eax,%eax
call   1040 <Pop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <Pop@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <ThingCount@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CmdThingCount() {
%1 = alloca i32
%2 = call i32 (...) @Pop()
store i32 %2, i32* %1
%3 = call i32 (...) @Pop()
%4 = load i32, i32* %1
%5 = call i32 @ThingCount(i32 %3, i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @CmdThingCount() {
%1 = tail call i32 (...) @Pop()
%2 = tail call i32 (...) @Pop()
%3 = tail call i32 @ThingCount(i32 %2, i32 %1)
ret i32 0
}
__attribute__((always_)) void cl_prefetch_nta(void *p) {
  asm volatile("prefetchnta (%0)\n\t" : : "r"(p) : "memory");
}


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

x86 assembly (clang, -O2):
<cl_prefetch_nta>:
prefetchnta (%rdi)
ret

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

LLVM IR (-O2):
define void @cl_prefetch_nta(i8* %0) {
tail call void asm sideeffect "prefetchnta ($0)\0A\09", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
unsigned int read_register(unsigned int);
unsigned int read_register_dataprocessing(unsigned int reg) {
  if (reg == 15) {
    return (0);
  } else {
    return (read_register(reg));
  }
}


x86 assembly (clang, -O0):
<read_register_dataprocessing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jne    1131 <read_register_dataprocessing+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113c <read_register_dataprocessing+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <read_register@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_register_dataprocessing>:
cmp    $0xf,%edi
jne    1118 <read_register_dataprocessing+0x8>
xor    %eax,%eax
ret
jmp    1030 <read_register@plt>

LLVM IR (-O0):
define i32 @read_register_dataprocessing(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 15
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @read_register(i32 %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @read_register_dataprocessing(i32 %0) {
%2 = icmp eq i32 %0, 15
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @read_register(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ rl_hl();
void opcb_16() { rl_hl(); }


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

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

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

LLVM IR (-O2):
define void @opcb_16() {
%1 = tail call i32 (...) @rl_hl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int spamsum_match(char *, char *);
int main(int argc, char *argv[]) {
  int result = spamsum_match(argv[1], argv[2]);
  printf("%d", result);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <spamsum_match@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ PROXY_POLICY_it;
PROXY_POLICY *PROXY_POLICY_new(void) {
  return (PROXY_POLICY *)ASN1_item_new(&PROXY_POLICY_it);
}


x86 assembly (clang, -O0):
<PROXY_POLICY_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PROXY_POLICY_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@PROXY_POLICY_it = global i32 0
define i32* @PROXY_POLICY_new() {
%1 = call i64 @ASN1_item_new(i32* @PROXY_POLICY_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@PROXY_POLICY_it = global i32 0
define i32* @PROXY_POLICY_new() {
%1 = tail call i64 @ASN1_item_new(i32* @PROXY_POLICY_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void bytes_w16le(uint8_t *data, uint16_t v) {
  data[0] = v;
  data[1] = v >> 8;
}


x86 assembly (clang, -O0):
<bytes_w16le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_w16le>:
mov    %esi,(%rdi)
sar    $0x8,%esi
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @bytes_w16le(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 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 %5, i32* %7
%8 = load i32, i32* %4
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @bytes_w16le(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
unsigned short getLEword(unsigned char *);
unsigned short get2(FILE *fp) {
  unsigned char buf[2];
  if (fread(buf, 2, 1, fp))
    return getLEword(buf);
  return 0xffff;
}


x86 assembly (clang, -O0):
<get2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x0,%rax
je     115f <get2+0x3f>
lea    -0x12(%rbp),%rdi
call   1040 <getLEword@plt>
mov    %ax,-0x2(%rbp)
jmp    1165 <get2+0x45>
movw   $0xffff,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get2>:
push   %rax
mov    %rdi,%rcx
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
test   %rax,%rax
je     1149 <get2+0x29>
lea    0x6(%rsp),%rdi
call   1040 <getLEword@plt>
pop    %rcx
ret
mov    $0xffff,%ax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @get2(i32* %0) {
%2 = alloca i16
%3 = alloca i32*
%4 = alloca [2 x i8]
store i32* %0, i32** %3
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%6 = load i32*, i32** %3
%7 = call i64 @fread(i8* %5, i32 2, i32 1, i32* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%11 = call zeroext i16 @getLEword(i8* %10)
store i16 %11, i16* %2
br label %13
12: ; preds = %1
store i16 -1, i16* %2
br label %13
13: ; preds = %12, %9
%14 = load i16, i16* %2
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @get2(i32* nocapture %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i64 @fread(i8* %3, i32 2, i32 1, i32* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call zeroext i16 @getLEword(i8* %3)
br label %8
8: ; preds = %1, %6
%9 = phi i16 [ %7, %6 ], [ -1, %1 ]
ret i16 %9
}