xunge/DecIR huggingface dataset:
/* Variables and functions */
double __infer_nondet_double();
double sinh(double x) { return __infer_nondet_double(); }


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

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

LLVM IR (-O0):
define double @sinh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @sinh(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
void gdb_asm_test(void) {}


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

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

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

LLVM IR (-O2):
define void @gdb_asm_test() {
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t twos_to_ones_complement4(int32_t num) {
  return num < 0 ? num - 1 : num;
}


x86 assembly (clang, -O0):
<twos_to_ones_complement4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1124 <twos_to_ones_complement4+0x24>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <twos_to_ones_complement4+0x2c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<twos_to_ones_complement4>:
mov    %rdi,%rax
sar    $0x3f,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @twos_to_ones_complement4(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 %6, 1
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @twos_to_ones_complement4(i64 %0) {
%2 = ashr i64 %0, 63
%3 = add nsw i64 %2, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int strlen(char *);
void voltea(char *cadena) {
  int len;
  extern char linea[], linea_max[];
  char *inicio = cadena;
  len = strlen(cadena);
  char *p = inicio + len - 1;
  while (inicio <= p) {
    putchar(*p);
    p--;
  }
}


x86 assembly (clang, -O0):
<voltea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
ja     117e <voltea+0x5e>
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1153 <voltea+0x33>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voltea>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
cltq
lea    (%r14,%rax,1),%rbx
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
jb     1151 <voltea+0x31>
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
jae    1140 <voltea+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @voltea(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp ult i8* %5, %0
br i1 %6, label %13, label %7
7: ; preds = %1, %7
%8 = phi i8* [ %11, %7 ], [ %5, %1 ]
%9 = load i8, i8* %8
%10 = tail call i32 @putchar(i8 signext %9)
%11 = getelementptr inbounds i8, i8* %8, i64 -1
%12 = icmp ult i8* %11, %0
br i1 %12, label %13, label %7
13: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __const_udelay(unsigned long);
void __udelay(unsigned long usecs) { __const_udelay(usecs * 4295); }


x86 assembly (clang, -O0):
<__udelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
imul   $0x10c7,-0x8(%rbp),%rdi
call   1030 <__const_udelay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__udelay>:
imul   $0x10c7,%rdi,%rdi
jmp    1030 <__const_udelay@plt>

LLVM IR (-O0):
define void @__udelay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 4295
%5 = call i32 @__const_udelay(i64 %4)
ret void
}

LLVM IR (-O2):
define void @__udelay(i64 %0) {
%2 = mul i64 %0, 4295
%3 = tail call i32 @__const_udelay(i64 %2)
ret void
}
void bdev_cache_init(void) {}


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

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

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

LLVM IR (-O2):
define void @bdev_cache_init() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned char *writeUint32BE(unsigned char *buffer, uint32_t value) {
  *buffer = ((value >> 24) & 0xff);
  *(buffer + 1) = ((value >> 16) & 0xff);
  *(buffer + 2) = ((value >> 8) & 0xff);
  *(buffer + 3) = (value & 0xff);
  return (buffer + 4);
}


x86 assembly (clang, -O0):
<writeUint32BE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeUint32BE>:
bswap  %esi
mov    %esi,(%rdi)
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @writeUint32BE(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
store i8 %8, i8* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 8
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i32, i32* %4
%23 = and i32 %22, 255
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8 %24, i8* %26
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 4
ret i8* %28
}

LLVM IR (-O2):
define i8* @writeUint32BE(i8* writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %13
}
/* Variables and functions */
int naturalNumber();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%i\n", naturalNumber());
  printf("%i\n", naturalNumber());
  printf("%i\n", naturalNumber());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <naturalNumber@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <naturalNumber@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <naturalNumber@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <naturalNumber@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <naturalNumber@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <naturalNumber@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @naturalNumber()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @naturalNumber()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @naturalNumber()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int main() {
  int i;
  for (i = 10000; i > 0; i--) {
    test1();
    test2();
    test3();
    test4();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2710,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    118a <main+0x4a>
mov    $0x0,%al
call   1040 <test1@plt>
mov    $0x0,%al
call   1060 <test2@plt>
mov    $0x0,%al
call   1030 <test3@plt>
mov    $0x0,%al
call   1050 <test4@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2711,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <test1@plt>
xor    %eax,%eax
call   1060 <test2@plt>
xor    %eax,%eax
call   1030 <test3@plt>
xor    %eax,%eax
call   1050 <test4@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1150 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 10000, %0 ], [ %7, %1 ]
%3 = tail call i32 (...) @test1()
%4 = tail call i32 (...) @test2()
%5 = tail call i32 (...) @test3()
%6 = tail call i32 (...) @test4()
%7 = add nsw i32 %2, -1
%8 = icmp ugt i32 %2, 1
br i1 %8, label %1, label %9
9: ; preds = %1
ret i32 0
}
long dummy_lswap4(long i) { return i; }


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

x86 assembly (clang, -O2):
<dummy_lswap4>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @dummy_lswap4(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @dummy_lswap4(i64 returned %0) {
ret i64 %0
}
const char *isotime_version(void) {
  return ("isotime : V1.6 Peter Boesecke 2012-10-28");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"isotime : V1.6 Peter Boesecke 2012-10-28\00"
define i8* @isotime_version() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [41 x i8] c"isotime : V1.6 Peter Boesecke 2012-10-28\00"
define i8* @isotime_version() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int wheatTcpGenericConnect(char *, char *, int, int);
int wheatTcpNonBlockConnect(char *err, char *addr, int port) {
  return wheatTcpGenericConnect(err, addr, port, 1);
}


x86 assembly (clang, -O0):
<wheatTcpNonBlockConnect>:
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
mov    $0x1,%ecx
call   1030 <wheatTcpGenericConnect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wheatTcpNonBlockConnect>:
mov    $0x1,%ecx
jmp    1030 <wheatTcpGenericConnect@plt>

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

LLVM IR (-O2):
define i32 @wheatTcpNonBlockConnect(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @wheatTcpGenericConnect(i8* %0, i8* %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ retro_set_controller_port_device(int, int /*<<< orphan*/);
void retro_unload_game(void) {
  retro_set_controller_port_device(0, 0);
  retro_set_controller_port_device(1, 0);
}


x86 assembly (clang, -O0):
<retro_unload_game>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <retro_set_controller_port_device@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <retro_set_controller_port_device@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<retro_unload_game>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <retro_set_controller_port_device@plt>
mov    $0x1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <retro_set_controller_port_device@plt>

LLVM IR (-O0):
define void @retro_unload_game() {
%1 = call i32 @retro_set_controller_port_device(i32 0, i32 0)
%2 = call i32 @retro_set_controller_port_device(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @retro_unload_game() {
%1 = tail call i32 @retro_set_controller_port_device(i32 0, i32 0)
%2 = tail call i32 @retro_set_controller_port_device(i32 1, i32 0)
ret void
}
/* Type definitions */
struct PosTagger {
  int dummy;
};

/* Variables and functions */
struct PosTagger *NewPosTagger(char const *, char const *, char const *);
struct PosTagger *tag_engine(const char *DICT_PATH, const char *HMM_PATH,
                             const char *USER_PATH) {
  return NewPosTagger(DICT_PATH, HMM_PATH, USER_PATH);
}


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

x86 assembly (clang, -O2):
<tag_engine>:
jmp    1030 <NewPosTagger@plt>

LLVM IR (-O0):
%struct.PosTagger = type { i32 }
define %struct.PosTagger* @tag_engine(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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call %struct.PosTagger* @NewPosTagger(i8* %7, i8* %8, i8* %9)
ret %struct.PosTagger* %10
}

LLVM IR (-O2):
%struct.PosTagger = type { i32 }
define %struct.PosTagger* @tag_engine(i8* %0, i8* %1, i8* %2) {
%4 = tail call %struct.PosTagger* @NewPosTagger(i8* %0, i8* %1, i8* %2)
ret %struct.PosTagger* %4
}
int length(char s[]) {
  int i = 0;
  for (i = 0; i <= 100; i++) {
    if (s[i] == '\0')
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jg     114d <length+0x4d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    113a <length+0x3a>
jmp    114d <length+0x4d>
jmp    113f <length+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <length+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    $0x3,%eax
cmpb   $0x0,-0x3(%rdi,%rax,1)
je     1135 <length+0x35>
nopl   0x0(%rax)
cmp    $0x67,%rax
je     113a <length+0x3a>
cmpb   $0x0,-0x2(%rdi,%rax,1)
je     1140 <length+0x40>
cmpb   $0x0,-0x1(%rdi,%rax,1)
je     1145 <length+0x45>
cmpb   $0x0,(%rdi,%rax,1)
je     1149 <length+0x49>
add    $0x4,%rax
cmpb   $0x0,-0x3(%rdi,%rax,1)
jne    1110 <length+0x10>
add    $0xfffffffffffffffd,%rax
ret
mov    $0x65,%eax
ret
add    $0xfffffffffffffffe,%rax
ret
add    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i32 @length(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %7
br label %20
16: ; preds = %7
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %4
20: ; preds = %15, %4
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
br label %2
2: ; preds = %24, %1
%3 = phi i64 [ 0, %1 ], [ %25, %24 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %26, label %7
7: ; preds = %2
%8 = or i64 %3, 1
%9 = icmp eq i64 %8, 101
br i1 %9, label %29, label %10
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %0, i64 %8
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %26, label %14
14: ; preds = %10
%15 = or i64 %3, 2
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %26, label %19
19: ; preds = %14
%20 = or i64 %3, 3
%21 = getelementptr inbounds i8, i8* %0, i64 %20
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %19
%25 = add nuw nsw i64 %3, 4
br label %2
26: ; preds = %19, %14, %10, %2
%27 = phi i64 [ %3, %2 ], [ %8, %10 ], [ %15, %14 ], [ %20, %19 ]
%28 = trunc i64 %27 to i32
br label %29
29: ; preds = %7, %26
%30 = phi i32 [ %28, %26 ], [ 101, %7 ]
ret i32 %30
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, char *, int);
void SafeFree(void *ptr, char *file, int line) {
  if (!ptr)
    printf("Calling Free() on NULL (%s:%3d)\n", file, line);
  else
    free(ptr);
}


x86 assembly (clang, -O0):
<SafeFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <SafeFree+0x36>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
jmp    115f <SafeFree+0x3f>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SafeFree>:
test   %rdi,%rdi
je     112a <SafeFree+0xa>
jmp    1030 <free@plt>
lea    0xecf(%rip),%rdi
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Calling Free() on NULL (%s:%3d)\0A\00"
define void @SafeFree(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11)
br label %16
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
br label %16
16: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Calling Free() on NULL (%s:%3d)\0A\00"
define void @SafeFree(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @free(i8* %0)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void endI2C(int i2cFileDesc) { close(i2cFileDesc); }


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

x86 assembly (clang, -O2):
<endI2C>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @endI2C(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
ret void
}

LLVM IR (-O2):
define void @endI2C(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_THREAD_THREADS_MAX;
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ puts(char *);
long sysconf(int /*<<< orphan*/);
int do_test(void) {
  puts("We expect no limits");
  long int r = sysconf(_SC_THREAD_THREADS_MAX);
  if (r != -1) {
    printf("sysconf(_SC_THREAD_THREADS_MAX) return %ld\n", r);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <sysconf@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
je     117d <do_test+0x4d>
mov    -0x10(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1184 <do_test+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <sysconf@plt>
cmp    $0xffffffffffffffff,%rax
je     1167 <do_test+0x37>
lea    0xebc(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"We expect no limits\00"
@_SC_THREAD_THREADS_MAX = global i32 0
@.str.1 = [44 x i8] c"sysconf(_SC_THREAD_THREADS_MAX) return %ld\0A\00"
define i32 @do_test() {
%1 = alloca i32
%2 = alloca i64
%3 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @_SC_THREAD_THREADS_MAX
%5 = call i64 @sysconf(i32 %4)
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = icmp ne i64 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i64, i64* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i64 %9)
store i32 1, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [20 x i8] c"We expect no limits\00"
@_SC_THREAD_THREADS_MAX = global i32 0
@.str.1 = [44 x i8] c"sysconf(_SC_THREAD_THREADS_MAX) return %ld\0A\00"
define i32 @do_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @_SC_THREAD_THREADS_MAX
%3 = tail call i64 @sysconf(i32 %2)
%4 = icmp eq i64 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i64 %3)
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ 1, %5 ], [ 0, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ log_msg(char *);
void Usage(int exit_code) {
  log_msg("Usage:\n  yppush [-d domain] [-t timeout] [--parallel # | --port #] "
          "[-h host] [-v] mapname ...");
  log_msg("  yppush --version");
  exit(exit_code);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <log_msg@plt>
lea    0xf20(%rip),%rdi
call   1030 <log_msg@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <log_msg@plt>
lea    0xf28(%rip),%rdi
call   1030 <log_msg@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [94 x i8] c"Usage:\0A yppush [-d domain] [-t timeout] [--parallel # | --port #] [-h host] [-v] mapname ...\00"
@.str.1 = [19 x i8] c" yppush --version\00"
define void @Usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @log_msg(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @log_msg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [94 x i8] c"Usage:\0A yppush [-d domain] [-t timeout] [--parallel # | --port #] [-h host] [-v] mapname ...\00"
@.str.1 = [19 x i8] c" yppush --version\00"
define void @Usage(i32 %0) {
%2 = tail call i32 @log_msg(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @log_msg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
unsigned long rdtscl(void) {
  unsigned int l, h;
  asm volatile("rdtsc" : "=a"(l), "=d"(h));
  return l | (((unsigned long)h) << 32);
}


x86 assembly (clang, -O0):
<rdtscl>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtscl>:
rdtsc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtscl() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = shl i64 %9, 32
%11 = or i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @rdtscl() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %2 to i64
%5 = zext i32 %3 to i64
%6 = shl nuw i64 %5, 32
%7 = or i64 %6, %4
ret i64 %7
}
float Cyc_InsertChecks_percent(int i, int total) {
  int _T0;
  float _T1;
  int _T2;
  float _T3;
  float _T4;
  float _T5;
  float _T6;
  float ans = (float)1;
  if (total == 0)
    goto _TLAE;
  _T0 = i;
  _T1 = (float)_T0;
  _T2 = total;
  _T3 = (float)_T2;
  ans = _T1 / _T3;
  goto _TLAF;
_TLAE:
_TLAF:
  _T4 = ans;
  _T5 = (float)100;
  _T6 = _T4 * _T5;
  return _T6;
}


x86 assembly (clang, -O0):
<Cyc_InsertChecks_percent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  0xeee(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1126 <Cyc_InsertChecks_percent+0x26>
jmp    115a <Cyc_InsertChecks_percent+0x5a>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cvtsi2ssl -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
divss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
jmp    115f <Cyc_InsertChecks_percent+0x5f>
jmp    115f <Cyc_InsertChecks_percent+0x5f>
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe93(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_InsertChecks_percent>:
test   %esi,%esi
je     1119 <Cyc_InsertChecks_percent+0x19>
cvtsi2ss %edi,%xmm0
cvtsi2ss %esi,%xmm1
divss  %xmm1,%xmm0
mulss  0xee8(%rip),%xmm0
ret
movss  0xedf(%rip),%xmm0
ret

LLVM IR (-O0):
define float @Cyc_InsertChecks_percent(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
store float 1.000000e+00, float* %12
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %2
br label %26
16: ; preds = %2
%17 = load i32, i32* %3
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = sitofp i32 %18 to float
store float %19, float* %6
%20 = load i32, i32* %4
store i32 %20, i32* %7
%21 = load i32, i32* %7
%22 = sitofp i32 %21 to float
store float %22, float* %8
%23 = load float, float* %6
%24 = load float, float* %8
%25 = fdiv float %23, %24
store float %25, float* %12
br label %27
26: ; preds = %15
br label %27
27: ; preds = %26, %16
%28 = load float, float* %12
store float %28, float* %9
store float 1.000000e+02, float* %10
%29 = load float, float* %9
%30 = load float, float* %10
%31 = fmul float %29, %30
store float %31, float* %11
%32 = load float, float* %11
ret float %32
}

LLVM IR (-O2):
define float @Cyc_InsertChecks_percent(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = sitofp i32 %0 to float
%6 = sitofp i32 %1 to float
%7 = fdiv float %5, %6
%8 = fmul float %7, 1.000000e+02
br label %9
9: ; preds = %2, %4
%10 = phi float [ 1.000000e+02, %2 ], [ %8, %4 ]
ret float %10
}
void f2(int a) {
  _Bool v1 = (a == 1);
  _Bool v2 = (a == 2);
  _Bool v3 = (a == 3);
  _Bool v4 = (a == 4);
  if (v1 || v2 || v3 || v4)
    foo();
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0x5(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0x6(%rbp)
cmpl   $0x3,-0x4(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0x7(%rbp)
cmpl   $0x4,-0x4(%rbp)
sete   %al
and    $0x1,%al
mov    %al,-0x8(%rbp)
testb  $0x1,-0x5(%rbp)
jne    1173 <f2+0x63>
testb  $0x1,-0x6(%rbp)
jne    1173 <f2+0x63>
testb  $0x1,-0x7(%rbp)
jne    1173 <f2+0x63>
testb  $0x1,-0x8(%rbp)
je     117a <f2+0x6a>
mov    $0x0,%al
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
add    $0xffffffff,%edi
cmp    $0x3,%edi
ja     111f <f2+0xf>
xor    %eax,%eax
jmp    1030 <foo@plt>
ret

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

LLVM IR (-O2):
define void @f2(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @foo()
br label %6
6: ; preds = %1, %4
ret void
}
long long dfn_rll() { return 4; }


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

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

LLVM IR (-O0):
define i64 @dfn_rll() {
ret i64 4
}

LLVM IR (-O2):
define i64 @dfn_rll() {
ret i64 4
}
/* Variables and functions */
void strcpy(char *s, char *t) {
  while ((*s++ = *t++) != '\0')
    ;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     113f <strcpy+0x3f>
jmp    110c <strcpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define void @strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
int __attribute__((target("sse4.2"))) mv_after_use(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @mv_after_use() {
ret i32 1
}

LLVM IR (-O2):
define i32 @mv_after_use() {
ret i32 1
}
void intersect_leafs(char *storage1, char *storage2) {
  ((*storage1) = ((*storage1) & (~(*storage2))));
  storage1++;
  storage2++;
  ((*storage1) = ((*storage1) & (~(*storage2))));
}


x86 assembly (clang, -O0):
<intersect_leafs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<intersect_leafs>:
mov    (%rsi),%al
not    %al
and    %al,(%rdi)
mov    0x1(%rsi),%al
not    %al
and    %al,0x1(%rdi)
ret

LLVM IR (-O0):
define void @intersect_leafs(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = and i32 %7, %11
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
store i8 %13, i8* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %4
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8*, i8** %4
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = xor i32 %24, -1
%26 = and i32 %21, %25
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %3
store i8 %27, i8* %28
ret void
}

LLVM IR (-O2):
define void @intersect_leafs(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = xor i8 %4, -1
%6 = and i8 %3, %5
store i8 %6, i8* %0
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = getelementptr inbounds i8, i8* %1, i64 1
%9 = load i8, i8* %7
%10 = load i8, i8* %8
%11 = xor i8 %10, -1
%12 = and i8 %9, %11
store i8 %12, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nntp_get_response(char *);
int /*<<< orphan*/ nntp_issue_command(char *);
void nntp_logoff() {
  char tmpbuffer[1024];
  nntp_issue_command("QUIT");
  nntp_get_response(tmpbuffer);
}


x86 assembly (clang, -O0):
<nntp_logoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    0xece(%rip),%rdi
call   1030 <nntp_issue_command@plt>
lea    -0x400(%rbp),%rdi
call   1040 <nntp_get_response@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nntp_logoff>:
sub    $0x408,%rsp
lea    0xed2(%rip),%rdi
call   1030 <nntp_issue_command@plt>
mov    %rsp,%rdi
call   1040 <nntp_get_response@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"QUIT\00"
define void @nntp_logoff() {
%1 = alloca [1024 x i8]
%2 = call i32 @nntp_issue_command(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = call i32 @nntp_get_response(i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"QUIT\00"
define void @nntp_logoff() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @nntp_issue_command(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @nntp_get_response(i8* %2)
ret void
}
void arm_dt_memblock_reserve(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ wait4(int /*<<< orphan*/, int *, int, int /*<<< orphan*/ *);
__pid_t __libc_waitpid(__pid_t pid, int *wait_stat, int options) {
  return wait4(pid, wait_stat, options, NULL);
}


x86 assembly (clang, -O0):
<__libc_waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_waitpid>:
xor    %ecx,%ecx
jmp    1030 <wait4@plt>

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

LLVM IR (-O2):
define i32 @__libc_waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @wait4(i32 %0, i32* %1, i32 %2, i32* null)
ret i32 %4
}
_Bool is_empty(char *s) {
  while (*s == ' ' || *s == '\t' || *s == '\n')
    s++;
  return (_Bool)(*s == '#' || *s == '\0');
}


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1142 <is_empty+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     1142 <is_empty+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <is_empty+0x52>
jmp    1163 <is_empty+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <is_empty+0x8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x23,%ecx
mov    %al,-0xa(%rbp)
je     1188 <is_empty+0x88>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
movabs $0x100000600,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
cmp    $0x23,%rcx
ja     1138 <is_empty+0x38>
bt     %rcx,%rax
jae    1125 <is_empty+0x25>
add    $0x1,%rdi
jmp    1110 <is_empty+0x10>
movabs $0x800000001,%rax
bt     %rcx,%rax
jae    1138 <is_empty+0x38>
mov    $0x1,%al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i1 @is_empty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %20, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %18, label %8
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br label %18
18: ; preds = %13, %8, %3
%19 = phi i1 [ true, %8 ], [ true, %3 ], [ %17, %13 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %2
br label %3
23: ; preds = %18
%24 = load i8*, i8** %2
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 35
br i1 %27, label %33, label %28
28: ; preds = %23
%29 = load i8*, i8** %2
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 0
br label %33
33: ; preds = %28, %23
%34 = phi i1 [ true, %23 ], [ %32, %28 ]
ret i1 %34
}

LLVM IR (-O2):
define zeroext i1 @is_empty(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 32, label %5
i8 9, label %5
i8 10, label %5
i8 35, label %7
i8 0, label %7
]
5: ; preds = %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
br label %8
8: ; preds = %2, %7
%9 = phi i1 [ true, %7 ], [ false, %2 ]
ret i1 %9
}
/* Variables and functions */
int eslib_rtnetlink_linkset(char *, int);
int eslib_rtnetlink_linksetup(char *name) {
  return eslib_rtnetlink_linkset(name, 1);
}


x86 assembly (clang, -O0):
<eslib_rtnetlink_linksetup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <eslib_rtnetlink_linkset@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @eslib_rtnetlink_linksetup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @eslib_rtnetlink_linkset(i8* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @eslib_rtnetlink_linksetup(i8* %0) {
%2 = tail call i32 @eslib_rtnetlink_linkset(i8* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
size_t normalize_size(size_t length) { return (length + 7) / 8 * 8; }


x86 assembly (clang, -O0):
<normalize_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x7,%rax
shr    $0x3,%rax
shl    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_size>:
lea    0x7(%rdi),%rax
and    $0xfffffffffffffff8,%rax
ret

LLVM IR (-O0):
define i64 @normalize_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 7
%5 = udiv i64 %4, 8
%6 = mul i64 %5, 8
ret i64 %6
}

LLVM IR (-O2):
define i64 @normalize_size(i64 %0) {
%2 = add i64 %0, 7
%3 = and i64 %2, -8
ret i64 %3
}
__attribute__((__always___)) void _xend(void) {
  asm volatile(".byte 0x0f,0x01,0xd5" ::: "memory");
}


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

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

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

LLVM IR (-O2):
define void @_xend() {
tail call void asm sideeffect ".byte 0x0f,0x01,0xd5", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef char *uint16_t;

/* Variables and functions */
uint16_t get_ss(void) {
  uint16_t result;
  asm volatile("movw %%"
               "ss"
               ", %0"
               : "=m"(result));
  return result;
}


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

x86 assembly (clang, -O2):
<get_ss>:
mov    %ss,-0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i8* @get_ss() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = load i8*, i8** %1
ret i8* %3
}
/* Variables and functions */
char *canonicalize_file_name(char const *);
char *octave_canonicalize_file_name_wrapper(const char *name) {
  return canonicalize_file_name(name);
}


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

x86 assembly (clang, -O2):
<octave_canonicalize_file_name_wrapper>:
jmp    1030 <canonicalize_file_name@plt>

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

LLVM IR (-O2):
define i8* @octave_canonicalize_file_name_wrapper(i8* %0) {
%2 = tail call i8* @canonicalize_file_name(i8* %0)
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int win_gravity;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_win_gravity(void *_p, int _v) {
  ((XWindowAttributes *)_p)->win_gravity = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XWindowAttributes_win_gravity>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XWindowAttributes_win_gravity(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XWindowAttributes_win_gravity(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}