xunge/DecIR huggingface dataset:
/* Variables and functions */
int yas_kxdm_read_reg(unsigned char, unsigned char *, int);
int yas_kxdm_read_reg_byte(unsigned char adr) {
  unsigned char buf;
  int err;
  err = yas_kxdm_read_reg(adr, &buf, 1);
  if (err == 0)
    return buf;
  return 0;
}


x86 assembly (clang, -O0):
<yas_kxdm_read_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x5(%rbp),%edi
call   1030 <yas_kxdm_read_reg@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <yas_kxdm_read_reg_byte+0x39>
movzbl -0x6(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <yas_kxdm_read_reg_byte+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_kxdm_read_reg_byte>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <yas_kxdm_read_reg@plt>
xor    %ecx,%ecx
test   %eax,%eax
movzbl 0x7(%rsp),%eax
cmovne %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @yas_kxdm_read_reg_byte(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @yas_kxdm_read_reg(i8 zeroext %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 0
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
double sh_correlation(exp1, exp2, llim)
struct sh_lms *exp1;
struct sh_lms *exp2;
int llim;
{ return sh_correlation_per_degree(exp1, exp2, 1, llim); }


x86 assembly (clang, -O0):
<sh_correlation>:
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),%ecx
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <sh_correlation_per_degree@plt>
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sh_correlation>:
push   %rax
mov    %edx,%ecx
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <sh_correlation_per_degree@plt>
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.sh_lms = type opaque
define double @sh_correlation(%struct.sh_lms* %0, %struct.sh_lms* %1, i32 %2) {
%4 = alloca %struct.sh_lms*
%5 = alloca %struct.sh_lms*
%6 = alloca i32
store %struct.sh_lms* %0, %struct.sh_lms** %4
store %struct.sh_lms* %1, %struct.sh_lms** %5
store i32 %2, i32* %6
%7 = load %struct.sh_lms*, %struct.sh_lms** %4
%8 = load %struct.sh_lms*, %struct.sh_lms** %5
%9 = load i32, i32* %6
%10 = call i32 (%struct.sh_lms*, %struct.sh_lms*, i32, i32, ...) bitcast (i32 (...)* @sh_correlation_per_degree to i32 (%struct.sh_lms*, %struct.sh_lms*, i32, i32, ...)*)(%struct.sh_lms* %7, %struct.sh_lms* %8, i32 1, i32 %9)
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
%struct.sh_lms = type opaque
define double @sh_correlation(%struct.sh_lms* %0, %struct.sh_lms* %1, i32 %2) {
%4 = tail call i32 (%struct.sh_lms*, %struct.sh_lms*, i32, i32, ...) bitcast (i32 (...)* @sh_correlation_per_degree to i32 (%struct.sh_lms*, %struct.sh_lms*, i32, i32, ...)*)(%struct.sh_lms* %0, %struct.sh_lms* %1, i32 1, i32 %2)
%5 = sitofp i32 %4 to double
ret double %5
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dmax(int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dmax(N, x, stride);
  printf("max: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
call   1030 <stdlib_strided_dmax@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_dmax@plt>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"max: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dmax(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"max: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dmax(i32 4, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ GLeeInit();
int /*<<< orphan*/ pglFrameTerminatorGREMEDY();
void _Lazy_glFrameTerminatorGREMEDY(void) {
  if (GLeeInit())
    pglFrameTerminatorGREMEDY();
}


x86 assembly (clang, -O0):
<_Lazy_glFrameTerminatorGREMEDY>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GLeeInit@plt>
cmp    $0x0,%rax
je     113c <_Lazy_glFrameTerminatorGREMEDY+0x1c>
mov    $0x0,%al
call   1040 <pglFrameTerminatorGREMEDY@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Lazy_glFrameTerminatorGREMEDY>:
push   %rax
xor    %eax,%eax
call   1030 <GLeeInit@plt>
test   %rax,%rax
je     1135 <_Lazy_glFrameTerminatorGREMEDY+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pglFrameTerminatorGREMEDY@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_Lazy_glFrameTerminatorGREMEDY() {
%1 = call i64 (...) @GLeeInit()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @pglFrameTerminatorGREMEDY()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @_Lazy_glFrameTerminatorGREMEDY() {
%1 = tail call i64 (...) @GLeeInit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @pglFrameTerminatorGREMEDY()
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ errno;
int32_t set_errno(int32_t error_number) {
  int32_t tmp = errno;
  errno = (error_number <= 0) ? error_number : -error_number;
  return tmp;
}


x86 assembly (clang, -O0):
<set_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1128 <set_errno+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <set_errno+0x30>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2ea6(%rip),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_errno>:
mov    0x2ed9(%rip),%rcx
mov    (%rcx),%eax
mov    %edi,%edx
neg    %edx
cmovns %edi,%edx
mov    %edx,(%rcx)
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @set_errno(i32 %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 false)
%4 = sub i32 0, %3
store i32 %4, i32* @errno
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ trm_chr(char);
int /*<<< orphan*/ trm_str(char *);
void error(char *msg) {
  trm_str(msg);
  trm_chr('\n');
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <trm_str@plt>
mov    $0xa,%edi
call   1050 <trm_chr@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1040 <trm_str@plt>
mov    $0xa,%edi
call   1050 <trm_chr@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @trm_str(i8* %3)
%5 = call i32 @trm_chr(i8 signext 10)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error(i8* %0) {
%2 = tail call i32 @trm_str(i8* %0)
%3 = tail call i32 @trm_chr(i8 signext 10)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int main();
int __main() { return main(); }


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

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

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

LLVM IR (-O2):
define i32 @__main() {
%1 = tail call i32 (...) @main()
ret i32 %1
}
void xfs_dquot_done(struct xfs_buf *bp) { return; }


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

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

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

LLVM IR (-O2):
%struct.xfs_buf = type opaque
define void @xfs_dquot_done(%struct.xfs_buf* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xa7() {
  Assert_real((isalpha(167) == 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_isalpha.c",
              840, ("isalpha should be 0 for 0xa7"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xa7\00"
define void @t_isalpha_0xa7() {
%1 = tail call i64 @isalpha(i32 167)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 840, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void i2d_NETSCAPE_SPKI(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_NETSCAPE_SPKI() {
ret void
}
/* Variables and functions */
float fabsf(float const);
void vec3Abs(float *__restrict _result, const float *__restrict _a) {
  _result[0] = fabsf(_a[0]);
  _result[1] = fabsf(_a[1]);
  _result[2] = fabsf(_a[2]);
}


x86 assembly (clang, -O0):
<vec3Abs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movaps 0xee5(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movaps 0xec9(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movaps 0xeac(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3Abs>:
movss  (%rsi),%xmm0
movaps 0xef5(%rip),%xmm1
andps  %xmm1,%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
andps  %xmm1,%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
andps  %xmm1,%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vec3Abs(float* noalias %0, float* noalias %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = call float @llvm.fabs.f32(float %7)
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = call float @llvm.fabs.f32(float %13)
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = call float @llvm.fabs.f32(float %19)
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 2
store float %20, float* %22
ret void
}

LLVM IR (-O2):
define void @vec3Abs(float* noalias nocapture writeonly %0, float* noalias nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @llvm.fabs.f32(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @llvm.fabs.f32(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = tail call float @llvm.fabs.f32(float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret void
}
void rop3_92_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S ^ *D;
  stk2 = T | stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_92_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%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    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_92_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = xor i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%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_92_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = or i8 %5, %2
%7 = xor i8 %6, %4
%8 = xor i8 %1, -1
%9 = and i8 %7, %8
%10 = and i8 %4, %1
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_arrays();
int /*<<< orphan*/ test_constexpr();
int /*<<< orphan*/ test_literals();
int /*<<< orphan*/ test_pointers();
int /*<<< orphan*/ test_primitives();
int /*<<< orphan*/ test_struct();
int /*<<< orphan*/ test_unsigned();
int /*<<< orphan*/ test_vars();
int main() {
  test_primitives();
  test_pointers();
  test_unsigned();
  test_literals();
  test_arrays();
  test_vars();
  test_struct();
  test_constexpr();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <test_primitives@plt>
mov    $0x0,%al
call   1040 <test_pointers@plt>
mov    $0x0,%al
call   1030 <test_unsigned@plt>
mov    $0x0,%al
call   1060 <test_literals@plt>
mov    $0x0,%al
call   1090 <test_arrays@plt>
mov    $0x0,%al
call   1050 <test_vars@plt>
mov    $0x0,%al
call   1070 <test_struct@plt>
mov    $0x0,%al
call   10a0 <test_constexpr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <test_primitives@plt>
xor    %eax,%eax
call   1040 <test_pointers@plt>
xor    %eax,%eax
call   1030 <test_unsigned@plt>
xor    %eax,%eax
call   1060 <test_literals@plt>
xor    %eax,%eax
call   1090 <test_arrays@plt>
xor    %eax,%eax
call   1050 <test_vars@plt>
xor    %eax,%eax
call   1070 <test_struct@plt>
xor    %eax,%eax
call   10a0 <test_constexpr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_primitives()
%3 = call i32 (...) @test_pointers()
%4 = call i32 (...) @test_unsigned()
%5 = call i32 (...) @test_literals()
%6 = call i32 (...) @test_arrays()
%7 = call i32 (...) @test_vars()
%8 = call i32 (...) @test_struct()
%9 = call i32 (...) @test_constexpr()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_primitives()
%2 = tail call i32 (...) @test_pointers()
%3 = tail call i32 (...) @test_unsigned()
%4 = tail call i32 (...) @test_literals()
%5 = tail call i32 (...) @test_arrays()
%6 = tail call i32 (...) @test_vars()
%7 = tail call i32 (...) @test_struct()
%8 = tail call i32 (...) @test_constexpr()
ret i32 0
}
int main(int argc, char **argv) { return argc + 1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add nsw i32 %0, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(unsigned long, unsigned char, int);
int /*<<< orphan*/ GPIOPadConfigSet(unsigned long, unsigned char, int, int);
void GPIOPinTypeGPIOOutputOD(unsigned long ulPort, unsigned char ucPins) {
  ;
  GPIOPadConfigSet(ulPort, ucPins, 0x00000001, 0x00000009);
  GPIODirModeSet(ulPort, ucPins, 0x00000001);
}


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

x86 assembly (clang, -O2):
<GPIOPinTypeGPIOOutputOD>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x1,%edx
mov    $0x9,%ecx
call   1030 <GPIOPadConfigSet@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <GPIODirModeSet@plt>

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

LLVM IR (-O2):
define void @GPIOPinTypeGPIOOutputOD(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIOPadConfigSet(i64 %0, i8 zeroext %1, i32 1, i32 9)
%4 = tail call i32 @GPIODirModeSet(i64 %0, i8 zeroext %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void thread_exit(void *retval) { pthread_exit(retval); }


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

x86 assembly (clang, -O2):
<thread_exit>:
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @thread_exit(i8* %0) {
%2 = tail call i32 @pthread_exit(i8* %0)
ret void
}
/* Variables and functions */
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int len;
  char line[1000];
  while ((len = getline(line, 1000)) > 0)
    if (len > 3) {
      printf("%s", line);
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x3,-0x8(%rbp)
jle    116c <main+0x4c>
lea    -0x3f0(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x4,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getline(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
void sttstr_reset(char *this) {
  if (NULL == this)
    return;
  (*this) = '\0';
}


x86 assembly (clang, -O0):
<sttstr_reset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    1119 <sttstr_reset+0x19>
jmp    1120 <sttstr_reset+0x20>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sttstr_reset>:
test   %rdi,%rdi
je     1108 <sttstr_reset+0x8>
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @sttstr_reset(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* null, %3
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i8*, i8** %2
store i8 0, i8* %7
br label %8
8: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @sttstr_reset(i8* writeonly %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store i8 0, i8* %0
br label %4
4: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, char const *);
int read(int, char *, int);
void wait_socketio(int fd, const char *who) {
  char c;
  if (1 != read(fd, &c, 1))
    error(1, 0, "incomplete pipe read from %s", who);
}


x86 assembly (clang, -O0):
<wait_socketio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x11(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1166 <wait_socketio+0x46>
mov    -0x10(%rbp),%rcx
mov    $0x1,%edi
xor    %esi,%esi
lea    0xe9f(%rip),%rdx
call   1040 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_socketio>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
jne    1142 <wait_socketio+0x22>
add    $0x10,%rsp
pop    %rbx
ret
lea    0xeb7(%rip),%rdx
mov    $0x1,%edi
xor    %esi,%esi
mov    %rbx,%rcx
add    $0x10,%rsp
pop    %rbx
jmp    1040 <error@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"incomplete pipe read from %s\00"
define void @wait_socketio(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = call i32 @read(i32 %6, i8* %5, i32 1)
%8 = icmp ne i32 1, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"incomplete pipe read from %s\00"
define void @wait_socketio(i32 %0, i8* %1) {
%3 = alloca i8
%4 = call i32 @read(i32 %0, i8* %3, i32 1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadr_ps(float *);
__m128 test_mm_loadr_ps(float *A) { return _mm_loadr_ps(A); }


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

x86 assembly (clang, -O2):
<test_mm_loadr_ps>:
jmp    1030 <_mm_loadr_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_loadr_ps(float* %0) {
%2 = tail call i32 @_mm_loadr_ps(float* %0)
ret i32 %2
}
int QUANTDIV(int n, int iQ, int B) { return (n * iQ + B) >> 17; }


x86 assembly (clang, -O0):
<QUANTDIV>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sar    $0x11,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QUANTDIV>:
imul   %esi,%edi
lea    (%rdi,%rdx,1),%eax
sar    $0x11,%eax
ret

LLVM IR (-O0):
define i32 @QUANTDIV(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = ashr i32 %11, 17
ret i32 %12
}

LLVM IR (-O2):
define i32 @QUANTDIV(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = add nsw i32 %4, %2
%6 = ashr i32 %5, 17
ret i32 %6
}
/* Variables and functions */
short ntohs(short);
void ints_array_ntohs(short *hostshort, int nmemb) {
  int i;
  for (i = 0; i < nmemb; i++)
    hostshort[i] = ntohs(hostshort[i]);
}


x86 assembly (clang, -O0):
<ints_array_ntohs>:
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    1160 <ints_array_ntohs+0x50>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movswl (%rax,%rcx,2),%edi
call   1030 <ntohs@plt>
mov    %ax,%dx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ints_array_ntohs+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ints_array_ntohs>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1148 <ints_array_ntohs+0x38>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movswl (%r15,%rbx,2),%edi
call   1030 <ntohs@plt>
mov    %ax,(%r15,%rbx,2)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <ints_array_ntohs+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ints_array_ntohs(i16* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i16, i16* %0, i64 %7
%9 = load i16, i16* %8
%10 = tail call signext i16 @ntohs(i16 signext %9)
store i16 %10, i16* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void rand_seed() {
  static int is_srand_seeded = 0;
  if (is_srand_seeded) {
    return;
  }
  srand(time(NULL));
  is_srand_seeded = 1;
}


x86 assembly (clang, -O0):
<rand_seed>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f09(%rip)
je     1136 <rand_seed+0x16>
jmp    1150 <rand_seed+0x30>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x1,0x2ee4(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_seed>:
push   %rax
cmpb   $0x0,0x2f0c(%rip)
jne    113f <rand_seed+0x1f>
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movb   $0x1,0x2ef5(%rip)
pop    %rax
ret

LLVM IR (-O0):
@rand_seed.is_srand_seeded = internal global i32 0
define void @rand_seed() {
%1 = load i32, i32* @rand_seed.is_srand_seeded
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %7
4: ; preds = %0
%5 = call i32 @time(i32* null)
%6 = call i32 @srand(i32 %5)
store i32 1, i32* @rand_seed.is_srand_seeded
br label %7
7: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
@rand_seed.is_srand_seeded = internal unnamed_addr global i1 false
define void @rand_seed() {
%1 = load i1, i1* @rand_seed.is_srand_seeded
br i1 %1, label %5, label %2
2: ; preds = %0
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
store i1 true, i1* @rand_seed.is_srand_seeded
br label %5
5: ; preds = %0, %2
ret void
}
int attr_dump_names(name)
char *name;
{ return 0; }


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

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

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

LLVM IR (-O2):
define i32 @attr_dump_names(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int chess_square(int rank, int file) {
  assert(rank >= 0 && rank <= 7);
  assert(file >= 0 && file <= 7);
  return (rank << 3) + file;
}


x86 assembly (clang, -O0):
<chess_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     1137 <chess_square+0x27>
cmpl   $0x7,-0x4(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xa(%rbp)
jl     115d <chess_square+0x4d>
cmpl   $0x7,-0x8(%rbp)
setle  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chess_square>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x8,%ebx
setb   %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x8,%r14d
setb   %dil
call   1030 <assert@plt>
lea    (%r14,%rbx,8),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @chess_square(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 = icmp sge i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 7
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %4
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = load i32, i32* %4
%18 = icmp sle i32 %17, 7
br label %19
19: ; preds = %16, %10
%20 = phi i1 [ false, %10 ], [ %18, %16 ]
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load i32, i32* %3
%24 = shl i32 %23, 3
%25 = load i32, i32* %4
%26 = add nsw i32 %24, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @chess_square(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 8
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ult i32 %1, 8
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = shl i32 %0, 3
%10 = add nsw i32 %9, %1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ struct_by_value_13_x();
int main() {
  struct_by_value_13_x();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <struct_by_value_13_x@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <struct_by_value_13_x@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @struct_by_value_13_x()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ get_call_stack_for_current_thread();
int /*<<< orphan*/ remove_from_stack(void *, int /*<<< orphan*/);
void __cyg_profile_func_exit(void *fn, void *from) {
  remove_from_stack(fn, get_call_stack_for_current_thread());
}


x86 assembly (clang, -O0):
<__cyg_profile_func_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <get_call_stack_for_current_thread@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <remove_from_stack@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cyg_profile_func_exit>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <get_call_stack_for_current_thread@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <remove_from_stack@plt>

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

LLVM IR (-O2):
define void @__cyg_profile_func_exit(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @get_call_stack_for_current_thread()
%4 = tail call i32 @remove_from_stack(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print_col(char *orig, int s, int e) {
  for (; s < e; s++)
    printf("%c", orig[s]);
}


x86 assembly (clang, -O0):
<print_col>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1154 <print_col+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xec3(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <print_col+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_col>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1156 <print_col+0x46>
mov    %edx,%r12d
mov    %rdi,%r14
movslq %esi,%rax
add    %rax,%r14
sub    %esi,%r12d
xor    %ebx,%ebx
lea    0xecc(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1140 <print_col+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print_col(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = sext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %6, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = add nsw i64 %8, 1
%13 = trunc i64 %12 to i32
%14 = icmp eq i32 %13, %2
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
void I2CSetDataCount(unsigned int baseAdd, unsigned int count) {
  (*((volatile unsigned int *)(baseAdd + (0x98)))) = count;
}


x86 assembly (clang, -O0):
<I2CSetDataCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x98,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSetDataCount>:
add    $0x98,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @I2CSetDataCount(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 = add i32 %6, 152
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @I2CSetDataCount(i32 %0, i32 %1) {
%3 = add i32 %0, 152
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
int Section2Third(int number) { return number % 100 / 10; }


x86 assembly (clang, -O0):
<Section2Third>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section2Third>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
movsbl %al,%eax
imul   $0x67,%eax,%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
shr    $0xa,%ecx
add    %al,%cl
movsbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @Section2Third(i32 %0) {
%2 = srem i32 %0, 100
%3 = trunc i32 %2 to i8
%4 = sdiv i8 %3, 10
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printEnvironments(char *envp[]) {
  printf("\n\n\n\n\n environments are \n");
  printf("%s\n", envp[0]);
}


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

x86 assembly (clang, -O2):
<printEnvironments>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [24 x i8] c"\0A\0A\0A\0A\0A environments are \00"
define void @printEnvironments(i8** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
/* Variables and functions */
int kbd_read(char *);
int /*<<< orphan*/ printf(char *, char);
char get_key() {
  int keydown = 0;
  char key = 0;
  unsigned short scancode;
  while (1) {
    keydown = kbd_read(&key);
    if (keydown == 1) {
      printf("KEY: %d\n", key);
      return key;
    }
  }
}


x86 assembly (clang, -O0):
<get_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
lea    -0x5(%rbp),%rdi
call   1040 <kbd_read@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1163 <get_key+0x43>
lea    0xeb0(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1133 <get_key+0x13>

x86 assembly (clang, -O2):
<get_key>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rbx
nop
mov    %rbx,%rdi
call   1040 <kbd_read@plt>
cmp    $0x1,%eax
jne    1130 <get_key+0x10>
movsbl 0xf(%rsp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    0xf(%rsp),%al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"KEY: %d\0A\00"
define signext i8 @get_key() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i16
store i32 0, i32* %1
store i8 0, i8* %2
br label %4
4: ; preds = %0, %12
%5 = call i32 @kbd_read(i8* %2)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i8, i8* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = load i8, i8* %2
ret i8 %11
12: ; preds = %4
br label %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"KEY: %d\0A\00"
define signext i8 @get_key() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 @kbd_read(i8* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %2
5: ; preds = %2
%6 = load i8, i8* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = load i8, i8* %1
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ heap_test(int);
int main(int argc, const char *argv[]) {
  heap_test(true);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <heap_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @heap_test(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @heap_test(i32 1)
ret i32 0
}