xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int getfilename(char *pfilename, char *pweekstring, char *pyearstring) {
  int z;
  sprintf(pfilename, "tc%s%s.tcd", pyearstring, pweekstring);
  z = 1;
  return z;
}


x86 assembly (clang, -O0):
<getfilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <sprintf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfilename>:
push   %rax
mov    %rsi,%rcx
lea    0xee5(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"tc%s%s.tcd\00"
define i32 @getfilename(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %6
%10 = load i8*, i8** %5
%11 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
store i32 1, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
@.str = [11 x i8] c"tc%s%s.tcd\00"
define i32 @getfilename(i8* nocapture writeonly %0, i8* %1, i8* %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %1)
ret i32 1
}
int main() {
  int a = 1;
  int array[10];
  int i;
#pragma acc parallel num_gangs(1) copy(a)
  {
    a += 2;
#pragma acc loop vector private(a)
    for (i = 0; i < 10; i++) {
      a = array[i];
      a = a * a;
      array[i] = a;
    }
  }
  if (a != 3) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    115a <main+0x5a>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1122 <main+0x22>
cmpl   $0x3,-0x8(%rbp)
je     1170 <main+0x70>
movl   $0x1,-0x4(%rbp)
jmp    1177 <main+0x77>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ primes;

/* Variables and functions */
int nthSuperUglyNumber(int, int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int primes[] = {2, 7, 13, 19};
  int n = 12;
  int result =
      nthSuperUglyNumber(n, primes, sizeof(primes) / sizeof(primes[0]));
  printf("result: %d\n", result);
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0xc,%edi
mov    $0x4,%edx
call   1030 <nthSuperUglyNumber@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.primes = [4 x i32] [i32 2, i32 7, i32 13, i32 19]
@.str = [12 x i8] c"result: %d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [4 x i32]* %1 to i8*
store i32 12, i32* %2
%5 = load i32, i32* %2
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%7 = call i32 @nthSuperUglyNumber(i32 %5, i32* %6, i32 4)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.primes = [4 x i32] [i32 2, i32 7, i32 13, i32 19]
@.str = [12 x i8] c"result: %d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @nthSuperUglyNumber(i32 12, i32* %3, i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int address;

/* Variables and functions */
int /*<<< orphan*/ tpi_read();
int /*<<< orphan*/ tpi_write(int);
uint8_t tpi_sldcs(uint8_t address) {
  tpi_write((0x80) | ((address) & (0x0F)));
  return tpi_read();
}


x86 assembly (clang, -O0):
<tpi_sldcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xf,%edi
or     $0x80,%edi
call   1040 <tpi_write@plt>
mov    $0x0,%al
call   1030 <tpi_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tpi_sldcs>:
push   %rax
and    $0xf,%edi
or     $0x80,%edi
call   1040 <tpi_write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <tpi_read@plt>

LLVM IR (-O0):
define i32 @tpi_sldcs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = or i32 128, %4
%6 = call i32 @tpi_write(i32 %5)
%7 = call i32 (...) @tpi_read()
ret i32 %7
}

LLVM IR (-O2):
define i32 @tpi_sldcs(i32 %0) {
%2 = and i32 %0, 15
%3 = or i32 %2, 128
%4 = tail call i32 @tpi_write(i32 %3)
%5 = tail call i32 (...) @tpi_read()
ret i32 %5
}
int angel_settime(struct timespec *ts, struct timezone *tz) { return 0; }


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

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

LLVM IR (-O0):
%struct.timespec = type opaque
%struct.timezone = type opaque
define i32 @angel_settime(%struct.timespec* %0, %struct.timezone* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timezone*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timezone* %1, %struct.timezone** %4
ret i32 0
}

LLVM IR (-O2):
%struct.timespec = type opaque
%struct.timezone = type opaque
define i32 @angel_settime(%struct.timespec* nocapture readnone %0, %struct.timezone* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ character_array();
void chapter01() { character_array(); }


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

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

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

LLVM IR (-O2):
define void @chapter01() {
%1 = tail call i32 (...) @character_array()
ret void
}
void *_malloc_(int size) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @_malloc_(i32 %0) {
ret i8* null
}
unsigned int test4(unsigned int d) { return ~d + d; }


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

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

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

LLVM IR (-O2):
define i32 @test4(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ f(double *);
void test_fatptr() {
  double x = 10;
  f(&x);
}


x86 assembly (clang, -O0):
<test_fatptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fatptr>:
push   %rax
movabs $0x4024000000000000,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <f@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test_fatptr() {
%1 = alloca double
store double 1.000000e+01, double* %1
%2 = call i32 @f(double* %1)
ret void
}

LLVM IR (-O2):
define void @test_fatptr() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 1.000000e+01, double* %1
%3 = call i32 @f(double* %1)
ret void
}
/* Type definitions */
typedef void uint8_t;
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ sg_put_unaligned_le32(int, void *);
void sg_put_unaligned_le64(uint64_t val, void *p) {
  sg_put_unaligned_le32(val >> 32, (uint8_t *)p + 4);
  sg_put_unaligned_le32(val, p);
}


x86 assembly (clang, -O0):
<sg_put_unaligned_le64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
call   1030 <sg_put_unaligned_le32@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <sg_put_unaligned_le32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_put_unaligned_le64>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x4,%rsi
call   1030 <sg_put_unaligned_le32@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <sg_put_unaligned_le32@plt>

LLVM IR (-O0):
define void @sg_put_unaligned_le64(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 32
%7 = load i8*, i8** %4
%8 = getelementptr i8, i8* %7, i64 4
%9 = call i32 @sg_put_unaligned_le32(i32 %6, i8* %8)
%10 = load i32, i32* %3
%11 = load i8*, i8** %4
%12 = call i32 @sg_put_unaligned_le32(i32 %10, i8* %11)
ret void
}

LLVM IR (-O2):
define void @sg_put_unaligned_le64(i32 %0, i8* %1) {
%3 = getelementptr i8, i8* %1, i64 4
%4 = tail call i32 @sg_put_unaligned_le32(i32 poison, i8* %3)
%5 = tail call i32 @sg_put_unaligned_le32(i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int remove_last_slack(int k) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(171, &k, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<remove_last_slack>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xab,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @remove_last_slack(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 171, i32* %2, i32* undef, double* undef)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *realloc(int /*<<< orphan*/, int);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  char *x;
  write(1, "A\n", 2);
  x = realloc(0, 8);
  write(1, "B\n", 2);
  free(x);
  write(1, "C\n", 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xeb5(%rip),%rsi
mov    $0x2,%edx
call   1040 <write@plt>
xor    %edi,%edi
mov    $0x8,%esi
call   1050 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
lea    0xe92(%rip),%rsi
mov    $0x2,%edx
call   1040 <write@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%edi
lea    0xe76(%rip),%rsi
mov    $0x2,%edx
call   1040 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
call   1040 <write@plt>
xor    %edi,%edi
mov    $0x8,%esi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xea6(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
call   1040 <write@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe8b(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
call   1040 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"A\0A\00"
@.str.1 = [3 x i8] c"B\0A\00"
@.str.2 = [3 x i8] c"C\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = call i8* @realloc(i32 0, i32 8)
store i8* %4, i8** %2
%5 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
%8 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"A\0A\00"
@.str.1 = [3 x i8] c"B\0A\00"
@.str.2 = [3 x i8] c"C\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i8* @realloc(i32 0, i32 8)
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%4 = tail call i32 @free(i8* %2)
%5 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ czytaj();
int /*<<< orphan*/ init();
long oblicz();
int /*<<< orphan*/ printf(char *, long);
int main() {
  init();
  czytaj();
  long wynik = oblicz();
  printf("%ld\n", wynik);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <init@plt>
mov    $0x0,%al
call   1050 <czytaj@plt>
mov    $0x0,%al
call   1030 <oblicz@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <init@plt>
xor    %eax,%eax
call   1050 <czytaj@plt>
xor    %eax,%eax
call   1030 <oblicz@plt>
lea    0xea3(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @czytaj()
%3 = tail call i64 (...) @oblicz()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void printUsage(char *appname) {
  char *usage =
      "%s usage:\n\n"
      "\t-h                 Print help\n"
      "\t-d <device name>   Serial port device (default: /dev/ttyS0)\n"
      "\t-a <address>       IP address (default: 127.0.0.1)\n"
      "\t-p <port>          UDP port (default: 9999)\n";
  fprintf(stderr, usage, appname);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [201 x i8] c"%s usage:\0A\0A\09-h Print help\0A\09-d <device name> Serial port device (default: /dev/ttyS0)\0A\09-a <address> IP address (default: 127.0.0.1)\0A\09-p <port> UDP port (default: 9999)\0A\00"
@stderr = global i32 0
define void @printUsage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %4, i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [201 x i8] c"%s usage:\0A\0A\09-h Print help\0A\09-d <device name> Serial port device (default: /dev/ttyS0)\0A\09-a <address> IP address (default: 127.0.0.1)\0A\09-p <port> UDP port (default: 9999)\0A\00"
@stderr = global i32 0
define void @printUsage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef void const *b;
typedef void *a;

/* Variables and functions */
int /*<<< orphan*/ cpy3(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int cpy4(void *, void const *);
void cpy7(void *a, const void *b) {
  cpy4(a, b), cpy3((uint8_t *)a + 4, (uint8_t *)b + 4);
}


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

x86 assembly (clang, -O2):
<cpy7>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <cpy4@plt>
add    $0x10,%rbx
add    $0x10,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <cpy3@plt>

LLVM IR (-O0):
define void @cpy7(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 = load i8*, i8** %4
%7 = call i32 @cpy4(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 4
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = getelementptr inbounds i32, i32* %12, i64 4
%14 = call i32 @cpy3(i32* %10, i32* %13)
ret void
}

LLVM IR (-O2):
define void @cpy7(i8* %0, i8* %1) {
%3 = tail call i32 @cpy4(i8* %0, i8* %1)
%4 = getelementptr inbounds i8, i8* %0, i64 16
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i8, i8* %1, i64 16
%7 = bitcast i8* %6 to i32*
%8 = tail call i32 @cpy3(i32* %5, i32* %7)
ret void
}
int fun1355() { return 1355; }


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

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

LLVM IR (-O0):
define i32 @fun1355() {
ret i32 1355
}

LLVM IR (-O2):
define i32 @fun1355() {
ret i32 1355
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  i = 200;
  while (i >= 100) {
    i = i - 2;
    assert(i > 0);
  }
  assert(i > 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc8,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jl     114f <main+0x3f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1126 <main+0x16>
cmpl   $0x64,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xca,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <assert@plt>
add    $0xfffffffe,%ebx
cmp    $0x65,%ebx
ja     1120 <main+0x10>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 200, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 100
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 2
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
br label %3
13: ; preds = %3
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 100
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 200, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, -2
%4 = tail call i32 @assert(i32 1)
%5 = icmp ugt i32 %2, 101
br i1 %5, label %1, label %6
6: ; preds = %1
%7 = tail call i32 @assert(i32 0)
ret i32 0
}
int f(int a[5]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32* nocapture readnone %0) {
ret i32 0
}
unsigned int get4(unsigned char *p) {
  return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
}


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

x86 assembly (clang, -O2):
<get4>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get4(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 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @get4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int printf(char *, char *);
int main() {
  char *name = "anass";
  return printf("%s\n", name);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xeef(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"anass\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ d2i_of_void;
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *PEM_ASN1_read_bio(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                      int /*<<< orphan*/ *, void **,
                                      int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ PEM_STRING_PUBLIC;
scalar_t__ d2i_RSA_PUBKEY;
RSA *PEM_read_bio_RSA_PUBKEY(BIO *bp, RSA **x, pem_password_cb *cb, void *u) {
  return PEM_ASN1_read_bio((d2i_of_void *)d2i_RSA_PUBKEY, PEM_STRING_PUBLIC, bp,
                           (void **)x, cb, u);
}


x86 assembly (clang, -O0):
<PEM_read_bio_RSA_PUBKEY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <PEM_ASN1_read_bio@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_bio_RSA_PUBKEY>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <PEM_ASN1_read_bio@plt>

LLVM IR (-O0):
@d2i_RSA_PUBKEY = global i64 0
@PEM_STRING_PUBLIC = global i32 0
define i32* @PEM_read_bio_RSA_PUBKEY(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i64, i64* @d2i_RSA_PUBKEY
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* @PEM_STRING_PUBLIC
%12 = load i32*, i32** %5
%13 = load i32**, i32*** %6
%14 = bitcast i32** %13 to i8**
%15 = load i32*, i32** %7
%16 = load i8*, i8** %8
%17 = call i32* @PEM_ASN1_read_bio(i32* %10, i32 %11, i32* %12, i8** %14, i32* %15, i8* %16)
ret i32* %17
}

LLVM IR (-O2):
@d2i_RSA_PUBKEY = global i64 0
@PEM_STRING_PUBLIC = global i32 0
define i32* @PEM_read_bio_RSA_PUBKEY(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = load i64, i64* @d2i_RSA_PUBKEY
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_PUBLIC
%8 = bitcast i32** %1 to i8**
%9 = tail call i32* @PEM_ASN1_read_bio(i32* %6, i32 %7, i32* %0, i8** %8, i32* %2, i8* %3)
ret i32* %9
}
double Somar(double a, double b) { return a + b; }


x86 assembly (clang, -O0):
<Somar>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Somar>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Somar(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @Somar(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
signed int lstat(const char *__path, struct stat *__statbuf) {
  signed int return_value___lxstat$1;
  return_value___lxstat$1 = __lxstat(1, __path, __statbuf);
  return return_value___lxstat$1;
}


x86 assembly (clang, -O0):
<lstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <__lxstat@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lstat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <__lxstat@plt>

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%6 = load i8*, i8** %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = call i32 (i32, i8*, %struct.stat*, ...) bitcast (i32 (...)* @__lxstat to i32 (i32, i8*, %struct.stat*, ...)*)(i32 1, i8* %6, %struct.stat* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 (i32, i8*, %struct.stat*, ...) bitcast (i32 (...)* @__lxstat to i32 (i32, i8*, %struct.stat*, ...)*)(i32 1, i8* %0, %struct.stat* %1)
ret i32 %3
}
void PeerQOSAction(struct rt_rtmp_adapter *pAd,
                   struct rt_mlme_queue_elem *Elem) {}


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

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

LLVM IR (-O0):
%struct.rt_rtmp_adapter = type opaque
%struct.rt_mlme_queue_elem = type opaque
define void @PeerQOSAction(%struct.rt_rtmp_adapter* %0, %struct.rt_mlme_queue_elem* %1) {
%3 = alloca %struct.rt_rtmp_adapter*
%4 = alloca %struct.rt_mlme_queue_elem*
store %struct.rt_rtmp_adapter* %0, %struct.rt_rtmp_adapter** %3
store %struct.rt_mlme_queue_elem* %1, %struct.rt_mlme_queue_elem** %4
ret void
}

LLVM IR (-O2):
%struct.rt_rtmp_adapter = type opaque
%struct.rt_mlme_queue_elem = type opaque
define void @PeerQOSAction(%struct.rt_rtmp_adapter* nocapture %0, %struct.rt_mlme_queue_elem* nocapture %1) {
ret void
}
double NonOverlappingTemplateMatchings(char *epsilon, int n, int m) {
  return (0);
}


x86 assembly (clang, -O0):
<NonOverlappingTemplateMatchings>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @NonOverlappingTemplateMatchings(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
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @NonOverlappingTemplateMatchings(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret double 0.000000e+00
}
void fc279(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
a : {
  typedef int(*f)[n];
  {
    typedef int(*g)[n];
    0;
  };
  {
    typedef int(*h)[n];
    0;
  };
  ;
  typedef int(*i)[n];
  0;
};
  ;
  typedef int(*j)[n];
  0;
  goto a;
}


x86 assembly (clang, -O0):
<fc279>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc279+0x7>

x86 assembly (clang, -O2):
<fc279>:
jmp    1100 <fc279>

LLVM IR (-O0):
define void @fc279(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %1
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
%20 = load i32, i32* %2
%21 = zext i32 %20 to i64
br label %11
}

LLVM IR (-O2):
define void @fc279(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
short tf_bh(signed char x, short c) { return c / 3; }


x86 assembly (clang, -O0):
<tf_bh>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf_bh>:
imul   $0x5556,%esi,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
shr    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @tf_bh(i8 signext %0, i16 signext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = sdiv i32 %6, 3
%8 = trunc i32 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define signext i16 @tf_bh(i8 signext %0, i16 signext %1) {
%3 = sdiv i16 %1, 3
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ crash(char *);
void fault(int dum) { crash("fault"); }


x86 assembly (clang, -O0):
<fault>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <crash@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"fault\00"
define void @fault(i32 %0) {
%2 = tail call i32 @crash(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main() {
  int x = 0;
  while (1) {
    __VERIFIER_assert(x == 0);
  }
  __VERIFIER_assert(x == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0x9(%rbp)
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <__VERIFIER_assert@plt>
jmp    1120 <main+0x10>

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 = %0, %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @__VERIFIER_assert(i32 %6)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @__VERIFIER_assert(i32 1)
br label %1
}
/* Variables and functions */
int id(int);
int id2(int x) {
  if (x == 0)
    return 0;
  int ret = id(x - 1) + 1;
  if (ret > 2)
    return 2;
  return ret;
}


x86 assembly (clang, -O0):
<id2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <id2+0x21>
movl   $0x0,-0x4(%rbp)
jmp    115e <id2+0x4e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <id@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jle    1158 <id2+0x48>
movl   $0x2,-0x4(%rbp)
jmp    115e <id2+0x4e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<id2>:
test   %edi,%edi
je     1130 <id2+0x20>
push   %rax
add    $0xffffffff,%edi
call   1030 <id@plt>
lea    0x1(%rax),%ecx
cmp    $0x2,%eax
mov    $0x2,%eax
cmovl  %ecx,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @id2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %18
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = call i32 @id(i32 %10)
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 2
br i1 %14, label %15, label %16
15: ; preds = %8
store i32 2, i32* %2
br label %18
16: ; preds = %8
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %15, %7
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @id2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @id(i32 %4)
%6 = add nsw i32 %5, 1
%7 = icmp slt i32 %5, 2
%8 = select i1 %7, i32 %6, i32 2
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ 0, %1 ]
ret i32 %10
}
signed long long v_signed_long_long_func() { return (0); }


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

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

LLVM IR (-O0):
define i64 @v_signed_long_long_func() {
ret i64 0
}

LLVM IR (-O2):
define i64 @v_signed_long_long_func() {
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, unsigned long,
                         int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(unsigned char *, unsigned long, int,
                          int /*<<< orphan*/ *);
void write_mtd(unsigned char *buffer, FILE *fp, unsigned long offset,
               unsigned long len) {
  fseek(fp, offset, SEEK_SET);
  fwrite(buffer, len, 1, fp);
}


x86 assembly (clang, -O0):
<write_mtd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_mtd>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %eax,%edx
call   1030 <fseek@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @write_mtd(i8* %0, i32* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i32*, i32** %6
%10 = load i64, i64* %7
%11 = load i32, i32* @SEEK_SET
%12 = call i32 @fseek(i32* %9, i64 %10, i32 %11)
%13 = load i8*, i8** %5
%14 = load i64, i64* %8
%15 = load i32*, i32** %6
%16 = call i32 @fwrite(i8* %13, i64 %14, i32 1, i32* %15)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @write_mtd(i8* nocapture %0, i32* nocapture %1, i64 %2, i64 %3) {
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %1, i64 %2, i32 %5)
%7 = tail call i32 @fwrite(i8* %0, i64 %3, i32 1, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ ni();
__attribute__((flatten)) void g(void) {
  f();
  ni();
}


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

x86 assembly (clang, -O2):
<g>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ni@plt>

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

LLVM IR (-O2):
define void @g() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @ni()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sti();
void irqenable() { sti(); }


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

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

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

LLVM IR (-O2):
define void @irqenable() {
%1 = tail call i32 (...) @sti()
ret void
}
void reverse(char *begin, char *end) {
  char temp;
  while (begin < end) {
    temp = *begin;
    *begin++ = *end;
    *end-- = temp;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1153 <reverse+0x53>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <reverse+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    %rsi,%rdi
jae    112c <reverse+0x2c>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax)
movzbl (%rdi),%eax
movzbl 0x1(%rsi),%ecx
mov    %cl,(%rdi)
add    $0x1,%rdi
mov    %al,0x1(%rsi)
lea    -0x1(%rsi),%rax
cmp    %rsi,%rdi
mov    %rax,%rsi
jb     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define void @reverse(i8* %0, i8* %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %9, %4 ], [ %0, %2 ]
%6 = phi i8* [ %10, %4 ], [ %1, %2 ]
%7 = load i8, i8* %5
%8 = load i8, i8* %6
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %8, i8* %5
%10 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 %7, i8* %6
%11 = icmp ult i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
void ab1cdefghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @ab1cdefghijklmnopqrstuvwxzy() {
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
int64_t _get_time_us(void) {
  struct timeval tv;
  (void)gettimeofday(&tv, 0);
  return (int64_t)tv.tv_sec * 1000000 + (int64_t)tv.tv_usec;
}


x86 assembly (clang, -O0):
<_get_time_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    -0x10(%rbp),%rcx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_time_us>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @_get_time_us() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @_get_time_us() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
ret i32 %11
}
/* Type definitions */
struct ndm_strvec_t {
  int dummy;
};

/* Variables and functions */
char const *ndm_strvec_insert_at(struct ndm_strvec_t *, int /*<<< orphan*/,
                                 char const *const);
const char *ndm_strvec_push_front(struct ndm_strvec_t *v, const char *const s) {
  return ndm_strvec_insert_at(v, 0, s);
}


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

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

LLVM IR (-O0):
%struct.ndm_strvec_t = type { i32 }
define i8* @ndm_strvec_push_front(%struct.ndm_strvec_t* %0, i8* %1) {
%3 = alloca %struct.ndm_strvec_t*
%4 = alloca i8*
store %struct.ndm_strvec_t* %0, %struct.ndm_strvec_t** %3
store i8* %1, i8** %4
%5 = load %struct.ndm_strvec_t*, %struct.ndm_strvec_t** %3
%6 = load i8*, i8** %4
%7 = call i8* @ndm_strvec_insert_at(%struct.ndm_strvec_t* %5, i32 0, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.ndm_strvec_t = type { i32 }
define i8* @ndm_strvec_push_front(%struct.ndm_strvec_t* %0, i8* %1) {
%3 = tail call i8* @ndm_strvec_insert_at(%struct.ndm_strvec_t* %0, i32 0, i8* %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct bladerf {
  int dummy;
};

/* Variables and functions */
int nios_legacy_pio_write(struct bladerf *, int, int /*<<< orphan*/);
int nios_legacy_xb200_synth_write(struct bladerf *dev, uint32_t value) {
  do {
    do {
    } while (0);
  } while (0);
  return nios_legacy_pio_write(dev, 36, value);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
jmp    1124 <nios_legacy_xb200_synth_write+0x14>
jmp    1129 <nios_legacy_xb200_synth_write+0x19>
jmp    112e <nios_legacy_xb200_synth_write+0x1e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x24,%esi
call   1030 <nios_legacy_pio_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%edx
mov    $0x24,%esi
jmp    1030 <nios_legacy_pio_write@plt>

LLVM IR (-O0):
%struct.bladerf = type { i32 }
define i32 @nios_legacy_xb200_synth_write(%struct.bladerf* %0, i32 %1) {
%3 = alloca %struct.bladerf*
%4 = alloca i32
store %struct.bladerf* %0, %struct.bladerf** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
%9 = load %struct.bladerf*, %struct.bladerf** %3
%10 = load i32, i32* %4
%11 = call i32 @nios_legacy_pio_write(%struct.bladerf* %9, i32 36, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.bladerf = type { i32 }
define i32 @nios_legacy_xb200_synth_write(%struct.bladerf* %0, i32 %1) {
%3 = tail call i32 @nios_legacy_pio_write(%struct.bladerf* %0, i32 36, i32 %1)
ret i32 %3
}