xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void and_reg32_reg32(unsigned int reg1, unsigned int reg2) {
  put8(0x21);
  put8(0xC0 | (reg2 << 3) | reg1);
}


x86 assembly (clang, -O0):
<and_reg32_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x21,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x4(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<and_reg32_reg32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x21,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @and_reg32_reg32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 33)
%6 = load i32, i32* %4
%7 = shl i32 %6, 3
%8 = or i32 192, %7
%9 = load i32, i32* %3
%10 = or i32 %8, %9
%11 = call i32 @put8(i32 %10)
ret void
}

LLVM IR (-O2):
define void @and_reg32_reg32(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 33)
%4 = shl i32 %1, 3
%5 = or i32 %4, %0
%6 = or i32 %5, 192
%7 = tail call i32 @put8(i32 %6)
ret void
}
void test56_On3_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test56_On3_targetInit__I() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int __int8_t_encoded_array_size(const int8_t *p, int elements) {
  return sizeof(int8_t) * elements;
}


x86 assembly (clang, -O0):
<__int8_t_encoded_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__int8_t_encoded_array_size>:
lea    0x0(,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @__int8_t_encoded_array_size(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 = sext i32 %5 to i64
%7 = mul i64 4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @__int8_t_encoded_array_size(i32* nocapture readnone %0, i32 %1) {
%3 = shl i32 %1, 2
ret i32 %3
}
double _constZero(const int numInputs, const double *inputs,
                  const double *connectionWeights) {
  return 0;
}


x86 assembly (clang, -O0):
<_constZero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @_constZero(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @_constZero(i32 %0, double* nocapture readnone %1, double* nocapture readnone %2) {
ret double 0.000000e+00
}
double av_clipd_c(double a, double amin, double amax) {
  if (a < amin)
    return amin;
  else if (a > amax)
    return amax;
  else
    return a;
}


x86 assembly (clang, -O0):
<av_clipd_c>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <av_clipd_c+0x36>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <av_clipd_c+0x5f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1155 <av_clipd_c+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <av_clipd_c+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_clipd_c>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @av_clipd_c(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %6
store double %12, double* %4
br label %21
13: ; preds = %3
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %7
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %5
store double %20, double* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @av_clipd_c(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
void cprop_result2(int *data) {
  int j;
  j = 9;
  data[0] = j;
}


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

x86 assembly (clang, -O2):
<cprop_result2>:
movl   $0x9,(%rdi)
ret

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

LLVM IR (-O2):
define void @cprop_result2(i32* nocapture writeonly %0) {
store i32 9, i32* %0
ret void
}
/* Variables and functions */
int fact_digsum(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int sum = 0;
  int i;
  for (i = 3; i < 1088641; ++i)
    if (fact_digsum(i) == i)
      sum += i;
  printf("%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
cmpl   $0x109c81,-0xc(%rbp)
jge    1177 <main+0x57>
mov    -0xc(%rbp),%edi
call   1040 <fact_digsum@plt>
cmp    -0xc(%rbp),%eax
jne    1164 <main+0x44>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1169 <main+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    $0x3,%ebp
jmp    113d <main+0x1d>
nopl   0x0(%rax)
add    %ecx,%ebx
add    $0x1,%ebp
cmp    $0x109c81,%ebp
je     114e <main+0x2e>
mov    %ebp,%edi
call   1040 <fact_digsum@plt>
mov    %ebp,%ecx
cmp    %eax,%ebp
je     1130 <main+0x10>
xor    %ecx,%ecx
jmp    1130 <main+0x10>
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 3, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = tail call i32 @fact_digsum(i32 %2)
%5 = icmp eq i32 %4, %2
%6 = select i1 %5, i32 %2, i32 0
%7 = add nuw nsw i32 %6, %3
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 1088641
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(void) {
  system("ls -l");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ls -l\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"ls -l\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *stringFieldInSubmissionSet(struct sqlConnection *, int, char *);
char *genePixContributors(struct sqlConnection *conn, int id) {
  return stringFieldInSubmissionSet(conn, id, "contributors");
}


x86 assembly (clang, -O0):
<genePixContributors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <stringFieldInSubmissionSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genePixContributors>:
lea    0xee9(%rip),%rdx
jmp    1030 <stringFieldInSubmissionSet@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [13 x i8] c"contributors\00"
define i8* @genePixContributors(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @stringFieldInSubmissionSet(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [13 x i8] c"contributors\00"
define i8* @genePixContributors(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @stringFieldInSubmissionSet(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x42() {
  Assert_real((ispunct(66) == 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_ispunct.c",
              335, ("ispunct should be 0 for B"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x42>:
push   %rax
mov    $0x42,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x14f,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for B\00"
define void @t_ispunct_0x42() {
%1 = call i64 @ispunct(i32 66)
%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 335, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for B\00"
define void @t_ispunct_0x42() {
%1 = tail call i64 @ispunct(i32 66)
%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 335, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t dtls_uint24_to_int(const unsigned char *field) {
  return ((uint32_t)field[0] << 16) | ((uint32_t)field[1] << 8) |
         (uint32_t)field[2];
}


x86 assembly (clang, -O0):
<dtls_uint24_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtls_uint24_to_int>:
movzbl (%rdi),%eax
shl    $0x10,%eax
movzbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movzbl 0x2(%rdi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dtls_uint24_to_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 16
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %13, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @dtls_uint24_to_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 16
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
ret i32 %13
}
void RTNetIPv4TCPChecksum(void) {}


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

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

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

LLVM IR (-O2):
define void @RTNetIPv4TCPChecksum() {
ret void
}
void vPortYieldProcessor(void) {}


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

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

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

LLVM IR (-O2):
define void @vPortYieldProcessor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ split_me(int *);
int main(void) {
  int i;
  for (i = 0; i < 1000; i++)
    split_me(&i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    114a <main+0x3a>
lea    -0x8(%rbp),%rdi
call   1030 <split_me@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <split_me@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x3e7,%eax
jl     1130 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @split_me(i32* %2)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @split_me(i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = icmp slt i32 %5, 999
br i1 %7, label %3, label %8
8: ; preds = %3
ret i32 0
}
void RGB565ToUVRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @RGB565ToUVRow_Any_NEON() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XID;
typedef int /*<<< orphan*/ Status;
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
Status XScreenSaverRegister(Display *dpy, int screen, XID xid, Atom type) {}


x86 assembly (clang, -O0):
<XScreenSaverRegister>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @XScreenSaverRegister(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @XScreenSaverRegister(i32* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
ret i32 undef
}
const char *rte_version(void) {
  if (sizeof("") > sizeof(""))
    return "RTE"
           " "
           "1"
           "."
           "6"
           "."
           "0"
           "r"
           "2"
           "-"
           "";
  else
    return "RTE"
           " "
           "1"
           "."
           "6"
           "."
           "0"
           "r"
           "2";
}


x86 assembly (clang, -O0):
<rte_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"RTE 1.6.0r2\00"
define i8* @rte_version() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"RTE 1.6.0r2\00"
define i8* @rte_version() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int dal_reg_write(unsigned int, unsigned int, unsigned int);
int emac2_reg_set(unsigned int dev_id, unsigned int reg_addr,
                  unsigned int value) {
  return dal_reg_write(dev_id, reg_addr + 0x108000, value);
}


x86 assembly (clang, -O0):
<emac2_reg_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x108000,%esi
mov    -0xc(%rbp),%edx
call   1030 <dal_reg_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emac2_reg_set>:
add    $0x108000,%esi
jmp    1030 <dal_reg_write@plt>

LLVM IR (-O0):
define i32 @emac2_reg_set(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 = add i32 %8, 1081344
%10 = load i32, i32* %6
%11 = call i32 @dal_reg_write(i32 %7, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @emac2_reg_set(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, 1081344
%5 = tail call i32 @dal_reg_write(i32 %0, i32 %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ indietro();
int /*<<< orphan*/ pwmOff();
int /*<<< orphan*/ ruotaDX();
int /*<<< orphan*/ ruotaSX();
int /*<<< orphan*/ sleep(int);
void selfTest() {
  indietro();
  sleep(2);
  ruotaDX();
  sleep(2);
  ruotaSX();
  sleep(2);
  pwmOff();
  sleep(1);
}


x86 assembly (clang, -O0):
<selfTest>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <indietro@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1040 <ruotaDX@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1070 <ruotaSX@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1050 <pwmOff@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<selfTest>:
push   %rax
xor    %eax,%eax
call   1030 <indietro@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1040 <ruotaDX@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1070 <ruotaSX@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1050 <pwmOff@plt>
mov    $0x1,%edi
pop    %rax
jmp    1060 <sleep@plt>

LLVM IR (-O0):
define void @selfTest() {
%1 = call i32 (...) @indietro()
%2 = call i32 @sleep(i32 2)
%3 = call i32 (...) @ruotaDX()
%4 = call i32 @sleep(i32 2)
%5 = call i32 (...) @ruotaSX()
%6 = call i32 @sleep(i32 2)
%7 = call i32 (...) @pwmOff()
%8 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @selfTest() {
%1 = tail call i32 (...) @indietro()
%2 = tail call i32 @sleep(i32 2)
%3 = tail call i32 (...) @ruotaDX()
%4 = tail call i32 @sleep(i32 2)
%5 = tail call i32 (...) @ruotaSX()
%6 = tail call i32 @sleep(i32 2)
%7 = tail call i32 (...) @pwmOff()
%8 = tail call i32 @sleep(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XErrorEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int xerrordummy(Display *dpy, XErrorEvent *ee) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xerrordummy(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ path;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
unsigned int sysfs_read_file(char *, char *, size_t);
unsigned int sysfs_cpuidle_read_file(const char *fname, char *buf,
                                     size_t buflen) {
  char path[255];
  snprintf(path, sizeof(path),
           "/sys/devices/system/cpu/"
           "cpuidle/%s",
           fname);
  return sysfs_read_file(path, buf, buflen);
}


x86 assembly (clang, -O0):
<sysfs_cpuidle_read_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0xff,%esi
lea    0xeb2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <sysfs_read_file@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysfs_cpuidle_read_file>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0xec4(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0xff,%esi
call   1030 <snprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <sysfs_read_file@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [35 x i8] c"/sys/devices/system/cpu/cpuidle/%s\00"
define i32 @sysfs_cpuidle_read_file(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca [255 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = call i32 @snprintf(i8* %8, i32 255, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @sysfs_read_file(i8* %11, i8* %12, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [35 x i8] c"/sys/devices/system/cpu/cpuidle/%s\00"
define i32 @sysfs_cpuidle_read_file(i8* %0, i8* %1, i64 %2) {
%4 = alloca [255 x i8]
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 255, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = call i32 @sysfs_read_file(i8* %5, i8* %1, i64 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int);
int /*<<< orphan*/ internal_error();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void _assert_func(const char *file, int line, const char *exp) {
  fflush(stdout);
  fprintf(stderr, "\n\nassertion \"%s\" failed: file \"%s\", line %d\n", exp,
          file, line);
  fflush(stderr);
  internal_error();
}


x86 assembly (clang, -O0):
<_assert_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <internal_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_func>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e8b(%rip),%r15
mov    (%r15),%edi
lea    0xea1(%rip),%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
mov    %r14d,%r8d
call   1030 <fprintf@plt>
mov    (%r15),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <internal_error@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [45 x i8] c"\0A\0Aassertion \22%s\22 failed: file \22%s\22, line %d\0A\00"
define void @_assert_func(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %6
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i32 %12)
%14 = load i32, i32* @stderr
%15 = call i32 @fflush(i32 %14)
%16 = call i32 (...) @internal_error()
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [45 x i8] c"\0A\0Aassertion \22%s\22 failed: file \22%s\22, line %d\0A\00"
define void @_assert_func(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0, i32 %1)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fflush(i32 %8)
%10 = tail call i32 (...) @internal_error()
ret void
}
int putchar(int c) {
  *(volatile int *)((0x10500000 + 4)) = c;
  return c;
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x10500004,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 273678340 to i32*)
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @putchar(i32 returned %0) {
store volatile i32 %0, i32* inttoptr (i64 273678340 to i32*)
ret i32 %0
}
void numa_set_preferred(int node) {}


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

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

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

LLVM IR (-O2):
define void @numa_set_preferred(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htobe16(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(void *, int /*<<< orphan*/ *, int);
void ph_to_be16(void *v, uint16_t u) {
  u = htobe16(u);
  memcpy(v, &u, sizeof(uint16_t));
}


x86 assembly (clang, -O0):
<ph_to_be16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <htobe16@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ph_to_be16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <htobe16@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ph_to_be16(i8* %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htobe16(i32 %1)
store i32 %4, i32* %3
%5 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ border(char, char, char, char, char, float, char, char);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ mvhline(int, int, char, int);
int /*<<< orphan*/ mvvline(int, int, char, int);
int /*<<< orphan*/ refresh();
int main() {
  initscr();
  border('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h');
  mvhline(2, 10, '-', 30);
  mvvline(2, 10, '|', 4);
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x61,%edi
mov    $0x62,%esi
mov    $0x63,%edx
mov    $0x64,%ecx
mov    $0x65,%r8d
movss  0xe58(%rip),%xmm0
mov    $0x67,%r9d
movl   $0x68,(%rsp)
call   1030 <border@plt>
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x2d,%edx
mov    $0x1e,%ecx
call   1080 <mvhline@plt>
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x7c,%edx
mov    $0x4,%ecx
call   1090 <mvvline@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <initscr@plt>
movl   $0x68,(%rsp)
movss  0xe79(%rip),%xmm0
mov    $0x61,%edi
mov    $0x62,%esi
mov    $0x63,%edx
mov    $0x64,%ecx
mov    $0x65,%r8d
mov    $0x67,%r9d
call   1030 <border@plt>
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x2d,%edx
mov    $0x1e,%ecx
call   1080 <mvhline@plt>
mov    $0x2,%edi
mov    $0xa,%esi
mov    $0x7c,%edx
mov    $0x4,%ecx
call   1090 <mvvline@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = call i32 @border(i8 signext 97, i8 signext 98, i8 signext 99, i8 signext 100, i8 signext 101, float 1.020000e+02, i8 signext 103, i8 signext 104)
%4 = call i32 @mvhline(i32 2, i32 10, i8 signext 45, i32 30)
%5 = call i32 @mvvline(i32 2, i32 10, i8 signext 124, i32 4)
%6 = call i32 (...) @refresh()
%7 = call i32 (...) @getch()
%8 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @border(i8 signext 97, i8 signext 98, i8 signext 99, i8 signext 100, i8 signext 101, float 1.020000e+02, i8 signext 103, i8 signext 104)
%3 = tail call i32 @mvhline(i32 2, i32 10, i8 signext 45, i32 30)
%4 = tail call i32 @mvvline(i32 2, i32 10, i8 signext 124, i32 4)
%5 = tail call i32 (...) @refresh()
%6 = tail call i32 (...) @getch()
%7 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int usb_raw_open() { return open("/dev/raw-gadget", O_RDWR); }


x86 assembly (clang, -O0):
<usb_raw_open>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_raw_open>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"/dev/raw-gadget\00"
@O_RDWR = global i32 0
define i32 @usb_raw_open() {
%1 = load i32, i32* @O_RDWR
%2 = call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [16 x i8] c"/dev/raw-gadget\00"
@O_RDWR = global i32 0
define i32 @usb_raw_open() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __WFE();
void cpu_sleep(void) {
  __WFE();
  __WFE();
}


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

x86 assembly (clang, -O2):
<cpu_sleep>:
push   %rax
xor    %eax,%eax
call   1030 <__WFE@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__WFE@plt>

LLVM IR (-O0):
define void @cpu_sleep() {
%1 = call i32 (...) @__WFE()
%2 = call i32 (...) @__WFE()
ret void
}

LLVM IR (-O2):
define void @cpu_sleep() {
%1 = tail call i32 (...) @__WFE()
%2 = tail call i32 (...) @__WFE()
ret void
}
void kazfulleos_set_arrays(void) {
  void kazfulleos_set_arrays_multidimen(void);
  void kazfulleos_set_arrays_perpoint_perline(void);
  kazfulleos_set_arrays_perpoint_perline();
  kazfulleos_set_arrays_multidimen();
}


x86 assembly (clang, -O0):
<kazfulleos_set_arrays>:
push   %rbp
mov    %rsp,%rbp
call   1030 <kazfulleos_set_arrays_perpoint_perline@plt>
call   1040 <kazfulleos_set_arrays_multidimen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kazfulleos_set_arrays>:
push   %rax
call   1030 <kazfulleos_set_arrays_perpoint_perline@plt>
pop    %rax
jmp    1040 <kazfulleos_set_arrays_multidimen@plt>

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

LLVM IR (-O2):
define void @kazfulleos_set_arrays() {
tail call void @kazfulleos_set_arrays_perpoint_perline()
tail call void @kazfulleos_set_arrays_multidimen()
ret void
}
void Output(char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @Output(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ pbc_die(char *);
void *pbc_malloc(size_t);
void *pbc_calloc(size_t nmemb, size_t size) {
  void *res = pbc_malloc(nmemb * size);
  if (!res)
    pbc_die("calloc() error");
  memset(res, 0, nmemb * size);
  return res;
}


x86 assembly (clang, -O0):
<pbc_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1030 <pbc_malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1169 <pbc_calloc+0x39>
lea    0xe9c(%rip),%rdi
call   1050 <pbc_die@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbc_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1030 <pbc_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1157 <pbc_calloc+0x27>
lea    0xeae(%rip),%rdi
call   1050 <pbc_die@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"calloc() error\00"
define i8* @pbc_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @pbc_malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 @pbc_die(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
%15 = load i8*, i8** %5
%16 = load i64, i64* %3
%17 = load i64, i64* %4
%18 = mul i64 %16, %17
%19 = call i32 @memset(i8* %15, i32 0, i64 %18)
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@.str = [15 x i8] c"calloc() error\00"
define i8* @pbc_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @pbc_malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @pbc_die(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ *opendir(char *);
void createPathIfNotExists(char **path) {
  DIR *tmp;
  tmp = opendir(*path);
  if (tmp == NULL)
    mkdir(*path, 0700);
  else
    closedir(tmp);
}


x86 assembly (clang, -O0):
<createPathIfNotExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116d <createPathIfNotExists+0x3d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
jmp    1176 <createPathIfNotExists+0x46>
mov    -0x10(%rbp),%rdi
call   1050 <closedir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createPathIfNotExists>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1040 <opendir@plt>
test   %rax,%rax
je     114a <createPathIfNotExists+0x1a>
mov    %rax,%rdi
pop    %rbx
jmp    1050 <closedir@plt>
mov    (%rbx),%rdi
mov    $0x1c0,%esi
pop    %rbx
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
define void @createPathIfNotExists(i8** %0) {
%2 = alloca i8**
%3 = alloca i32*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = call i32* @opendir(i8* %5)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = call i32 @mkdir(i8* %11, i32 448)
br label %16
13: ; preds = %1
%14 = load i32*, i32** %3
%15 = call i32 @closedir(i32* %14)
br label %16
16: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
define void @createPathIfNotExists(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32* @opendir(i8* %2)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %0
%7 = tail call i32 @mkdir(i8* %6, i32 448)
br label %10
8: ; preds = %1
%9 = tail call i32 @closedir(i32* %3)
br label %10
10: ; preds = %8, %5
ret void
}
/* Variables and functions */
int streq(const char *buf1, const char *buf2, size_t c) {
  size_t i = 0;
  while (i < c) {
    if (buf1[i] != buf2[i])
      return 0;
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1163 <streq+0x63>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1152 <streq+0x52>
movl   $0x0,-0x4(%rbp)
jmp    116a <streq+0x6a>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1118 <streq+0x18>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
mov    $0x1,%eax
test   %rdx,%rdx
je     1124 <streq+0x24>
xor    %r8d,%r8d
nopl   (%rax)
movzbl (%rdi,%r8,1),%ecx
cmp    (%rsi,%r8,1),%cl
jne    1125 <streq+0x25>
add    $0x1,%r8
cmp    %r8,%rdx
jne    1110 <streq+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @streq(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %7
5: ; preds = %7
%6 = icmp eq i64 %14, %2
br i1 %6, label %15, label %7
7: ; preds = %3, %5
%8 = phi i64 [ %14, %5 ], [ 0, %3 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %1, i64 %8
%12 = load i8, i8* %11
%13 = icmp eq i8 %10, %12
%14 = add nuw i64 %8, 1
br i1 %13, label %5, label %15
15: ; preds = %7, %5, %3
%16 = phi i32 [ 1, %3 ], [ 1, %5 ], [ 0, %7 ]
ret i32 %16
}
void av_frame_apply_cropping() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_apply_cropping() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
int getpagesize();
int /*<<< orphan*/ munmap(int /*<<< orphan*/, unsigned long);
void unmap_dev_mem(unsigned long Base, unsigned long Size) {
  unsigned long alignOff = Base - (Base & ~(getpagesize() - 1));
  munmap((caddr_t)(Base - alignOff), (Size + alignOff));
}


x86 assembly (clang, -O0):
<unmap_dev_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <getpagesize@plt>
mov    -0x28(%rbp),%rcx
mov    %eax,%edx
mov    -0x20(%rbp),%rax
sub    $0x1,%edx
xor    $0xffffffff,%edx
movslq %edx,%rdx
and    %rdx,%rcx
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
add    -0x18(%rbp),%rsi
call   1030 <munmap@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmap_dev_mem>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <getpagesize@plt>
neg    %eax
movslq %eax,%rdi
and    %r14,%rdi
add    %r14,%rbx
sub    %rdi,%rbx
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define void @unmap_dev_mem(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %3
%8 = call i32 (...) @getpagesize()
%9 = sub nsw i32 %8, 1
%10 = xor i32 %9, -1
%11 = sext i32 %10 to i64
%12 = and i64 %7, %11
%13 = sub i64 %6, %12
store i64 %13, i64* %5
%14 = load i64, i64* %3
%15 = load i64, i64* %5
%16 = sub i64 %14, %15
%17 = trunc i64 %16 to i32
%18 = load i64, i64* %4
%19 = load i64, i64* %5
%20 = add i64 %18, %19
%21 = call i32 @munmap(i32 %17, i64 %20)
ret void
}

LLVM IR (-O2):
define void @unmap_dev_mem(i64 %0, i64 %1) {
%3 = tail call i32 (...) @getpagesize()
%4 = sub i32 0, %3
%5 = sext i32 %4 to i64
%6 = and i64 %5, %0
%7 = trunc i64 %6 to i32
%8 = add i64 %1, %0
%9 = sub i64 %8, %6
%10 = tail call i32 @munmap(i32 %7, i64 %9)
ret void
}
void fn2(int a) {
  const int x = a;
  if (x || x) {
  }
  if (x || (int)x) {
  }
  if ((int)x || x) {
  }
  if ((int)x || (int)x) {
  }
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1121 <fn2+0x21>
cmpl   $0x0,-0x8(%rbp)
je     1126 <fn2+0x26>
jmp    1126 <fn2+0x26>
cmpl   $0x0,-0x8(%rbp)
jne    113a <fn2+0x3a>
cmpl   $0x0,-0x8(%rbp)
je     113f <fn2+0x3f>
jmp    113f <fn2+0x3f>
cmpl   $0x0,-0x8(%rbp)
jne    1153 <fn2+0x53>
cmpl   $0x0,-0x8(%rbp)
je     1158 <fn2+0x58>
jmp    1158 <fn2+0x58>
cmpl   $0x0,-0x8(%rbp)
jne    116c <fn2+0x6c>
cmpl   $0x0,-0x8(%rbp)
je     1171 <fn2+0x71>
jmp    1171 <fn2+0x71>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fn2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7, %1
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14, %11
br label %18
18: ; preds = %17, %14
%19 = load i32, i32* %3
%20 = icmp ne i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %21, %18
br label %25
25: ; preds = %24, %21
%26 = load i32, i32* %3
%27 = icmp ne i32 %26, 0
br i1 %27, label %31, label %28
28: ; preds = %25
%29 = load i32, i32* %3
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %28, %25
br label %32
32: ; preds = %31, %28
ret void
}

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