xunge/DecIR huggingface dataset:
unsigned int _mesa_str_checksum(const char *str) {
  unsigned int sum, i;
  const char *c;
  sum = i = 1;
  for (c = str; *c; c++, i++)
    sum += *c * (i % 100);
  return sum + i;
}


x86 assembly (clang, -O0):
<_mesa_str_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1167 <_mesa_str_checksum+0x67>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    -0x1c(%rbp),%eax
imul   %edx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111e <_mesa_str_checksum+0x1e>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mesa_str_checksum>:
mov    (%rdi),%dl
test   %dl,%dl
je     1172 <_mesa_str_checksum+0x72>
mov    $0x1,%esi
mov    $0x1,%eax
xor    %r10d,%r10d
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%r8d
mov    %esi,%ecx
imul   $0x51eb851f,%rcx,%rcx
shr    $0x25,%rcx
imul   $0xffffff9c,%ecx,%ecx
movsbl %dl,%r9d
add    %eax,%ecx
imul   %r9d,%ecx
add    %r8d,%ecx
add    $0x1,%esi
movzbl (%rdi,%rax,1),%edx
add    $0x1,%rax
add    $0x1,%r10d
test   %dl,%dl
jne    1120 <_mesa_str_checksum+0x20>
mov    %r10d,%ecx
imul   $0x51eb851f,%rcx,%rcx
shr    $0x25,%rcx
imul   $0x64,%ecx,%ecx
sub    %ecx,%r10d
imul   %r9d,%r10d
add    %r10d,%r8d
add    %r8d,%eax
ret
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @_mesa_str_checksum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i8* [ %13, %4 ], [ %0, %1 ]
%7 = phi i32 [ %14, %4 ], [ 1, %1 ]
%8 = phi i32 [ %12, %4 ], [ 1, %1 ]
%9 = sext i8 %5 to i32
%10 = urem i32 %7, 100
%11 = mul nsw i32 %10, %9
%12 = add i32 %11, %8
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = add i32 %7, 1
%15 = load i8, i8* %13
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4
%18 = add i32 %14, %12
br label %19
19: ; preds = %17, %1
%20 = phi i32 [ %18, %17 ], [ 2, %1 ]
ret i32 %20
}
void interruptHandler() {}


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

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

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

LLVM IR (-O2):
define void @interruptHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dead_code(int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  dead_code(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @dead_code(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void print_version(void) { printf("%s v%s\n\n", "read_backup_stream", "1.0"); }


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

x86 assembly (clang, -O2):
<print_version>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xef7(%rip),%rdx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%s v%s\0A\0A\00"
@.str.1 = [19 x i8] c"read_backup_stream\00"
@.str.2 = [4 x i8] c"1.0\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
void get_card_name(char *prompt, char *card_name) {
  puts(prompt);
  scanf("%2s", card_name);
}


x86 assembly (clang, -O0):
<get_card_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_card_name>:
push   %rbx
mov    %rsi,%rbx
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%2s\00"
define void @get_card_name(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcscpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
int wcslen(int /*<<< orphan*/ *);
wchar_t *wcpcpy(wchar_t *dest, const wchar_t *src) {
  wcscpy(dest, src);
  return dest + wcslen(dest);
}


x86 assembly (clang, -O0):
<wcpcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <wcscpy@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wcslen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcpcpy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <wcscpy@plt>
mov    %rbx,%rdi
call   1030 <wcslen@plt>
cltq
lea    (%rbx,%rax,4),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @wcpcpy(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 @wcscpy(i32* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = load i32*, i32** %3
%10 = call i32 @wcslen(i32* %9)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
ret i32* %12
}

LLVM IR (-O2):
define i32* @wcpcpy(i32* %0, i32* %1) {
%3 = tail call i32 @wcscpy(i32* %0, i32* %1)
%4 = tail call i32 @wcslen(i32* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
ret i32* %6
}
float nanf(const char *unused) { return 0; }


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

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

LLVM IR (-O0):
define float @nanf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @nanf(i8* nocapture readnone %0) {
ret float 0.000000e+00
}
int test_imm_16uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x16 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_16uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x16,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_16uint64_midword_mem>:
testb  $0x16,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_16uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 22
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_16uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1441792
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char const *);
void unlink_files(void *p, const char *key, const char *value, int flags) {
  ;
  unlink(value);
}


x86 assembly (clang, -O0):
<unlink_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <unlink@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink_files>:
mov    %rdx,%rdi
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @unlink_files(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @unlink(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ recursive_run(int, int **, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int, int *);
int find_maximum_run(int size, int triangle[size][size]) {
  int c = 0;
  int max = 0;
  recursive_run(size, triangle, 0, 0, c, &max);
  return max;
}


x86 assembly (clang, -O0):
<find_maximum_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%r8d
xor    %ecx,%ecx
lea    -0x18(%rbp),%r9
mov    %ecx,%edx
call   1030 <recursive_run@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_maximum_run>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%r9
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <recursive_run@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @find_maximum_run(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
store i32 0, i32* %5
store i32 0, i32* %6
%11 = load i32, i32* %3
%12 = load i32*, i32** %4
%13 = bitcast i32* %12 to i32**
%14 = load i32, i32* %5
%15 = call i32 @recursive_run(i32 %11, i32** %13, i32 0, i32 0, i32 %14, i32* %6)
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
define i32 @find_maximum_run(i32 %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = bitcast i32* %1 to i32**
%6 = call i32 @recursive_run(i32 %0, i32** %5, i32 0, i32 0, i32 0, i32* %3)
%7 = load i32, i32* %3
ret i32 %7
}
unsigned int int_to_charc(unsigned int num) {
  int i = 0;
  do {
    num = num / 10;
    i++;
  } while (num != 0);
  return i;
}


x86 assembly (clang, -O0):
<int_to_charc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    110e <int_to_charc+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_charc>:
xor    %eax,%eax
mov    $0xcccccccd,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <int_to_charc+0x10>
ret

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

LLVM IR (-O2):
define i32 @int_to_charc(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = phi i32 [ 0, %1 ], [ %6, %2 ]
%5 = udiv i32 %3, 10
%6 = add nuw nsw i32 %4, 1
%7 = icmp ult i32 %3, 10
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 %6
}
char *xrealloc(s, n)
char *s;
long n;
{
  extern char *realloc();
  char *str;
  if (sizeof(unsigned) <= 2 && n > 64000l) {
    xabort("xrealloc: chunk too large for 16 bit machine");
  }
  str = realloc(s, (unsigned)n);
  if (!str) {
    xabort("xrealloc: Oops - Out Of Mem");
  }
  return str;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
mov    $0x0,%al
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <xrealloc+0x3e>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <xabort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
xor    %eax,%eax
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113e <xrealloc+0x1e>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <xabort@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"xrealloc: Oops - Out Of Mem\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = call i8* (i8*, i32, ...) bitcast (i8* (...)* @realloc to i8* (i8*, i32, ...)*)(i8* %6, i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @xabort to i32 (i8*, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [28 x i8] c"xrealloc: Oops - Out Of Mem\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i8* (i8*, i32, ...) bitcast (i8* (...)* @realloc to i8* (i8*, i32, ...)*)(i8* %0, i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @xabort to i32 (i8*, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int strlen(char *);
void trim_newline(char *buffer) {
  if (buffer != NULL) {
    int len = strlen(buffer);
    if (len == 0) {
      return;
    }
    if (buffer[len - 1] == '\n') {
      buffer[len - 1] = '\0';
    }
  }
}


x86 assembly (clang, -O0):
<trim_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1172 <trim_newline+0x62>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1142 <trim_newline+0x32>
jmp    1172 <trim_newline+0x62>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    116d <trim_newline+0x5d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1172 <trim_newline+0x62>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_newline>:
push   %rbx
test   %rdi,%rdi
je     1130 <trim_newline+0x20>
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     1130 <trim_newline+0x20>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1130 <trim_newline+0x20>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @trim_newline(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = add nsw i32 %4, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 10
br i1 %11, label %12, label %13
12: ; preds = %6
store i8 0, i8* %9
br label %13
13: ; preds = %3, %12, %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ copy(char *, char *);
int /*<<< orphan*/ errx(int, char *);
int main(int argc, char *argv[]) {
  if (argc != 3) {
    errx(1, "Usage: cp OLDFILE NEWFILE");
  }
  copy(argv[1], argv[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1151 <main+0x31>
mov    $0x1,%edi
lea    0xeb4(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <copy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x3,%edi
je     113a <main+0x1a>
lea    0xed0(%rip),%rsi
mov    $0x1,%edi
call   1030 <errx@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
call   1040 <copy@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: cp OLDFILE NEWFILE\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @errx(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @copy(i8* %13, i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: cp OLDFILE NEWFILE\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @copy(i8* %8, i8* %10)
ret i32 0
}
void gzclose(void) {}


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

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

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

LLVM IR (-O2):
define void @gzclose() {
ret void
}
double floor(double x) { return (double)(int)x; }


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
ret double %3
}
int param_set_ulong(const char *val, struct kernel_param *kp) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kernel_param = type opaque
define i32 @param_set_ulong(i8* nocapture readnone %0, %struct.kernel_param* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct _glist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ canvas_map(struct _glist *, int);
scalar_t__ glist_isvisible(struct _glist *);
void canvas_redraw(struct _glist *x) {
  if (glist_isvisible(x)) {
    canvas_map(x, 0);
    canvas_map(x, 1);
  }
}


x86 assembly (clang, -O0):
<canvas_redraw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <glist_isvisible@plt>
cmp    $0x0,%rax
je     1158 <canvas_redraw+0x38>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <canvas_map@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <canvas_map@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<canvas_redraw>:
push   %rbx
mov    %rdi,%rbx
call   1030 <glist_isvisible@plt>
test   %rax,%rax
je     1146 <canvas_redraw+0x26>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <canvas_map@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <canvas_map@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct._glist = type { i32 }
define void @canvas_redraw(%struct._glist* %0) {
%2 = alloca %struct._glist*
store %struct._glist* %0, %struct._glist** %2
%3 = load %struct._glist*, %struct._glist** %2
%4 = call i64 @glist_isvisible(%struct._glist* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load %struct._glist*, %struct._glist** %2
%8 = call i32 @canvas_map(%struct._glist* %7, i32 0)
%9 = load %struct._glist*, %struct._glist** %2
%10 = call i32 @canvas_map(%struct._glist* %9, i32 1)
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct._glist = type { i32 }
define void @canvas_redraw(%struct._glist* %0) {
%2 = tail call i64 @glist_isvisible(%struct._glist* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @canvas_map(%struct._glist* %0, i32 0)
%6 = tail call i32 @canvas_map(%struct._glist* %0, i32 1)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int calcSum(int, int);
int getNumber();
int /*<<< orphan*/ showResult(int);
int main(void) {
  int num1, num2, sum;
  num1 = getNumber();
  num2 = getNumber();
  sum = calcSum(num1, num2);
  showResult(sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getNumber@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getNumber@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <calcSum@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <showResult@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getNumber@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getNumber@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <calcSum@plt>
mov    %eax,%edi
call   1030 <showResult@plt>
xor    %eax,%eax
pop    %rbx
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 (...) @getNumber()
store i32 %5, i32* %2
%6 = call i32 (...) @getNumber()
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @calcSum(i32 %7, i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 @showResult(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getNumber()
%2 = tail call i32 (...) @getNumber()
%3 = tail call i32 @calcSum(i32 %1, i32 %2)
%4 = tail call i32 @showResult(i32 %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ isAddr(char const *);
scalar_t__ isLabel(char const *);
scalar_t__ isNum(char const *);
scalar_t__ isReg(char const *);
int isVar(const char *op) {
  return !(isNum(op) || isReg(op) || isLabel(op) || isAddr(op));
}


x86 assembly (clang, -O0):
<isVar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <isNum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    11b0 <isVar+0x70>
mov    -0x8(%rbp),%rdi
call   1060 <isReg@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    11b0 <isVar+0x70>
mov    -0x8(%rbp),%rdi
call   1050 <isLabel@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    11b0 <isVar+0x70>
mov    -0x8(%rbp),%rdi
call   1030 <isAddr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isVar>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <isNum@plt>
xor    %ebp,%ebp
test   %rax,%rax
jne    117d <isVar+0x3d>
mov    %rbx,%rdi
call   1060 <isReg@plt>
test   %rax,%rax
jne    117d <isVar+0x3d>
mov    %rbx,%rdi
call   1050 <isLabel@plt>
test   %rax,%rax
jne    117d <isVar+0x3d>
mov    %rbx,%rdi
call   1030 <isAddr@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isVar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @isNum(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @isReg(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = call i64 @isLabel(i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8*, i8** %2
%16 = call i64 @isAddr(i8* %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @isVar(i8* %0) {
%2 = tail call i64 @isNum(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = tail call i64 @isReg(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = tail call i64 @isLabel(i8* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = tail call i64 @isAddr(i8* %0)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %10, %7, %4, %1
%15 = phi i32 [ 0, %7 ], [ 0, %4 ], [ 0, %1 ], [ %13, %10 ]
ret i32 %15
}
int shell_out(cp)
char *cp;
{
  int rv;
  reset_attr();
  rv = system(cp);
  default_color();
  return rv;
}


x86 assembly (clang, -O0):
<shell_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <reset_attr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <default_color@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell_out>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <reset_attr@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <system@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <default_color@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @shell_out(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @reset_attr()
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %5)
store i32 %6, i32* %3
%7 = call i32 (...) @default_color()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @shell_out(i8* %0) {
%2 = tail call i32 (...) @reset_attr()
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (...) @default_color()
ret i32 %3
}
int test_imm_57int64_lowword_reg(long long val) {
  return ((val) & (0x57 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_57int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x57,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_57int64_lowword_reg>:
test   $0x57,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_57int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 87
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_57int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 87
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double mouseToDouble(int x, int xmax) { return (double)x / xmax * 2. - 1.; }


x86 assembly (clang, -O0):
<mouseToDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
movsd  0xedc(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mouseToDouble>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
addsd  0xee8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @mouseToDouble(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 = sitofp i32 %5 to double
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = fdiv double %6, %8
%10 = call double @llvm.fmuladd.f64(double %9, double 2.000000e+00, double -1.000000e+00)
ret double %10
}

LLVM IR (-O2):
define double @mouseToDouble(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = fdiv double %3, %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double 2.000000e+00, double -1.000000e+00)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int ine(int x, int y, int ok) {
  if ((x < y) || (x > y)) {
    if (!ok)
      abort();
  } else if (ok)
    abort();
}


x86 assembly (clang, -O0):
<ine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1139 <ine+0x29>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    114f <ine+0x3f>
cmpl   $0x0,-0x10(%rbp)
jne    114a <ine+0x3a>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1165 <ine+0x55>
cmpl   $0x0,-0x10(%rbp)
je     1160 <ine+0x50>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1165 <ine+0x55>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ine>:
push   %rax
cmp    %esi,%edi
jne    1120 <ine+0x10>
test   %edx,%edx
je     1124 <ine+0x14>
xor    %eax,%eax
call   1030 <abort@plt>
test   %edx,%edx
je     1119 <ine+0x9>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ine(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, %1
%5 = icmp eq i32 %2, 0
br i1 %4, label %9, label %6
6: ; preds = %3
br i1 %5, label %7, label %12
7: ; preds = %6
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %3
br i1 %5, label %12, label %10
10: ; preds = %9
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %9, %6
ret i32 undef
}
void PrintFactJNGetVar2(void *theEnv, const char *logicalName, void *theValue) {

}


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

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

LLVM IR (-O0):
define void @PrintFactJNGetVar2(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @PrintFactJNGetVar2(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
int iwl_leds_register(struct iwl_priv *priv) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iwl_priv = type opaque
define i32 @iwl_leds_register(%struct.iwl_priv* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void strncpy_no_null_3_Bad_FN() {
  char src[15] = "test.test.test";
  char dst[10];
  strncpy(dst, src, 10);
  int a[20];
  a[strlen(dst)] = 0;
}


x86 assembly (clang, -O0):
<strncpy_no_null_3_Bad_FN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xec9(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec1(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x19(%rbp),%rdi
lea    -0xf(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strncpy@plt>
lea    -0x19(%rbp),%rdi
call   1040 <strlen@plt>
movl   $0x0,-0x70(%rbp,%rax,4)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_no_null_3_Bad_FN>:
sub    $0x28,%rsp
movabs $0x747365742e7473,%rax
mov    %rax,0xf(%rsp)
movabs $0x7365742e74736574,%rax
74 65 73
mov    %rax,0x8(%rsp)
lea    0x1e(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strncpy@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.strncpy_no_null_3_Bad_FN.src = [15 x i8] c"test.test.test\00"
define void @strncpy_no_null_3_Bad_FN() {
%1 = alloca [15 x i8]
%2 = alloca [10 x i8]
%3 = alloca [20 x i32]
%4 = bitcast [15 x i8]* %1 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%7 = call i32 @strncpy(i8* %5, i8* %6, i32 10)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = call i64 @strlen(i8* %8)
%10 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 %9
store i32 0, i32* %10
ret void
}

LLVM IR (-O2):
@__const.strncpy_no_null_3_Bad_FN.src = [15 x i8] c"test.test.test\00"
define void @strncpy_no_null_3_Bad_FN() {
%1 = alloca [15 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @strncpy(i8* %4, i8* %3, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cyano();
int main() {
  cyano();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @cyano()
ret i32 0
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
char toupper(char);
void buf_toupper(char *str, ssize_t size) {
  while (size--) {
    str[size] = toupper(str[size]);
  }
}


x86 assembly (clang, -O0):
<buf_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     115c <buf_toupper+0x4c>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1120 <buf_toupper+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_toupper>:
push   %r14
push   %rbx
push   %rax
test   %rsi,%rsi
je     1136 <buf_toupper+0x26>
mov    %rsi,%rbx
mov    %rdi,%r14
nop
movsbl -0x1(%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%r14,%rbx,1)
add    $0xffffffffffffffff,%rbx
jne    1120 <buf_toupper+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @buf_toupper(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %1, %2 ]
%6 = add i64 %5, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call signext i8 @toupper(i8 signext %8)
store i8 %9, i8* %7
%10 = icmp eq i64 %6, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
int test_imm_7Fint64_highword_reg(long long val) {
  return ((val >> 32) & (0x7F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Fint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x7f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Fint64_highword_reg>:
movabs $0x7f00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Fint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 127
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_7Fint64_highword_reg(i64 %0) {
%2 = and i64 %0, 545460846592
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void carp_print_warranty() {
  puts(
      "THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY "
      "APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT "
      "HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT "
      "WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT "
      "LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A "
      "PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE "
      "OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU "
      "ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.");
}


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

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

LLVM IR (-O0):
@.str = [550 x i8] c"THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \E2\80\9CAS IS\E2\80\9D WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\00"
define void @carp_print_warranty() {
%1 = call i32 @puts(i8* getelementptr inbounds ([550 x i8], [550 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [550 x i8] c"THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \E2\80\9CAS IS\E2\80\9D WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\00"
define void @carp_print_warranty() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([550 x i8], [550 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  const char *bp = str;
  while (*bp++)
    ;
  return (bp - str - 1);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     112d <strlen+0x2d>
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
ret i64 %11
}
void g_getenv() {}


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

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

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

LLVM IR (-O2):
define void @g_getenv() {
ret void
}
/* Variables and functions */
double mercator_x(double);
double geohashGetXMercator(double longtitude) {
  if (longtitude > 180 || longtitude < -180) {
    return longtitude;
  }
  return mercator_x(longtitude);
}


x86 assembly (clang, -O0):
<geohashGetXMercator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1147 <geohashGetXMercator+0x37>
movsd  0xecc(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1156 <geohashGetXMercator+0x46>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1165 <geohashGetXMercator+0x55>
movsd  -0x10(%rbp),%xmm0
call   1030 <mercator_x@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geohashGetXMercator>:
ucomisd 0xee8(%rip),%xmm0
ja     112d <geohashGetXMercator+0x1d>
movsd  0xee6(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     112d <geohashGetXMercator+0x1d>
jmp    1030 <mercator_x@plt>
ret

LLVM IR (-O0):
define double @geohashGetXMercator(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 1.800000e+02
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load double, double* %3
%8 = fcmp olt double %7, -1.800000e+02
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = load double, double* %3
store double %10, double* %2
br label %14
11: ; preds = %6
%12 = load double, double* %3
%13 = call double @mercator_x(double %12)
store double %13, double* %2
br label %14
14: ; preds = %11, %9
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @geohashGetXMercator(double %0) {
%2 = fcmp ogt double %0, 1.800000e+02
%3 = fcmp olt double %0, -1.800000e+02
%4 = or i1 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call double @mercator_x(double %0)
br label %7
7: ; preds = %1, %5
%8 = phi double [ %6, %5 ], [ %0, %1 ]
ret double %8
}