xunge/DecIR huggingface dataset:
void mylibfoo() {
  int libvar;
  printf("variable libvar \t location: 0x%x\n", &libvar);
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"variable libvar \09 location: 0x%x\0A\00"
define void @mylibfoo() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"variable libvar \09 location: 0x%x\0A\00"
define void @mylibfoo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}
int device_unbind(struct udevice *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.udevice = type opaque
define i32 @device_unbind(%struct.udevice* nocapture readnone %0) {
ret i32 0
}
long long longlong_ignoring_longlongint(long long x, long long int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @longlong_ignoring_longlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double const *, int const);
void matNd_copy(double dest[], const double src[], const int n) {
  memcpy(dest, src, n * n * sizeof(double));
}


x86 assembly (clang, -O0):
<matNd_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matNd_copy>:
imul   %edx,%edx
shl    $0x3,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @matNd_copy(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 8
%14 = trunc i64 %13 to i32
%15 = call i32 @memcpy(double* %7, double* %8, i32 %14)
ret void
}

LLVM IR (-O2):
define void @matNd_copy(double* %0, double* %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = mul i32 %4, %2
%6 = tail call i32 @memcpy(double* %0, double* %1, i32 %5)
ret void
}
/* Variables and functions */
double const fabs(double const);
int __cc_db_equal(const double *a, const double *b, const double *epsilon) {
  return (fabs(*a - *b) < *epsilon);
}


x86 assembly (clang, -O0):
<__cc_db_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cc_db_equal>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
andpd  0xef0(%rip),%xmm0
movsd  (%rdx),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @__cc_db_equal(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = load double*, double** %5
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = call double @fabs(double %11)
%13 = load double*, double** %6
%14 = load double, double* %13
%15 = fcmp olt double %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @__cc_db_equal(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fsub double %4, %5
%7 = tail call double @llvm.fabs.f64(double %6)
%8 = load double, double* %2
%9 = fcmp olt double %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int list_too_short_for_llrun(int N, int K) { return (K <= 80); }


x86 assembly (clang, -O0):
<list_too_short_for_llrun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x50,-0x8(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_too_short_for_llrun>:
xor    %eax,%eax
cmp    $0x51,%esi
setl   %al
ret

LLVM IR (-O0):
define i32 @list_too_short_for_llrun(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 = icmp sle i32 %5, 80
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @list_too_short_for_llrun(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 81
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(int);
int is_numeric(unsigned long value) {
  int ch;
  if (value > 0x7f)
    return 0;
  ch = (int)value;
  if (!isdigit(ch) && ch != ' ')
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x7f,-0x10(%rbp)
jbe    1133 <is_numeric+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1168 <is_numeric+0x58>
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1161 <is_numeric+0x51>
cmpl   $0x20,-0x14(%rbp)
je     1161 <is_numeric+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1168 <is_numeric+0x58>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
xor    %eax,%eax
cmp    $0x7f,%rdi
ja     111c <is_numeric+0x1c>
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_numeric(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ugt i64 %5, 127
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %19
8: ; preds = %1
%9 = load i64, i64* %3
%10 = trunc i64 %9 to i32
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = call i32 @isdigit(i32 %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %8
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 32
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 0, i32* %2
br label %19
18: ; preds = %14, %8
store i32 1, i32* %2
br label %19
19: ; preds = %18, %17, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_numeric(i64 %0) {
%2 = icmp ugt i64 %0, 127
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = trunc i64 %0 to i32
%5 = add nsw i32 %4, -48
%6 = icmp ult i32 %5, 10
%7 = icmp eq i32 %4, 32
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *xmalloc(size_t);
char *xstrdup(const char *s) {
  size_t len = strlen(s);
  char *r = xmalloc(len + 1);
  memcpy(r, s, len + 1);
  return r;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @xmalloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i64, i64* %3
%13 = add i64 %12, 1
%14 = call i32 @memcpy(i8* %10, i8* %11, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %3)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
const char *
hfp_subevent_enhanced_call_status_get_bnip_number(const uint8_t *event) {
  return (const char *)&event[8];
}


x86 assembly (clang, -O0):
<hfp_subevent_enhanced_call_status_get_bnip_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hfp_subevent_enhanced_call_status_get_bnip_number>:
lea    0x20(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @hfp_subevent_enhanced_call_status_get_bnip_number(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = bitcast i32* %2 to i8*
ret i8* %3
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncmp(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int is_hiddev(const struct dirent *ent) {
  return !strncmp(ent->d_name, "hiddev", strlen("hiddev"));
}


x86 assembly (clang, -O0):
<is_hiddev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xec4(%rip),%rdi
call   1040 <strlen@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%edx
lea    0xeb3(%rip),%rsi
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hiddev>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [7 x i8] c"hiddev\00"
define i32 @is_hiddev(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @strncmp(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@.str = [7 x i8] c"hiddev\00"
define i32 @is_hiddev(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @strncmp(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ UnityFail(char *, unsigned short);
int isOverrun(void *);
int /*<<< orphan*/ release_memory(void *);
void unity_free(void *mem) {
  int overrun = isOverrun(mem);
  release_memory(mem);
  if (overrun) {
    UnityFail(("Buffer overrun detected during free()"), (unsigned short)234);
    ;
  }
}


x86 assembly (clang, -O0):
<unity_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <isOverrun@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <release_memory@plt>
cmpl   $0x0,-0xc(%rbp)
je     116c <unity_free+0x3c>
lea    0xe9e(%rip),%rdi
mov    $0xea,%esi
call   1050 <UnityFail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unity_free>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <isOverrun@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <release_memory@plt>
test   %ebp,%ebp
je     1160 <unity_free+0x30>
lea    0xeb0(%rip),%rdi
mov    $0xea,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <UnityFail@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Buffer overrun detected during free()\00"
define void @unity_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @isOverrun(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @release_memory(i8* %6)
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @UnityFail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i16 zeroext 234)
br label %12
12: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Buffer overrun detected during free()\00"
define void @unity_free(i8* %0) {
%2 = tail call i32 @isOverrun(i8* %0)
%3 = tail call i32 @release_memory(i8* %0)
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @UnityFail(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i16 zeroext 234)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
float saturate(float const);
float CalcWaterFogAlpha(const float flWaterZ, const float flEyePosZ,
                        const float flWorldPosZ, const float flProjPosZ,
                        const float flFogOORange) {
  return saturate((flWaterZ - flWorldPosZ - 2.0f) * flFogOORange);
}


x86 assembly (clang, -O0):
<CalcWaterFogAlpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  0xebd(%rip),%xmm1
subss  %xmm1,%xmm0
mulss  -0x14(%rbp),%xmm0
call   1030 <saturate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcWaterFogAlpha>:
subss  %xmm2,%xmm0
addss  0xee4(%rip),%xmm0
mulss  %xmm4,%xmm0
jmp    1030 <saturate@plt>

LLVM IR (-O0):
define float @CalcWaterFogAlpha(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %6
%12 = load float, float* %8
%13 = fsub float %11, %12
%14 = fsub float %13, 2.000000e+00
%15 = load float, float* %10
%16 = fmul float %14, %15
%17 = call float @saturate(float %16)
ret float %17
}

LLVM IR (-O2):
define float @CalcWaterFogAlpha(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %0, %2
%7 = fadd float %6, -2.000000e+00
%8 = fmul float %7, %4
%9 = tail call float @saturate(float %8)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ config_reset();
void button_action(void) { config_reset(); }


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

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

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

LLVM IR (-O2):
define void @button_action() {
%1 = tail call i32 (...) @config_reset()
ret void
}
int fun365() { return 365; }


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

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

LLVM IR (-O0):
define i32 @fun365() {
ret i32 365
}

LLVM IR (-O2):
define i32 @fun365() {
ret i32 365
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_clear() { fprintf(stdout, "cleared\n"); }


x86 assembly (clang, -O0):
<print_clear>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_clear>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"cleared\0A\00"
define void @print_clear() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"cleared\0A\00"
define void @print_clear() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cio_write(int, int);
void j2k_write_eoc() { cio_write(0xffd9, 2); }


x86 assembly (clang, -O0):
<j2k_write_eoc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffd9,%edi
mov    $0x2,%esi
call   1030 <cio_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<j2k_write_eoc>:
mov    $0xffd9,%edi
mov    $0x2,%esi
jmp    1030 <cio_write@plt>

LLVM IR (-O0):
define void @j2k_write_eoc() {
%1 = call i32 @cio_write(i32 65497, i32 2)
ret void
}

LLVM IR (-O2):
define void @j2k_write_eoc() {
%1 = tail call i32 @cio_write(i32 65497, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ init_logging();
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int start_server();
int main(int argc, char **argv) {
  init_logging();
  signal(SIGPIPE, SIG_IGN);
  return (start_server());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init_logging@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    $0x0,%al
call   1050 <start_server@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init_logging@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <start_server@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @init_logging()
%7 = load i32, i32* @SIGPIPE
%8 = load i32, i32* @SIG_IGN
%9 = call i32 @signal(i32 %7, i32 %8)
%10 = call i32 (...) @start_server()
ret i32 %10
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init_logging()
%4 = load i32, i32* @SIGPIPE
%5 = load i32, i32* @SIG_IGN
%6 = tail call i32 @signal(i32 %4, i32 %5)
%7 = tail call i32 (...) @start_server()
ret i32 %7
}
/* Type definitions */
struct rlimit {
  int dummy;
};
typedef enum __rlimit_resource {
  ____Placeholder___rlimit_resource
} __rlimit_resource;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __getrlimit(enum __rlimit_resource resource, struct rlimit *rlimits) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__getrlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getrlimit>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@ENOSYS = global i32 0
define i32 @__getrlimit(i32 %0, %struct.rlimit* %1) {
%3 = alloca i32
%4 = alloca %struct.rlimit*
store i32 %0, i32* %3
store %struct.rlimit* %1, %struct.rlimit** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@ENOSYS = global i32 0
define i32 @__getrlimit(i32 %0, %struct.rlimit* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ draw_line(int);
int /*<<< orphan*/ message();
int main() {
  draw_line(20);
  message();
  draw_line(15);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%edi
call   1040 <draw_line@plt>
mov    $0x0,%al
call   1030 <message@plt>
mov    $0xf,%edi
call   1040 <draw_line@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1040 <draw_line@plt>
xor    %eax,%eax
call   1030 <message@plt>
mov    $0xf,%edi
call   1040 <draw_line@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @draw_line(i32 20)
%3 = call i32 (...) @message()
%4 = call i32 @draw_line(i32 15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @draw_line(i32 20)
%2 = tail call i32 (...) @message()
%3 = tail call i32 @draw_line(i32 15)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t red(uint32_t colourcode) { return (colourcode >> 20) & 0x3ff; }


x86 assembly (clang, -O0):
<red>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x14,%eax
and    $0x3ff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<red>:
mov    %edi,%eax
shr    $0x14,%eax
and    $0x3ff,%eax
ret

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

LLVM IR (-O2):
define i32 @red(i32 %0) {
%2 = lshr i32 %0, 20
%3 = and i32 %2, 1023
ret i32 %3
}
void Cyc_Toc_enumfields_to_c(struct Cyc_List_List *fs) { return; }


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

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

LLVM IR (-O0):
%struct.Cyc_List_List = type opaque
define void @Cyc_Toc_enumfields_to_c(%struct.Cyc_List_List* %0) {
%2 = alloca %struct.Cyc_List_List*
store %struct.Cyc_List_List* %0, %struct.Cyc_List_List** %2
ret void
}

LLVM IR (-O2):
%struct.Cyc_List_List = type opaque
define void @Cyc_Toc_enumfields_to_c(%struct.Cyc_List_List* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __memcpy_toio(unsigned long, void const *, unsigned int);
__attribute__((always_)) void memcpy_toio(volatile void *to, const void *from,
                                          unsigned len) {
  __memcpy_toio((unsigned long)to, from, len);
}


x86 assembly (clang, -O0):
<memcpy_toio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <__memcpy_toio@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_toio>:
jmp    1030 <__memcpy_toio@plt>

LLVM IR (-O0):
define void @memcpy_toio(i8* %0, i8* %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 = ptrtoint i8* %7 to i64
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @__memcpy_toio(i64 %8, i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @memcpy_toio(i8* %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = tail call i32 @__memcpy_toio(i64 %4, i8* %1, i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CMasterDisable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000020))) &= ~(0x00000010);
}


x86 assembly (clang, -O0):
<I2CMasterDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rcx
and    $0xffffffffffffffef,%rcx
mov    %rcx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterDisable>:
andq   $0xffffffffffffffef,0x20(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 32
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -17
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CMasterDisable(i64 %0) {
%2 = add nsw i64 %0, 32
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -17
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MRF24_Read_Short(unsigned short);
void MRF24_Write_Short(unsigned short data) { MRF24_Read_Short(data | 0x100); }


x86 assembly (clang, -O0):
<MRF24_Write_Short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
or     $0x100,%eax
movzwl %ax,%edi
call   1030 <MRF24_Read_Short@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MRF24_Write_Short>:
or     $0x100,%edi
jmp    1030 <MRF24_Read_Short@plt>

LLVM IR (-O0):
define void @MRF24_Write_Short(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = or i32 %4, 256
%6 = trunc i32 %5 to i16
%7 = call i32 @MRF24_Read_Short(i16 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @MRF24_Write_Short(i16 zeroext %0) {
%2 = or i16 %0, 256
%3 = tail call i32 @MRF24_Read_Short(i16 zeroext %2)
ret void
}
/* Variables and functions */
unsigned char __builtin_inw(unsigned short);
unsigned char inw(unsigned short port) { return __builtin_inw(port); }


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <__builtin_inw@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
jmp    1030 <__builtin_inw@plt>

LLVM IR (-O0):
define zeroext i8 @inw(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i8 @__builtin_inw(i16 zeroext %3)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @inw(i16 zeroext %0) {
%2 = tail call zeroext i8 @__builtin_inw(i16 zeroext %0)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t is_odd(uint32_t value) { return value; }


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

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

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

LLVM IR (-O2):
define i32 @is_odd(i32 returned %0) {
ret i32 %0
}
void g_type_register_fundamental() {}


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

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

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

LLVM IR (-O2):
define void @g_type_register_fundamental() {
ret void
}
double g2(double x) { return 0.0; }


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @g2(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @g2(double %0) {
ret double 0.000000e+00
}
int notifier_with_return_list_add() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @notifier_with_return_list_add() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ receiver_send_morse(char *);
void source_on() { receiver_send_morse("TEST SRC ON"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"TEST SRC ON\00"
define void @source_on() {
%1 = call i32 @receiver_send_morse(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"TEST SRC ON\00"
define void @source_on() {
%1 = tail call i32 @receiver_send_morse(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t fnmatch_chrcasecmp(char a, char b) {
  if ('A' <= a && a <= 'Z')
    a += 'a' - 'A';
  if ('A' <= b && b <= 'Z')
    b += 'a' - 'A';
  return a == b;
}


x86 assembly (clang, -O0):
<fnmatch_chrcasecmp>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1138 <fnmatch_chrcasecmp+0x38>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1138 <fnmatch_chrcasecmp+0x38>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x2(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1160 <fnmatch_chrcasecmp+0x60>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1160 <fnmatch_chrcasecmp+0x60>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnmatch_chrcasecmp>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%ecx
cmovae %edi,%ecx
lea    -0x41(%rsi),%eax
lea    0x20(%rsi),%edx
cmp    $0x1a,%al
movzbl %dl,%edx
cmovae %esi,%edx
xor    %eax,%eax
cmp    %dl,%cl
sete   %al
ret

LLVM IR (-O0):
define i64 @fnmatch_chrcasecmp(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sle i32 65, %6
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 90
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = add nsw i32 %14, 32
%16 = trunc i32 %15 to i8
store i8 %16, i8* %3
br label %17
17: ; preds = %12, %8, %2
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = icmp sle i32 65, %19
br i1 %20, label %21, label %30
21: ; preds = %17
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 90
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = add nsw i32 %27, 32
%29 = trunc i32 %28 to i8
store i8 %29, i8* %4
br label %30
30: ; preds = %25, %21, %17
%31 = load i8, i8* %3
%32 = sext i8 %31 to i32
%33 = load i8, i8* %4
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %32, %34
%36 = zext i1 %35 to i32
%37 = sext i32 %36 to i64
ret i64 %37
}

LLVM IR (-O2):
define i64 @fnmatch_chrcasecmp(i8 signext %0, i8 signext %1) {
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, 32
%6 = select i1 %4, i8 %5, i8 %0
%7 = add i8 %1, -65
%8 = icmp ult i8 %7, 26
%9 = add i8 %1, 32
%10 = select i1 %8, i8 %9, i8 %1
%11 = icmp eq i8 %6, %10
%12 = zext i1 %11 to i64
ret i64 %12
}
void dummy_swap(void *i) { ; }


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

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

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

LLVM IR (-O2):
define void @dummy_swap(i8* nocapture %0) {
ret void
}
unsigned xrop3_228_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T ^ S;
  stk2 = D & stk3;
  stk1 = S ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_228_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_228_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %6
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_228_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i8 %1, %0
%6 = zext i8 %5 to i32
%7 = xor i32 %4, %6
ret i32 %7
}
int int_min(int x, int y) { return ((x < y) ? x : y); }


x86 assembly (clang, -O0):
<int_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <int_min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <int_min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @int_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int is_sorted(int *arr) {
  return *arr == 1 && *(arr + 1) == 2 && *(arr + 2) == 3 && *(arr + 3) == 4 &&
         *(arr + 4) == 5;
}


x86 assembly (clang, -O0):
<is_sorted>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x1,(%rcx)
mov    %al,-0x9(%rbp)
jne    1161 <is_sorted+0x61>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x2,0x4(%rcx)
mov    %al,-0x9(%rbp)
jne    1161 <is_sorted+0x61>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x3,0x8(%rcx)
mov    %al,-0x9(%rbp)
jne    1161 <is_sorted+0x61>
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpl   $0x4,0xc(%rcx)
mov    %al,-0x9(%rbp)
jne    1161 <is_sorted+0x61>
mov    -0x8(%rbp),%rax
cmpl   $0x5,0x10(%rax)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sorted>:
xor    %eax,%eax
cmpl   $0x1,(%rdi)
jne    1122 <is_sorted+0x22>
cmpl   $0x2,0x4(%rdi)
jne    1122 <is_sorted+0x22>
cmpl   $0x3,0x8(%rdi)
jne    1122 <is_sorted+0x22>
cmpl   $0x4,0xc(%rdi)
jne    1122 <is_sorted+0x22>
xor    %eax,%eax
cmpl   $0x5,0x10(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_sorted(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %21
4: ; preds = %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %21
8: ; preds = %4
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 3
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = getelementptr inbounds i32, i32* %0, i64 3
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 4
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = getelementptr inbounds i32, i32* %0, i64 4
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 5
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %16, %12, %8, %4, %1
%22 = phi i32 [ 0, %12 ], [ 0, %8 ], [ 0, %4 ], [ 0, %1 ], [ %20, %16 ]
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ pw_process(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int, int);
void pw_phonemes(int pw_flags) { pw_process(0, 0, 0, 1, pw_flags); }


x86 assembly (clang, -O0):
<pw_phonemes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%r8d
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <pw_process@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pw_phonemes>:
mov    %edi,%r8d
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <pw_process@plt>

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

LLVM IR (-O2):
define void @pw_phonemes(i32 %0) {
%2 = tail call i32 @pw_process(i32 0, i32 0, i32 0, i32 1, i32 %0)
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *_MALLOCZ(int n, int clr) {
  void *v;
  v = malloc(n);
  if (v && clr)
    memset(v, 0, n);
  return v;
}


x86 assembly (clang, -O0):
<_MALLOCZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115d <_MALLOCZ+0x3d>
cmpl   $0x0,-0x8(%rbp)
je     115d <_MALLOCZ+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_MALLOCZ>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%r14d
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
je     1147 <_MALLOCZ+0x27>
test   %rbx,%rbx
je     1147 <_MALLOCZ+0x27>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14d,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @_MALLOCZ(i32 %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %0)
%4 = icmp ne i8* %3, null
%5 = icmp ne i32 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @memset(i8* %3, i32 0, i32 %0)
br label %9
9: ; preds = %7, %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ isdigit(int);
int toupper(int);
int isxdigit(int c) {
  c = toupper(c);
  return isdigit(c) || (c >= 'A' && c <= 'F');
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <toupper@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116f <isxdigit+0x4f>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1169 <isxdigit+0x49>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i32 @toupper(i32 %0)
%3 = tail call i64 @isdigit(i32 %2)
%4 = icmp ne i64 %3, 0
%5 = add i32 %2, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void ex() {
  printf("Test 5.  fork failed.  Errno=%d\n", errno);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Test 5. fork failed. Errno=%d\0A\00"
@errno = global i32 0
define void @ex() {
%1 = load i32, i32* @errno
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"Test 5. fork failed. Errno=%d\0A\00"
@errno = global i32 0
define void @ex() {
%1 = load i32, i32* @errno
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void rop3_165_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T ^ *D;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_165_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_165_1_1>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %dl,%cl
or     %edx,%esi
or     %sil,%cl
not    %cl
and    %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_165_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %9, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
%19 = load i8, i8* %7
%20 = zext i8 %19 to i32
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = xor i32 %22, -1
%24 = and i32 %20, %23
%25 = load i8, i8* %6
%26 = zext i8 %25 to i32
%27 = xor i32 %26, -1
%28 = and i32 %24, %27
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = and i32 %31, %33
%35 = or i32 %28, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = trunc i32 %42 to i8
%44 = load i8*, i8** %4
store i8 %43, i8* %44
ret void
}

LLVM IR (-O2):
define void @rop3_165_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %2, %1
%7 = or i8 %6, %5
%8 = xor i8 %7, -1
%9 = and i8 %4, %6
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}