xunge/DecIR huggingface dataset:
/* Type definitions */
struct buffer {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ buf_pushchar(struct buffer *, int);
int read_char(int /*<<< orphan*/ *);
unsigned buf_freadchars(struct buffer *buf, FILE *in) {
  unsigned i = 0;
  int ch;
  while ((ch = read_char(in))) {
    buf_pushchar(buf, ch);
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<buf_freadchars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <read_char@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     1166 <buf_freadchars+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <buf_pushchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <buf_freadchars+0x17>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_freadchars>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <read_char@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     1159 <buf_freadchars+0x39>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <buf_pushchar@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
call   1040 <read_char@plt>
test   %eax,%eax
jne    1140 <buf_freadchars+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @buf_freadchars(%struct.buffer* %0, i32* %1) {
%3 = tail call i32 @read_char(i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ %3, %2 ]
%7 = phi i32 [ %9, %5 ], [ 0, %2 ]
%8 = tail call i32 @buf_pushchar(%struct.buffer* %0, i32 %6)
%9 = add i32 %7, 1
%10 = tail call i32 @read_char(i32* %1)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %9, %5 ]
ret i32 %13
}
int pq2ads_pci_init_irq(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pq2ads_pci_init_irq() {
ret i32 0
}
/* Variables and functions */
int getrandom();
void getarr(int arr[], int n) {
  while (n--)
    arr[n] = getrandom();
}


x86 assembly (clang, -O0):
<getarr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     114c <getarr+0x3c>
mov    $0x0,%al
call   1030 <getrandom@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    111f <getarr+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getarr>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1144 <getarr+0x34>
mov    %esi,%r15d
movslq %esi,%rax
lea    (%rdi,%rax,4),%r14
add    $0xfffffffffffffffc,%r14
neg    %r15d
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getrandom@plt>
mov    %eax,(%r14,%rbx,4)
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r15d
jne    1130 <getarr+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @getarr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = call i32 (...) @getrandom()
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 %10, i32* %14
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @getarr(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = tail call i32 (...) @getrandom()
%10 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %9, i32* %10
%11 = trunc i64 %8 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int isprint(int c) { return (unsigned)c - 0x20 < 0x5f; }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cmp    $0x5f,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 32
%5 = icmp ult i32 %4, 95
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned short int swap_2byte(word2)
unsigned short int word2;
{
  union {
    unsigned char character[2];
    unsigned short int integer;
  } swap2byte;
  char temp0;
  swap2byte.integer = word2;
  temp0 = swap2byte.character[0];
  swap2byte.character[0] = swap2byte.character[1];
  swap2byte.character[1] = temp0;
  return (swap2byte.integer);
}


x86 assembly (clang, -O0):
<swap_2byte>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x8(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x7(%rbp)
movzwl -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_2byte>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
%union.anon = type { i16 }
define zeroext i16 @swap_2byte(i32 %0) {
%2 = alloca i16
%3 = alloca %union.anon
%4 = alloca i8
%5 = trunc i32 %0 to i16
store i16 %5, i16* %2
%6 = load i16, i16* %2
%7 = bitcast %union.anon* %3 to i16*
store i16 %6, i16* %7
%8 = bitcast %union.anon* %3 to [2 x i8]*
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%10 = load i8, i8* %9
store i8 %10, i8* %4
%11 = bitcast %union.anon* %3 to [2 x i8]*
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %11, i64 0, i64 1
%13 = load i8, i8* %12
%14 = bitcast %union.anon* %3 to [2 x i8]*
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %14, i64 0, i64 0
store i8 %13, i8* %15
%16 = load i8, i8* %4
%17 = bitcast %union.anon* %3 to [2 x i8]*
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %17, i64 0, i64 1
store i8 %16, i8* %18
%19 = bitcast %union.anon* %3 to i16*
%20 = load i16, i16* %19
ret i16 %20
}

LLVM IR (-O2):
define zeroext i16 @swap_2byte(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
ret i16 %3
}
int foo(_Bool a, _Bool b) { return (a ^ (a == 0)) | ((b == 0) ^ b); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
and    $0x1,%cl
mov    %cl,-0x1(%rbp)
and    $0x1,%al
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    -0x1(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    $0x0,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    %ecx,%eax
mov    -0x2(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    $0x0,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    -0x2(%rbp),%dl
and    $0x1,%dl
movzbl %dl,%edx
xor    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i1 zeroext %0, i1 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = zext i1 %0 to i8
store i8 %5, i8* %3
%6 = zext i1 %1 to i8
store i8 %6, i8* %4
%7 = load i8, i8* %3
%8 = trunc i8 %7 to i1
%9 = zext i1 %8 to i32
%10 = load i8, i8* %3
%11 = trunc i8 %10 to i1
%12 = zext i1 %11 to i32
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = xor i32 %9, %14
%16 = load i8, i8* %4
%17 = trunc i8 %16 to i1
%18 = zext i1 %17 to i32
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
%21 = load i8, i8* %4
%22 = trunc i8 %21 to i1
%23 = zext i1 %22 to i32
%24 = xor i32 %20, %23
%25 = or i32 %15, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @foo(i1 zeroext %0, i1 zeroext %1) {
ret i32 1
}
/* Variables and functions */
double sin(double);
double my_sin(double x) { return sin(x); }


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

x86 assembly (clang, -O2):
<my_sin>:
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @my_sin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
ret double %4
}

LLVM IR (-O2):
define double @my_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
double floor(double);
double gfloor(double f) { return floor(f); }


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

x86 assembly (clang, -O2):
<gfloor>:
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @gfloor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.floor.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @gfloor(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
ret double %2
}
/* Variables and functions */
void arssort(unsigned char **, size_t);
void adaptive_msd_nilsson(unsigned char **strings, size_t n) {
  return arssort(strings, n);
}


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

x86 assembly (clang, -O2):
<adaptive_msd_nilsson>:
jmp    1030 <arssort@plt>

LLVM IR (-O0):
define void @adaptive_msd_nilsson(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
ret void
}

LLVM IR (-O2):
define void @adaptive_msd_nilsson(i8** %0, i64 %1) {
tail call void @arssort(i8** %0, i64 %1)
ret void
}
/* Variables and functions */
double sin(double);
double SDL_sin(double x) { return sin(x); }


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

x86 assembly (clang, -O2):
<SDL_sin>:
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @SDL_sin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
ret double %4
}

LLVM IR (-O2):
define double @SDL_sin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int file_size(FILE *f) {
  int pos;
  int end;
  pos = ftell(f);
  fseek(f, 0, SEEK_END);
  end = ftell(f);
  fseek(f, pos, SEEK_SET);
  return end;
}


x86 assembly (clang, -O0):
<file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e72(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %eax,%r14d
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %eax,%ebp
mov    0x2e85(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <fseek@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @file_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @ftell(i32* %5)
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i32 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i32 @ftell(i32* %10)
store i32 %11, i32* %4
%12 = load i32*, i32** %2
%13 = load i32, i32* %3
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i32 %13, i32 %14)
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @file_size(i32* nocapture %0) {
%2 = tail call i32 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i32 0, i32 %3)
%5 = tail call i32 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i32 %2, i32 %6)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rbtree_test_exit(void) { printf("test exit.\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"test exit.\00"
define void @rbtree_test_exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
int tolower(int c) {
  if (c >= 'A' && c <= 'Z') {
    c += 'a' - 'A';
  }
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1124 <tolower+0x24>
cmpl   $0x5a,-0x4(%rbp)
jg     1124 <tolower+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ns2sisc(int, float, float, float);
void ns2sisc_(int *isid, float *r, float *g, float *b) {
  ns2sisc(*isid, *r, *g, *b);
}


x86 assembly (clang, -O0):
<ns2sisc_>:
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    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm2
call   1030 <ns2sisc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns2sisc_>:
mov    (%rdi),%edi
movss  (%rsi),%xmm0
movss  (%rdx),%xmm1
movss  (%rcx),%xmm2
jmp    1030 <ns2sisc@plt>

LLVM IR (-O0):
define void @ns2sisc_(i32* %0, float* %1, float* %2, float* %3) {
%5 = alloca i32*
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
store i32* %0, i32** %5
store float* %1, float** %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load float*, float** %6
%12 = load float, float* %11
%13 = load float*, float** %7
%14 = load float, float* %13
%15 = load float*, float** %8
%16 = load float, float* %15
%17 = call i32 @ns2sisc(i32 %10, float %12, float %14, float %16)
ret void
}

LLVM IR (-O2):
define void @ns2sisc_(i32* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3) {
%5 = load i32, i32* %0
%6 = load float, float* %1
%7 = load float, float* %2
%8 = load float, float* %3
%9 = tail call i32 @ns2sisc(i32 %5, float %6, float %7, float %8)
ret void
}
/* Variables and functions */
float fmod(float, float);
float ClampAxis(float ang) {
  ang = fmod(ang, 360.f);
  if (ang < 0.f) {
    ang += 360.f;
  }
  return ang;
}


x86 assembly (clang, -O0):
<ClampAxis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
call   1030 <fmod@plt>
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1153 <ClampAxis+0x43>
movss  0xeb7(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClampAxis>:
push   %rax
movss  0xee7(%rip),%xmm1
call   1030 <fmod@plt>
movss  0xeda(%rip),%xmm3
addss  %xmm0,%xmm3
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm1
cmpltss %xmm2,%xmm1
andps  %xmm1,%xmm3
andnps %xmm0,%xmm1
orps   %xmm3,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ClampAxis(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @fmod(float %3, float 3.600000e+02)
store float %4, float* %2
%5 = load float, float* %2
%6 = fcmp olt float %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load float, float* %2
%9 = fadd float %8, 3.600000e+02
store float %9, float* %2
br label %10
10: ; preds = %7, %1
%11 = load float, float* %2
ret float %11
}

LLVM IR (-O2):
define float @ClampAxis(float %0) {
%2 = tail call float @fmod(float %0, float 3.600000e+02)
%3 = fcmp olt float %2, 0.000000e+00
%4 = fadd float %2, 3.600000e+02
%5 = select i1 %3, float %4, float %2
ret float %5
}
unsigned long pmd_index(unsigned long address) {
  return (address >> 21) & (1 - 1);
}


x86 assembly (clang, -O0):
<pmd_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x15,%rax
and    $0x0,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @pmd_index(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 21
%5 = and i64 %4, 0
ret i64 %5
}

LLVM IR (-O2):
define i64 @pmd_index(i64 %0) {
ret i64 0
}
int main(int argc, char *argv[argc + 1]) {}


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

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

LLVM IR (-O0):
define i32 @main(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 = add nsw i32 %5, 1
%7 = zext i32 %6 to i64
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ writeUserinput();
int main() {
  writeUserinput();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <writeUserinput@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @writeUserinput()
ret i32 0
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add_tail(struct list *, struct list *);
int /*<<< orphan*/ list_del_element(struct list *);
void list_move(struct list *dest, struct list *src) {
  list_del_element(src);
  list_add_tail(dest, src);
}


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

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

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_move(%struct.list* %0, %struct.list* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.list*
store %struct.list* %0, %struct.list** %3
store %struct.list* %1, %struct.list** %4
%5 = load %struct.list*, %struct.list** %4
%6 = call i32 @list_del_element(%struct.list* %5)
%7 = load %struct.list*, %struct.list** %3
%8 = load %struct.list*, %struct.list** %4
%9 = call i32 @list_add_tail(%struct.list* %7, %struct.list* %8)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_move(%struct.list* %0, %struct.list* %1) {
%3 = tail call i32 @list_del_element(%struct.list* %1)
%4 = tail call i32 @list_add_tail(%struct.list* %0, %struct.list* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c(char *);
int /*<<< orphan*/ resolve_back();
void Until() {
  c("?branch");
  resolve_back();
}


x86 assembly (clang, -O0):
<Until>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <c@plt>
mov    $0x0,%al
call   1040 <resolve_back@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Until>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <c@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <resolve_back@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"?branch\00"
define void @Until() {
%1 = call i32 @c(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @resolve_back()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"?branch\00"
define void @Until() {
%1 = tail call i32 @c(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @resolve_back()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void clearScreen(void) {
  printf("%c%s", 27, "[2J");
  printf("%c%s", 27, "[H");
}


x86 assembly (clang, -O0):
<clearScreen>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1b,%esi
lea    0xede(%rip),%rdx
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x1b,%esi
lea    0xeca(%rip),%rdx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearScreen>:
push   %rbx
lea    0xee8(%rip),%rbx
lea    0xee6(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1b,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%c%s\00"
@.str.1 = [4 x i8] c"[2J\00"
@.str.2 = [3 x i8] c"[H\00"
define void @clearScreen() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%c%s\00"
@.str.1 = [4 x i8] c"[2J\00"
@.str.2 = [3 x i8] c"[H\00"
define void @clearScreen() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void fnfold(char *filename) {
  while (*filename) {
    *filename = (*filename);
    filename++;
  }
}


x86 assembly (clang, -O0):
<fnfold>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <fnfold+0x32>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <fnfold+0x8>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @fnfold(i8* nocapture %0) {
ret void
}
int dumb_it_callback_midi_block(void *data, int channel,
                                unsigned char midi_byte) {
  (void)data;
  (void)channel;
  (void)midi_byte;
  return 1;
}


x86 assembly (clang, -O0):
<dumb_it_callback_midi_block>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @dumb_it_callback_midi_block(i8* nocapture readnone %0, i32 %1, i8 zeroext %2) {
ret i32 1
}
int adjust_x(int xmin, int xmax) {
  xmax += 8;
  while (((xmax - xmin) & 0x07) != 0x04)
    xmax++;
  return xmax;
}


x86 assembly (clang, -O0):
<adjust_x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
and    $0x7,%eax
cmp    $0x4,%eax
je     1133 <adjust_x+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1113 <adjust_x+0x13>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_x>:
mov    %esi,%eax
add    $0x7,%eax
neg    %edi
nopw   0x0(%rax,%rax,1)
lea    (%rdi,%rax,1),%ecx
add    $0x1,%ecx
and    $0x7,%ecx
add    $0x1,%eax
cmp    $0x4,%ecx
jne    1110 <adjust_x+0x10>
ret

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

LLVM IR (-O2):
define i32 @adjust_x(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 8
br label %4
4: ; preds = %4, %2
%5 = phi i32 [ %3, %2 ], [ %9, %4 ]
%6 = sub nsw i32 %5, %0
%7 = and i32 %6, 7
%8 = icmp eq i32 %7, 4
%9 = add nsw i32 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ comp_flush();
int /*<<< orphan*/ comp_return();
void comp_returnc(void) {
  comp_return();
  comp_flush();
}


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

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

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

LLVM IR (-O2):
define void @comp_returnc() {
%1 = tail call i32 (...) @comp_return()
%2 = tail call i32 (...) @comp_flush()
ret void
}
int some_fcn() {}


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

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

LLVM IR (-O0):
define i32 @some_fcn() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @some_fcn() {
ret i32 undef
}
unsigned char mdb_get_byte(void *buf, int offset) {
  return ((unsigned char *)(buf))[offset];
}


x86 assembly (clang, -O0):
<mdb_get_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdb_get_byte>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
define zeroext i8 @mdb_get_byte(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @mdb_get_byte(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Variables and functions */
double fabs(double);
double pow(double, double);
double myPow(double x, double y) {
  if (fabs(x) < 0.000000000001)
    return (0.0);
  return (pow(x, y));
}


x86 assembly (clang, -O0):
<myPow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movaps 0xee2(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1151 <myPow+0x41>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1165 <myPow+0x55>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myPow>:
movapd 0xee8(%rip),%xmm2
andpd  %xmm0,%xmm2
movsd  0xeec(%rip),%xmm3
ucomisd %xmm2,%xmm3
jbe    112f <myPow+0x1f>
xorpd  %xmm0,%xmm0
ret
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @myPow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = call double @llvm.fabs.f64(double %6)
%8 = fcmp olt double %7, 0x3D719799812DEA11
br i1 %8, label %9, label %10
9: ; preds = %2
store double 0.000000e+00, double* %3
br label %14
10: ; preds = %2
%11 = load double, double* %4
%12 = load double, double* %5
%13 = call double @pow(double %11, double %12)
store double %13, double* %3
br label %14
14: ; preds = %10, %9
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
define double @myPow(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %0)
%4 = fcmp olt double %3, 0x3D719799812DEA11
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call double @pow(double %0, double %1)
br label %7
7: ; preds = %2, %5
%8 = phi double [ %6, %5 ], [ 0.000000e+00, %2 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long long);
void print_array(unsigned long long *arr, int size) {
  unsigned long i;
  for (i = 0; i < size; i++) {
    printf("arr[%lu] = %llu\n", i, *(arr + i));
  }
  return;
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmp    %rcx,%rax
jae    1165 <print_array+0x55>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <print_array+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1148 <print_array+0x38>
mov    %rdi,%r14
movslq %esi,%r12
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"arr[%lu] = %llu\0A\00"
define void @print_array(i64* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %11, %6 ], [ 0, %4 ]
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ ptr;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ tracee_read(int /*<<< orphan*/, void *, void const *, int);
void *tracee_getptr(int mode, pid_t tid, const void *addr) {
  if (mode == 1) {
    uint32_t ptr;
    tracee_read(tid, (void *)&ptr, addr, sizeof(ptr));
    return (void *)(uint64_t)ptr;
  } else {
    uint64_t ptr;
    tracee_read(tid, (void *)&ptr, addr, sizeof(ptr));
    return (void *)ptr;
  }
}


x86 assembly (clang, -O0):
<tracee_getptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    114e <tracee_getptr+0x3e>
mov    -0x10(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x8,%ecx
call   1030 <tracee_read@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <tracee_getptr+0x5b>
mov    -0x10(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x8,%ecx
call   1030 <tracee_read@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracee_getptr>:
push   %rax
mov    %esi,%eax
cmp    $0x1,%edi
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x8,%ecx
call   1030 <tracee_read@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @tracee_getptr(i32 %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %19
12: ; preds = %3
%13 = load i32, i32* %6
%14 = bitcast i64* %8 to i8*
%15 = load i8*, i8** %7
%16 = call i32 @tracee_read(i32 %13, i8* %14, i8* %15, i32 8)
%17 = load i64, i64* %8
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %4
br label %26
19: ; preds = %3
%20 = load i32, i32* %6
%21 = bitcast i64* %9 to i8*
%22 = load i8*, i8** %7
%23 = call i32 @tracee_read(i32 %20, i8* %21, i8* %22, i32 8)
%24 = load i64, i64* %9
%25 = inttoptr i64 %24 to i8*
store i8* %25, i8** %4
br label %26
26: ; preds = %19, %12
%27 = load i8*, i8** %4
ret i8* %27
}

LLVM IR (-O2):
define i8* @tracee_getptr(i32 %0, i32 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = icmp eq i32 %0, 1
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = bitcast i64* %4 to i8*
%9 = call i32 @tracee_read(i32 %1, i8* %8, i8* %2, i32 8)
%10 = load i64, i64* %4
br label %15
11: ; preds = %3
%12 = bitcast i64* %5 to i8*
%13 = call i32 @tracee_read(i32 %1, i8* %12, i8* %2, i32 8)
%14 = load i64, i64* %5
br label %15
15: ; preds = %11, %7
%16 = phi i64 [ %10, %7 ], [ %14, %11 ]
%17 = inttoptr i64 %16 to i8*
ret i8* %17
}
/* Variables and functions */
int memcmp(void *, void const *, int);
int /*<<< orphan*/ memcpy(void *, void const *, int);
int memcmpy(void *foo, const void *bar, int len) {
  int differs = memcmp(foo, bar, len);
  memcpy(foo, bar, len);
  return differs;
}


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

x86 assembly (clang, -O2):
<memcmpy>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <memcmp@plt>
mov    %eax,%r15d
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <memcpy@plt>
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @memcmpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i32 %2)
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _putchar(char);
int main(void) {
  _putchar('H');
  _putchar('o');
  _putchar('l');
  _putchar('b');
  _putchar('e');
  _putchar('r');
  _putchar('t');
  _putchar('o');
  _putchar('n');
  _putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x48,%edi
call   1030 <_putchar@plt>
mov    $0x6f,%edi
call   1030 <_putchar@plt>
mov    $0x6c,%edi
call   1030 <_putchar@plt>
mov    $0x62,%edi
call   1030 <_putchar@plt>
mov    $0x65,%edi
call   1030 <_putchar@plt>
mov    $0x72,%edi
call   1030 <_putchar@plt>
mov    $0x74,%edi
call   1030 <_putchar@plt>
mov    $0x6f,%edi
call   1030 <_putchar@plt>
mov    $0x6e,%edi
call   1030 <_putchar@plt>
mov    $0xa,%edi
call   1030 <_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x48,%edi
call   1030 <_putchar@plt>
mov    $0x6f,%edi
call   1030 <_putchar@plt>
mov    $0x6c,%edi
call   1030 <_putchar@plt>
mov    $0x62,%edi
call   1030 <_putchar@plt>
mov    $0x65,%edi
call   1030 <_putchar@plt>
mov    $0x72,%edi
call   1030 <_putchar@plt>
mov    $0x74,%edi
call   1030 <_putchar@plt>
mov    $0x6f,%edi
call   1030 <_putchar@plt>
mov    $0x6e,%edi
call   1030 <_putchar@plt>
mov    $0xa,%edi
call   1030 <_putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @_putchar(i8 signext 72)
%3 = call i32 @_putchar(i8 signext 111)
%4 = call i32 @_putchar(i8 signext 108)
%5 = call i32 @_putchar(i8 signext 98)
%6 = call i32 @_putchar(i8 signext 101)
%7 = call i32 @_putchar(i8 signext 114)
%8 = call i32 @_putchar(i8 signext 116)
%9 = call i32 @_putchar(i8 signext 111)
%10 = call i32 @_putchar(i8 signext 110)
%11 = call i32 @_putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @_putchar(i8 signext 72)
%2 = tail call i32 @_putchar(i8 signext 111)
%3 = tail call i32 @_putchar(i8 signext 108)
%4 = tail call i32 @_putchar(i8 signext 98)
%5 = tail call i32 @_putchar(i8 signext 101)
%6 = tail call i32 @_putchar(i8 signext 114)
%7 = tail call i32 @_putchar(i8 signext 116)
%8 = tail call i32 @_putchar(i8 signext 111)
%9 = tail call i32 @_putchar(i8 signext 110)
%10 = tail call i32 @_putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int gpioHardwareRevision();
int gpioVersion();
int /*<<< orphan*/ printf(char *, ...);
void t0() {
  printf("Version.\n");
  printf("pigpio version %d.\n", gpioVersion());
  printf("Hardware revision %d.\n", gpioHardwareRevision());
}


x86 assembly (clang, -O0):
<t0>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <gpioVersion@plt>
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <gpioHardwareRevision@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t0>:
push   %rax
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <gpioVersion@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1030 <gpioHardwareRevision@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1060 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Version.\0A\00"
@.str.1 = [20 x i8] c"pigpio version %d.\0A\00"
@.str.2 = [23 x i8] c"Hardware revision %d.\0A\00"
define void @t0() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @gpioVersion()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @gpioHardwareRevision()
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"pigpio version %d.\0A\00"
@.str.2 = [23 x i8] c"Hardware revision %d.\0A\00"
@str = [9 x i8] c"Version.\00"
define void @t0() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @gpioVersion()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @gpioHardwareRevision()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret void
}
/* Type definitions */
struct options {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  struct doppler_conf;
  struct options *getopt_options = NULL;
  usage(*argv);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
call   1030 <usage@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.options = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.options*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.options* null, %struct.options** %6
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = call i32 @usage(i8* %8)
ret i32 0
}

LLVM IR (-O2):
%struct.options = type { i32 }
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @usage(i8* %3)
ret i32 0
}
int cmp_int(const void *a, const void *b) {
  return ((*(int *)a) - (*(int *)b));
}


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

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

LLVM IR (-O0):
define i32 @cmp_int(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y, z;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  z = __VERIFIER_nondet_int();
  while (x > 0) {
    x = x + y;
    y = y + z;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115e <main+0x4e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}