xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void f1(char s[]) {
  s[0] = 'C';
  printf("f1: %s %lu\n", s, strlen(s));
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x43,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rbx
mov    %rdi,%rbx
movb   $0x43,(%rdi)
call   1030 <strlen@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"f1: %s %lu\0A\00"
define void @f1(i8* %0) {
store i8 67, i8* %0
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret void
}
/* Type definitions */
struct hashtable {
  int dummy;
};

/* Variables and functions */
struct hashtable *ht_create2(unsigned int, int);
struct hashtable *ht_create(unsigned int n) {
  return ht_create2(n, 1);
}


x86 assembly (clang, -O0):
<ht_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <ht_create2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_create>:
mov    $0x1,%esi
jmp    1030 <ht_create2@plt>

LLVM IR (-O0):
%struct.hashtable = type { i32 }
define %struct.hashtable* @ht_create(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call %struct.hashtable* @ht_create2(i32 %3, i32 1)
ret %struct.hashtable* %4
}

LLVM IR (-O2):
%struct.hashtable = type { i32 }
define %struct.hashtable* @ht_create(i32 %0) {
%2 = tail call %struct.hashtable* @ht_create2(i32 %0, i32 1)
ret %struct.hashtable* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ _out_16(int, int /*<<< orphan*/);
void write_register(uint16_t index, uint16_t data) {
  _out_16(0x01CE, index);
  _out_16(0x01CF, data);
}


x86 assembly (clang, -O0):
<write_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1ce,%edi
call   1030 <_out_16@plt>
mov    -0x8(%rbp),%esi
mov    $0x1cf,%edi
call   1030 <_out_16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_register>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x1ce,%edi
call   1030 <_out_16@plt>
mov    $0x1cf,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <_out_16@plt>

LLVM IR (-O0):
define void @write_register(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @_out_16(i32 462, i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @_out_16(i32 463, i32 %7)
ret void
}

LLVM IR (-O2):
define void @write_register(i32 %0, i32 %1) {
%3 = tail call i32 @_out_16(i32 462, i32 %0)
%4 = tail call i32 @_out_16(i32 463, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ Char_2d_array(int, int);
unsigned short **Ushort_2d_array(int i_size, int j_size) {
  return ((unsigned short **)Char_2d_array(i_size,
                                           j_size * sizeof(unsigned short)));
}


x86 assembly (clang, -O0):
<Ushort_2d_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
movslq -0x8(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%esi
call   1030 <Char_2d_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ushort_2d_array>:
add    %esi,%esi
jmp    1030 <Char_2d_array@plt>

LLVM IR (-O0):
define i16** @Ushort_2d_array(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 2
%9 = trunc i64 %8 to i32
%10 = call i64 @Char_2d_array(i32 %5, i32 %9)
%11 = inttoptr i64 %10 to i16**
ret i16** %11
}

LLVM IR (-O2):
define i16** @Ushort_2d_array(i32 %0, i32 %1) {
%3 = shl i32 %1, 1
%4 = tail call i64 @Char_2d_array(i32 %0, i32 %3)
%5 = inttoptr i64 %4 to i16**
ret i16** %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 3;
  int b;
  if (a == 3)
    b = 3;
  else
    b = 4;
  printf("%d", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    113c <main+0x2c>
movl   $0x3,-0xc(%rbp)
jmp    1143 <main+0x33>
movl   $0x4,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
long Long__DIV_(long x, long y) { return x / y; }


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

x86 assembly (clang, -O2):
<Long__DIV_>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <Long__DIV_+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

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

LLVM IR (-O2):
define i64 @Long__DIV_(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
ret i64 %3
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
time_t time_usec(time_t t) { return (time_t)t % 1000000; }


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

x86 assembly (clang, -O2):
<time_usec>:
movslq %edi,%rax
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @time_usec(i32 %0) {
%2 = srem i32 %0, 1000000
ret i32 %2
}
void test_five(int x, int y, int z) {
#pragma omp taskloop collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      for (int i = 0; i < z; i++)
        ;
}


x86 assembly (clang, -O0):
<test_five>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117f <test_five+0x7f>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116c <test_five+0x6c>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <test_five+0x59>
jmp    114b <test_five+0x4b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113a <test_five+0x3a>
jmp    115e <test_five+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <test_five+0x27>
jmp    1171 <test_five+0x71>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <test_five+0x14>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_five(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ limiterror(char *);
void etreefull() { limiterror("expression too complex (1201 nodes)"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"expression too complex (1201 nodes)\00"
define void @etreefull() {
%1 = call i32 @limiterror(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"expression too complex (1201 nodes)\00"
define void @etreefull() {
%1 = tail call i32 @limiterror(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int fn_sq_ch_68_ch_105_ch_115_ch_106_ch_111_ch_105_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115(
    char const *);
int fn_al_sq_ch_68_ch_105_ch_115_ch_106_ch_111_ch_105_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_68_ch_105_ch_115_ch_106_ch_111_ch_105_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_68_ch_105_ch_115_ch_106_ch_111_ch_105_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_68_ch_105_ch_115_ch_106_ch_111_ch_105_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_68_ch_105_ch_115_ch_106_ch_111_ch_105_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_68_ch_105_ch_115_ch_106_ch_111_ch_105_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_68_ch_105_ch_115_ch_106_ch_111_ch_105_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115>:
jmp    1030 <fn_sq_ch_68_ch_105_ch_115_ch_106_ch_111_ch_105_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115@plt>

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_68_ch_105_ch_115_ch_106_ch_111_ch_105_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115(i8* %0) {
%2 = tail call i32 @fn_sq_ch_68_ch_105_ch_115_ch_106_ch_111_ch_105_ch_110_ch_116_ch_67_ch_108_ch_97_ch_115_ch_115_ch_101_ch_115(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_set_minreq() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_set_minreq"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"NOT IMPLEMENTED:pa_memblockq_set_minreq\0A\00"
define i32 @pa_memblockq_set_minreq() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_memblockq_set_minreq\00"
define i32 @pa_memblockq_set_minreq() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fmtint(char *, unsigned int, int, int /*<<< orphan*/);
int fputs(char *, int /*<<< orphan*/ *);
int fputu(unsigned u, FILE *f) {
  char buff[32];
  fmtint(buff, u, 10, 0);
  return fputs(buff, f);
}


x86 assembly (clang, -O0):
<fputu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    $0xa,%edx
xor    %ecx,%ecx
call   1030 <fmtint@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fputs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputu>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%esi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xa,%edx
xor    %ecx,%ecx
call   1030 <fmtint@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <fputs@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @fputu(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [32 x i8]
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @fmtint(i8* %6, i32 %7, i32 10, i32 0)
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%10 = load i32*, i32** %4
%11 = call i32 @fputs(i8* %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @fputu(i32 %0, i32* nocapture %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @fmtint(i8* %4, i32 %0, i32 10, i32 0)
%6 = call i32 @fputs(i8* %4, i32* %1)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ truncate(char *, long);
int32_t portable_truncate(char *fname, long filesize) {
  return (truncate(fname, filesize));
}


x86 assembly (clang, -O0):
<portable_truncate>:
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 <truncate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portable_truncate>:
jmp    1030 <truncate@plt>

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

LLVM IR (-O2):
define i32 @portable_truncate(i8* %0, i64 %1) {
%3 = tail call i32 @truncate(i8* %0, i64 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint8_t sid_to_srvid(uint64_t sid) { return ((sid >> 56) & 0xFF); }


x86 assembly (clang, -O0):
<sid_to_srvid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
and    $0xff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sid_to_srvid(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ dns_wrapper_daemon(int);
void *dns_wrapper_thread(void *null) {
  dns_wrapper_daemon(53);
  return 0;
}


x86 assembly (clang, -O0):
<dns_wrapper_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x35,%edi
call   1030 <dns_wrapper_daemon@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @dns_wrapper_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @dns_wrapper_daemon(i32 53)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @dns_wrapper_thread(i8* nocapture readnone %0) {
%2 = tail call i32 @dns_wrapper_daemon(i32 53)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ printf(char *, char const *);
void die(const char *message) {
  if (errno) {
    perror(message);
  } else {
    printf("ERROR: %s\n", message);
  }
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     115b <die+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    116b <die+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
cmpq   $0x0,(%rax)
je     1157 <die+0x27>
mov    %rsi,%rdi
call   1040 <perror@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1149 <die+0x19>

LLVM IR (-O0):
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %5
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int wiringPiSPISetup(int channel, int speed) {
  printf("wiringPiSPISetup: channel=%d, speed=%d\n", channel, speed);
  return 1;
}


x86 assembly (clang, -O0):
<wiringPiSPISetup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiringPiSPISetup>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"wiringPiSPISetup: channel=%d, speed=%d\0A\00"
define i32 @wiringPiSPISetup(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 1
}

LLVM IR (-O2):
@.str = [40 x i8] c"wiringPiSPISetup: channel=%d, speed=%d\0A\00"
define i32 @wiringPiSPISetup(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ simpleArrayCreateRelease(int, int);
int *intdup(int a) {
  int *b = (int *)(simpleArrayCreateRelease(1, sizeof(int)));
  if (b == NULL) {
    printf("\nERROR: Insuficient memory to create an integer\n\n");
    exit(1);
  }
  *b = a;
  return b;
}


x86 assembly (clang, -O0):
<intdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <simpleArrayCreateRelease@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116f <intdup+0x3f>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intdup>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <simpleArrayCreateRelease@plt>
test   %rax,%rax
je     114b <intdup+0x1b>
mov    %ebx,(%rax)
pop    %rbx
ret
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"\0AERROR: Insuficient memory to create an integer\0A\0A\00"
define i32* @intdup(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i64 @simpleArrayCreateRelease(i32 1, i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32, i32* %2
%13 = load i32*, i32** %3
store i32 %12, i32* %13
%14 = load i32*, i32** %3
ret i32* %14
}

LLVM IR (-O2):
@str = [49 x i8] c"\0AERROR: Insuficient memory to create an integer\0A\00"
define i32* @intdup(i32 %0) {
%2 = tail call i64 @simpleArrayCreateRelease(i32 1, i32 4)
%3 = inttoptr i64 %2 to i32*
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
store i32 %0, i32* %3
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
int getInfo(char *buf, int bufLen) {
  static const char *INFO = "info { name=Audio }";
  int reqLen = strlen(INFO) + 1;
  if (buf != 0 && reqLen <= bufLen) {
    memcpy(buf, INFO, reqLen);
  }
  return reqLen;
}


x86 assembly (clang, -O0):
<getInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2efa(%rip),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <getInfo+0x4b>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116b <getInfo+0x4b>
mov    -0x8(%rbp),%rdi
mov    0x2ecd(%rip),%rsi
mov    -0x10(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInfo>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
test   %rbx,%rbx
je     1154 <getInfo+0x34>
cmp    %r14d,%eax
jge    1154 <getInfo+0x34>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@getInfo.INFO = internal global i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i32 0, i32 0)
@.str = [20 x i8] c"info { name=Audio }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** @getInfo.INFO
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %20
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = load i8*, i8** @getInfo.INFO
%18 = load i32, i32* %5
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
br label %20
20: ; preds = %15, %11, %2
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@.str = [20 x i8] c"info { name=Audio }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = add nsw i32 %3, 1
%5 = icmp ne i8* %0, null
%6 = icmp slt i32 %3, %1
%7 = select i1 %5, i1 %6, i1 false
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %10
10: ; preds = %8, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
int /*<<< orphan*/ padding(int);
void vt52ri(void) {
  esc("I");
  padding(5);
}


x86 assembly (clang, -O0):
<vt52ri>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
call   1030 <padding@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt52ri>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <padding@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"I\00"
define void @vt52ri() {
%1 = call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @padding(i32 5)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"I\00"
define void @vt52ri() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @padding(i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
char *strerror(int /*<<< orphan*/);
void errExitErrno(char *msg) {
  printf("%s: %s\n", msg, strerror(errno));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<errExitErrno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errExitErrno>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @errExitErrno(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @errExitErrno(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
char *procprt_NICE_e(struct tstat *curstat, int avgval, int nsecs) {
  return "   -";
}


x86 assembly (clang, -O0):
<procprt_NICE_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [5 x i8] c" -\00"
define i8* @procprt_NICE_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [5 x i8] c" -\00"
define i8* @procprt_NICE_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
void tile_ptr_xy(const void *p, int *x, int *y) {
  *x = ((long)p >> 32) & 0xffffffff;
  *y = (long)p & 0xffffffff;
}


x86 assembly (clang, -O0):
<tile_ptr_xy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x20,%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tile_ptr_xy>:
mov    %rdi,%rax
shr    $0x20,%rax
mov    %eax,(%rsi)
mov    %edi,(%rdx)
ret

LLVM IR (-O0):
define void @tile_ptr_xy(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
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = ashr i64 %8, 32
%10 = and i64 %9, 4294967295
%11 = trunc i64 %10 to i32
%12 = load i32*, i32** %5
store i32 %11, i32* %12
%13 = load i8*, i8** %4
%14 = ptrtoint i8* %13 to i64
%15 = and i64 %14, 4294967295
%16 = trunc i64 %15 to i32
%17 = load i32*, i32** %6
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @tile_ptr_xy(i8* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = ptrtoint i8* %0 to i64
%5 = lshr i64 %4, 32
%6 = trunc i64 %5 to i32
store i32 %6, i32* %1
%7 = trunc i64 %4 to i32
store i32 %7, i32* %2
ret void
}
/* Variables and functions */
char const *strndup(char const *, int);
char *strrchr(char const *, char);
int /*<<< orphan*/ strstr(char const *, char *);
const char *getName(const char *s) {
  int result = 0;
  if (!strstr(s, ".png")) {
    return NULL;
  }
  char *p = strrchr(s, '.');
  return strndup(s, p - s);
}


x86 assembly (clang, -O0):
<getName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%eax
jne    1169 <getName+0x39>
movq   $0x0,-0x8(%rbp)
jmp    1195 <getName+0x65>
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
call   1040 <strndup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getName>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1050 <strstr@plt>
test   %eax,%eax
je     115e <getName+0x2e>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
sub    %ebx,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <strndup@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c".png\00"
define i8* @getName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 0, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @strstr(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* null, i8** %2
br label %21
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i8* @strrchr(i8* %11, i8 signext 46)
store i8* %12, i8** %5
%13 = load i8*, i8** %3
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
%20 = call i8* @strndup(i8* %13, i32 %19)
store i8* %20, i8** %2
br label %21
21: ; preds = %10, %9
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
@.str = [5 x i8] c".png\00"
define noalias i8* @getName(i8* %0) {
%2 = tail call i32 @strstr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%6 = ptrtoint i8* %5 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = tail call i8* @strndup(i8* %0, i32 %9)
br label %11
11: ; preds = %1, %4
%12 = phi i8* [ %10, %4 ], [ null, %1 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__7__GeneralIO__clr();
void CC2420ControlP__RSTN__clr(void) { Msp430GpioC__7__GeneralIO__clr(); }


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

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

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

LLVM IR (-O2):
define void @CC2420ControlP__RSTN__clr() {
%1 = tail call i32 (...) @Msp430GpioC__7__GeneralIO__clr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr,
          "Usage: %s [-v] [-n] [-g] -h <heads> -s <sectors> -o <outputfile> "
          "[-a 0..4] [-l <align kB>] [-G <guid>] [[-t <type>] [-r] [-N <name>] "
          "-p <size>[@<start>]...] \n",
          prog);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [159 x i8] c"Usage: %s [-v] [-n] [-g] -h <heads> -s <sectors> -o <outputfile> [-a 0..4] [-l <align kB>] [-G <guid>] [[-t <type>] [-r] [-N <name>] -p <size>[@<start>]...] \0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [159 x i8] c"Usage: %s [-v] [-n] [-g] -h <heads> -s <sectors> -o <outputfile> [-a 0..4] [-l <align kB>] [-G <guid>] [[-t <type>] [-r] [-N <name>] -p <size>[@<start>]...] \0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
__typeof__(snprintf(1, 1, (void *)1)) test_snprintf_256(void) {
  return snprintf(1, 1, (void *)1);
}


x86 assembly (clang, -O0):
<test_snprintf_256>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
mov    $0x0,%al
call   1030 <snprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_snprintf_256>:
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
define i32 @test_snprintf_256() {
%1 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* inttoptr (i64 1 to i8*), i64 1, i8* inttoptr (i64 1 to i8*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_snprintf_256() {
%1 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* inttoptr (i64 1 to i8*), i64 1, i8* inttoptr (i64 1 to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ outbyte1(int);
nl1() { outbyte1(10); }


x86 assembly (clang, -O0):
<nl1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <outbyte1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl1>:
mov    $0xa,%edi
jmp    1030 <outbyte1@plt>

LLVM IR (-O0):
define i32 @nl1() {
%1 = alloca i32
%2 = call i32 @outbyte1(i32 10)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @nl1() {
%1 = tail call i32 @outbyte1(i32 10)
ret i32 undef
}
void fn_test2(void) { printf("%s\n", __func__); }


x86 assembly (clang, -O0):
<fn_test2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__func__.fn_test2 = [9 x i8] c"fn_test2\00"
define void @fn_test2() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.fn_test2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.fn_test2 = [9 x i8] c"fn_test2\00"
define void @fn_test2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.fn_test2, i64 0, i64 0))
ret void
}
double TestAdd(double X, float Y) { return X + Y + .5; }


x86 assembly (clang, -O0):
<TestAdd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  0xed8(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestAdd>:
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
addsd  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @TestAdd(double %0, float %1) {
%3 = alloca double
%4 = alloca float
store double %0, double* %3
store float %1, float* %4
%5 = load double, double* %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fadd double %5, %7
%9 = fadd double %8, 5.000000e-01
ret double %9
}

LLVM IR (-O2):
define double @TestAdd(double %0, float %1) {
%3 = fpext float %1 to double
%4 = fadd double %3, %0
%5 = fadd double %4, 5.000000e-01
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ sockets_initialize();
int /*<<< orphan*/ useSockets();
void test3(void) {
  sockets_initialize();
  useSockets();
}


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

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

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

LLVM IR (-O2):
define void @test3() {
%1 = tail call i32 (...) @sockets_initialize()
%2 = tail call i32 (...) @useSockets()
ret void
}
void av_bprint_clear() {}


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

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

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

LLVM IR (-O2):
define void @av_bprint_clear() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glFlush();
void draw_flush(void) { glFlush(); }


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

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

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

LLVM IR (-O2):
define void @draw_flush() {
%1 = tail call i32 (...) @glFlush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_eof(int);
int /*<<< orphan*/ is_eol(int);
int /*<<< orphan*/ is_visible_ascii_character(int);
bool is_whitespace(int c) {
  if (!is_visible_ascii_character(c) && !is_eof(c) && !is_eol(c)) {
    return true;
  }
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <is_visible_ascii_character@plt>
cmp    $0x0,%eax
jne    1175 <is_whitespace+0x45>
mov    -0x8(%rbp),%edi
call   1030 <is_eof@plt>
cmp    $0x0,%eax
jne    1175 <is_whitespace+0x45>
mov    -0x8(%rbp),%edi
call   1040 <is_eol@plt>
cmp    $0x0,%eax
jne    1175 <is_whitespace+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
push   %rbx
mov    %edi,%ebx
call   1050 <is_visible_ascii_character@plt>
test   %eax,%eax
jne    114e <is_whitespace+0x1e>
mov    %ebx,%edi
call   1030 <is_eof@plt>
test   %eax,%eax
jne    114e <is_whitespace+0x1e>
mov    %ebx,%edi
call   1040 <is_eol@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_whitespace(i32 %0) {
%2 = tail call i32 @is_visible_ascii_character(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @is_eof(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @is_eol(i32 %0)
br label %9
9: ; preds = %7, %4, %1
ret i32 1
}
/* Type definitions */
struct pollfd {
  int dummy;
};

/* Variables and functions */
int pin_get_level(int, struct pollfd *);
void pin_wait_level(int fd, struct pollfd *fds, int level) {
  int res;
  do {
    res = pin_get_level(fd, fds);
  } while (res != level);
}


x86 assembly (clang, -O0):
<pin_wait_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <pin_get_level@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1122 <pin_wait_level+0x12>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pin_wait_level>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <pin_get_level@plt>
cmp    %r14d,%eax
jne    1120 <pin_wait_level+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.pollfd = type { i32 }
define void @pin_wait_level(i32 %0, %struct.pollfd* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.pollfd*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.pollfd* %1, %struct.pollfd** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %12, %3
%9 = load i32, i32* %4
%10 = load %struct.pollfd*, %struct.pollfd** %5
%11 = call i32 @pin_get_level(i32 %9, %struct.pollfd* %10)
store i32 %11, i32* %7
br label %12
12: ; preds = %8
%13 = load i32, i32* %7
%14 = load i32, i32* %6
%15 = icmp ne i32 %13, %14
br i1 %15, label %8, label %16
16: ; preds = %12
ret void
}

LLVM IR (-O2):
%struct.pollfd = type { i32 }
define void @pin_wait_level(i32 %0, %struct.pollfd* %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @pin_get_level(i32 %0, %struct.pollfd* %1)
%6 = icmp eq i32 %5, %2
br i1 %6, label %7, label %4
7: ; preds = %4
ret void
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int in;
  scanf("%d", &in);
  printf("%d", exact_square(in));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <exact_square@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @exact_square(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}