xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblock_get_pool() {
  printf("NOT IMPLEMENTED:"
         "pa_memblock_get_pool"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_memblock_get_pool\00"
define i32 @pa_memblock_get_pool() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int printargs(struct tcb *);
int sys_stat64(struct tcb *tcp) { return printargs(tcp); }


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

x86 assembly (clang, -O2):
<sys_stat64>:
jmp    1030 <printargs@plt>

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

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_stat64(%struct.tcb* %0) {
%2 = tail call i32 @printargs(%struct.tcb* %0)
ret i32 %2
}
/* Variables and functions */
int shot(int, char **);
int main(int argc, char *argv[]) { return shot(argc, argv); }


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <shot@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <shot@plt>

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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @shot(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @shot(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *chaz_ConfWriter_get_charmony_fh();
FILE *Probe_get_charmony_fh(void) { return chaz_ConfWriter_get_charmony_fh(); }


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

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

LLVM IR (-O0):
define i32* @Probe_get_charmony_fh() {
%1 = call i32* (...) @chaz_ConfWriter_get_charmony_fh()
ret i32* %1
}

LLVM IR (-O2):
define i32* @Probe_get_charmony_fh() {
%1 = tail call i32* (...) @chaz_ConfWriter_get_charmony_fh()
ret i32* %1
}
int clampi(int src, int min, int max) {
  return src > max ? max : (src < min ? min : src);
}


x86 assembly (clang, -O0):
<clampi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1124 <clampi+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clampi+0x47>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113b <clampi+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clampi+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampi>:
mov    %esi,%eax
cmp    %esi,%edi
cmovge %edi,%eax
cmp    %edx,%edi
cmovg  %edx,%eax
ret

LLVM IR (-O0):
define i32 @clampi(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* %6
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %6
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %5
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @clampi(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = icmp slt i32 %0, %1
%6 = select i1 %5, i32 %1, i32 %0
%7 = select i1 %4, i32 %2, i32 %6
ret i32 %7
}
/* Variables and functions */
size_t strlen(char *);
char *strrchr(char *, char);
void rmnewline(char *expression) {
  char *newline = NULL;
  size_t position, copylen;
  size_t stringlen = strlen(expression);
  if (NULL != (newline = strrchr(expression, '\n'))) {
    copylen = strlen(newline);
    position = stringlen - copylen;
    expression[position] = '\0';
  }
}


x86 assembly (clang, -O0):
<rmnewline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1040 <strrchr@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
je     1186 <rmnewline+0x66>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmnewline>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0xa,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1155 <rmnewline+0x35>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
sub    %rax,%rbx
movb   $0x0,(%r14,%rbx,1)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @rmnewline(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = tail call i64 @strlen(i8* %2)
%7 = sub i64 %5, %6
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
br label %9
9: ; preds = %4, %1
ret void
}
void init6Bits(int bits[7], const int bit1, const int bit2, const int bit3,
               const int bit4, const int bit5, const int bit6) {
  bits[1] = bit1;
  bits[2] = bit2;
  bits[3] = bit3;
  bits[4] = bit4;
  bits[5] = bit5;
  bits[6] = bit6;
}


x86 assembly (clang, -O0):
<init6Bits>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init6Bits>:
mov    0x8(%rsp),%eax
mov    %esi,0x4(%rdi)
mov    %edx,0x8(%rdi)
mov    %ecx,0xc(%rdi)
mov    %r8d,0x10(%rdi)
mov    %r9d,0x14(%rdi)
mov    %eax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @init6Bits(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %9
%16 = load i32*, i32** %8
%17 = getelementptr inbounds i32, i32* %16, i64 1
store i32 %15, i32* %17
%18 = load i32, i32* %10
%19 = load i32*, i32** %8
%20 = getelementptr inbounds i32, i32* %19, i64 2
store i32 %18, i32* %20
%21 = load i32, i32* %11
%22 = load i32*, i32** %8
%23 = getelementptr inbounds i32, i32* %22, i64 3
store i32 %21, i32* %23
%24 = load i32, i32* %12
%25 = load i32*, i32** %8
%26 = getelementptr inbounds i32, i32* %25, i64 4
store i32 %24, i32* %26
%27 = load i32, i32* %13
%28 = load i32*, i32** %8
%29 = getelementptr inbounds i32, i32* %28, i64 5
store i32 %27, i32* %29
%30 = load i32, i32* %14
%31 = load i32*, i32** %8
%32 = getelementptr inbounds i32, i32* %31, i64 6
store i32 %30, i32* %32
ret void
}

LLVM IR (-O2):
define void @init6Bits(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %1, i32* %8
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %2, i32* %9
%10 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %3, i32* %10
%11 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %4, i32* %11
%12 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %5, i32* %12
%13 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %6, i32* %13
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int diminuto_pin_put(int /*<<< orphan*/ *, int);
int diminuto_pin_set(FILE *fp) { return diminuto_pin_put(fp, !0); }


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

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

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

LLVM IR (-O2):
define i32 @diminuto_pin_set(i32* %0) {
%2 = tail call i32 @diminuto_pin_put(i32* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
size_t Curl_ssl_version(char *buffer, size_t size) {
  (void)buffer;
  (void)size;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @Curl_ssl_version(i8* nocapture readnone %0, i64 %1) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, char *, long);
long mysyscall(char *name_buf, long id) { syscall(317, name_buf, id); }


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

x86 assembly (clang, -O2):
<mysyscall>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x13d,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i64 @mysyscall(i8* %0, i64 %1) {
%3 = tail call i32 @syscall(i32 317, i8* %0, i64 %1)
ret i64 undef
}
void exynos_unregister_thermal(struct thermal_sensor_conf *sensor_conf) {
  return;
}


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

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

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

LLVM IR (-O2):
%struct.thermal_sensor_conf = type opaque
define void @exynos_unregister_thermal(%struct.thermal_sensor_conf* nocapture %0) {
ret void
}
void gtk_font_button_set_font_name() {}


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

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

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

LLVM IR (-O2):
define void @gtk_font_button_set_font_name() {
ret void
}
long long atmc_fetch_and_add64(volatile unsigned long long *address,
                               long long value) {
  int prev = value;
  asm volatile("lock ; "
               "xaddq %0, %1"
               : "+r"(value), "+m"(*address)
               :
               : "memory");
  return prev + value;
}


x86 assembly (clang, -O0):
<atmc_fetch_and_add64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
lock xadd %rax,(%rcx)
mov    %rax,-0x10(%rbp)
movslq -0x14(%rbp),%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atmc_fetch_and_add64>:
movslq %esi,%rax
lock xadd %rsi,(%rdi)
add    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @atmc_fetch_and_add64(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i32
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
store i32 %7, i32* %5
%8 = load i64, i64* %4
%9 = load i64*, i64** %3
%10 = call i64 asm sideeffect "lock ; xaddq $0, $1", "=r,=*m,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %9, i64 %8, i64* elementtype(i64) %9)
store i64 %10, i64* %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = load i64, i64* %4
%14 = add nsw i64 %12, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @atmc_fetch_and_add64(i64* %0, i64 %1) {
%3 = tail call i64 asm sideeffect "lock ; xaddq $0, $1", "=r,=*m,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %1, i64* elementtype(i64) %0)
%4 = shl i64 %1, 32
%5 = ashr exact i64 %4, 32
%6 = add nsw i64 %3, %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mxml_free(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<mxml_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mxml_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_pipe_get_stats_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_pipe@%p::get_stats (rtpp_pipe_get_stats) is invoked "
          "after destruction\x0a",
          pub);
  abort();
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [83 x i8] c"Method rtpp_pipe@%p::get_stats (rtpp_pipe_get_stats) is invoked after destruction\0A\00"
define void @rtpp_pipe_get_stats_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [83 x i8] c"Method rtpp_pipe@%p::get_stats (rtpp_pipe_get_stats) is invoked after destruction\0A\00"
define void @rtpp_pipe_get_stats_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
double cosh(double x) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(x);
  return 0;
}


x86 assembly (clang, -O0):
<cosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosh>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.cosh = [5 x i8] c"cosh\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @cosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.cosh, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%7 = load double, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.cosh = [5 x i8] c"cosh\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @cosh(double %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.cosh, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ test2();
int main(int argc, const char *argv[]) {
  test2();
  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)
mov    $0x0,%al
call   1030 <test2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test2@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 (...) @test2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() { printf("usage: ys <command_line>\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"usage: ys <command_line>\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"usage: ys <command_line>\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned char t4(unsigned char a, unsigned char b) {
  unsigned int la = a;
  unsigned int lb = b;
  unsigned int bigres;
  unsigned char res;
  __asm__("0:\n1:\n"
          : [bigres] "=la"(bigres)
          : [la] "0"(la), [lb] "c"(lb)
          : "edx", "cc");
  res = bigres;
  return res;
}


x86 assembly (clang, -O0):
<t4>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x2(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t4>:
mov    %esi,%ecx
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @t4(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
store i32 %10, i32* %5
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 asm "0:\0A1:\0A", "=l{ax},0,{cx},~{edx},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = trunc i32 %16 to i8
store i8 %17, i8* %8
%18 = load i8, i8* %8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @t4(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = tail call i32 asm "0:\0A1:\0A", "=l{ax},0,{cx},~{edx},~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %3, i32 %4)
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Variables and functions */
int kegsmain(int, char **);
int main(int argc, char **argv) { return kegsmain(argc, argv); }


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <kegsmain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <kegsmain@plt>

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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @kegsmain(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @kegsmain(i32 %0, i8** %1)
ret i32 %3
}
/* Type definitions */
struct args_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ out_str(char *);
char do_hello_v(struct args_t *args) {
  out_str("Volatile Hello World");
  return 1;
}


x86 assembly (clang, -O0):
<do_hello_v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <out_str@plt>
mov    $0x1,%al
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_hello_v>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <out_str@plt>
mov    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
%struct.args_t = type { i32 }
@.str = [21 x i8] c"Volatile Hello World\00"
define signext i8 @do_hello_v(%struct.args_t* %0) {
%2 = alloca %struct.args_t*
store %struct.args_t* %0, %struct.args_t** %2
%3 = call i32 @out_str(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i8 1
}

LLVM IR (-O2):
%struct.args_t = type { i32 }
@.str = [21 x i8] c"Volatile Hello World\00"
define signext i8 @do_hello_v(%struct.args_t* nocapture readnone %0) {
%2 = tail call i32 @out_str(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i8 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int filecmp(FILE *a, FILE *b) { return a == b; }


x86 assembly (clang, -O0):
<filecmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filecmp>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @filecmp(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 = icmp eq i32* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @filecmp(i32* readnone %0, i32* readnone %1) {
%3 = icmp eq i32* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ vs_write_volume(int);
void audio_set_volume(int vol) {
  if (vol <= 0) {
    vs_write_volume(0);
  } else if (vol > 100) {
    vs_write_volume(100);
  } else {
    vs_write_volume(vol);
  }
  return;
}


x86 assembly (clang, -O0):
<audio_set_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1131 <audio_set_volume+0x21>
xor    %edi,%edi
call   1030 <vs_write_volume@plt>
jmp    1157 <audio_set_volume+0x47>
cmpl   $0x64,-0x4(%rbp)
jle    114a <audio_set_volume+0x3a>
mov    $0x64,%edi
call   1030 <vs_write_volume@plt>
jmp    1152 <audio_set_volume+0x42>
mov    -0x4(%rbp),%edi
call   1030 <vs_write_volume@plt>
jmp    1157 <audio_set_volume+0x47>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_set_volume>:
cmp    $0x64,%edi
mov    $0x64,%ecx
cmovb  %edi,%ecx
xor    %eax,%eax
test   %edi,%edi
cmovg  %ecx,%eax
mov    %eax,%edi
jmp    1030 <vs_write_volume@plt>

LLVM IR (-O0):
define void @audio_set_volume(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @vs_write_volume(i32 0)
br label %16
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 100
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @vs_write_volume(i32 100)
br label %15
12: ; preds = %7
%13 = load i32, i32* %2
%14 = call i32 @vs_write_volume(i32 %13)
br label %15
15: ; preds = %12, %10
br label %16
16: ; preds = %15, %5
ret void
}

LLVM IR (-O2):
define void @audio_set_volume(i32 %0) {
%2 = icmp ult i32 %0, 100
%3 = select i1 %2, i32 %0, i32 100
%4 = icmp sgt i32 %0, 0
%5 = select i1 %4, i32 %3, i32 0
%6 = tail call i32 @vs_write_volume(i32 %5)
ret void
}
/* Variables and functions */
int isOlder(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char a[] = "12-11-1898";
  char b[] = "13-10-1898";
  printf("%d", isOlder(a, b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xb(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x16(%rbp)
mov    0xeba(%rip),%ax
mov    %ax,-0xe(%rbp)
mov    0xeb2(%rip),%al
mov    %al,-0xc(%rbp)
lea    -0xb(%rbp),%rdi
lea    -0x16(%rbp),%rsi
call   1030 <isOlder@plt>
mov    %eax,%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movabs $0x38312d31312d3231,%rax
2d 31 38
mov    %rax,0x18(%rsp)
movl   $0x383938,0x1f(%rsp)
movabs $0x38312d30312d3331,%rax
2d 31 38
mov    %rax,0x8(%rsp)
movl   $0x383938,0xf(%rsp)
lea    0x18(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <isOlder@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [11 x i8] c"12-11-1898\00"
@__const.main.b = [11 x i8] c"13-10-1898\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = alloca [11 x i8]
%3 = bitcast [11 x i8]* %1 to i8*
%4 = bitcast [11 x i8]* %2 to i8*
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%7 = call i32 @isOlder(i8* %5, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [11 x i8] c"12-11-1898\00"
@__const.main.b = [11 x i8] c"13-10-1898\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = alloca [11 x i8]
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%5 = call i32 @isOlder(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int add3(int x, int y, int *z) {
  *z = x - y;
  return x + y;
}


x86 assembly (clang, -O0):
<add3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add3>:
lea    (%rsi,%rdi,1),%eax
mov    %edi,%ecx
sub    %esi,%ecx
mov    %ecx,(%rdx)
ret

LLVM IR (-O0):
define i32 @add3(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 = sub nsw i32 %7, %8
%10 = load i32*, i32** %6
store i32 %9, i32* %10
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @add3(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = sub nsw i32 %0, %1
store i32 %4, i32* %2
%5 = add nsw i32 %1, %0
ret i32 %5
}
int test_imm_CAint16_reg(short val) {
  return ((val) & (0xCA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CAint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xca,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_CAint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 202
%6 = icmp ne i32 %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_CAint16_reg(i16 signext %0) {
%2 = and i16 %0, 202
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int seek_arg(const char *a, const char *b) {
  while (*b == '/')
    b++;
  if (*b)
    return b - a;
  return -1;
}


x86 assembly (clang, -O0):
<seek_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    112d <seek_arg+0x2d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <seek_arg+0xc>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <seek_arg+0x4d>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1154 <seek_arg+0x54>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seek_arg>:
mov    %esi,%eax
sub    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rsi),%ecx
cmp    $0x2f,%cl
jne    1121 <seek_arg+0x21>
add    $0x1,%rsi
add    $0x1,%eax
jmp    1110 <seek_arg+0x10>
test   %cl,%cl
jne    112a <seek_arg+0x2a>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @seek_arg(i8* %0, i8* %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i8* [ %1, %2 ], [ %7, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 47, label %6
i8 0, label %13
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3
%9 = ptrtoint i8* %4 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
br label %13
13: ; preds = %3, %8
%14 = phi i32 [ %12, %8 ], [ -1, %3 ]
ret i32 %14
}
/* Type definitions */
struct stat64 {
  int dummy;
};

/* Variables and functions */
int __fxstatat64(int, int, char const *, struct stat64 *, int);
int fstatat64(int fd, const char *path, struct stat64 *buf, int flag) {
  return __fxstatat64(1, fd, path, buf, flag);
}


x86 assembly (clang, -O0):
<fstatat64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%edi
call   1030 <__fxstatat64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstatat64>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <__fxstatat64@plt>

LLVM IR (-O0):
%struct.stat64 = type { i32 }
define i32 @fstatat64(i32 %0, i8* %1, %struct.stat64* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.stat64*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.stat64* %2, %struct.stat64** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load %struct.stat64*, %struct.stat64** %7
%12 = load i32, i32* %8
%13 = call i32 @__fxstatat64(i32 1, i32 %9, i8* %10, %struct.stat64* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.stat64 = type { i32 }
define i32 @fstatat64(i32 %0, i8* %1, %struct.stat64* %2, i32 %3) {
%5 = tail call i32 @__fxstatat64(i32 1, i32 %0, i8* %1, %struct.stat64* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void bar(void) {

#pragma GCC diagnostic push

#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

  foo();

#pragma GCC diagnostic pop
}


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

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

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

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 (...) @foo()
ret void
}
unsigned int setIByte(unsigned int e, int i) {
  unsigned int mask = 1u << (i - 1);
  unsigned int result = e | mask;
  return result;
}


x86 assembly (clang, -O0):
<setIByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setIByte>:
mov    %edi,%eax
add    $0xff,%sil
bts    %esi,%eax
ret

LLVM IR (-O0):
define i32 @setIByte(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* %4
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = or i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
define i32 @setIByte(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = or i32 %4, %0
ret i32 %5
}
int hammingDistance(int x, int y) {
  int retval = 0;
  int z = x ^ y;
  for (int i = 0; i < sizeof(int) * 8 && z > 0; i++) {
    retval += (z & 1);
    z >>= 1;
  }
  return retval;
}


x86 assembly (clang, -O0):
<hammingDistance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rcx
xor    %eax,%eax
cmp    $0x20,%rcx
mov    %al,-0x15(%rbp)
jae    113e <hammingDistance+0x3e>
cmpl   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114e <hammingDistance+0x4e>
jmp    1171 <hammingDistance+0x71>
mov    -0x10(%rbp),%eax
and    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1121 <hammingDistance+0x21>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hammingDistance>:
xor    %esi,%edi
jle    112d <hammingDistance+0x2d>
xor    %ecx,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    %eax,%edx
mov    %edi,%eax
and    $0x1,%eax
add    %edx,%eax
cmp    $0x1e,%ecx
ja     112c <hammingDistance+0x2c>
mov    %edi,%edx
shr    %edx
add    $0x1,%ecx
cmp    $0x1,%edi
mov    %edx,%edi
ja     1110 <hammingDistance+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hammingDistance(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = icmp sgt i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %7, %2
%6 = phi i32 [ 0, %2 ], [ %12, %7 ]
ret i32 %6
7: ; preds = %2, %7
%8 = phi i32 [ %14, %7 ], [ 0, %2 ]
%9 = phi i32 [ %13, %7 ], [ %3, %2 ]
%10 = phi i32 [ %12, %7 ], [ 0, %2 ]
%11 = and i32 %9, 1
%12 = add nuw nsw i32 %11, %10
%13 = lshr i32 %9, 1
%14 = add nuw nsw i32 %8, 1
%15 = icmp ult i32 %8, 31
%16 = icmp ugt i32 %9, 1
%17 = select i1 %15, i1 %16, i1 false
br i1 %17, label %7, label %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_25519_selectznz(uintptr_t, uintptr_t,
                                                 uintptr_t, uintptr_t);
void fiat_25519_selectznz(uint32_t out1[10], uint8_t arg1,
                          const uint32_t arg2[10], const uint32_t arg3[10]) {
  internal_fiat_25519_selectznz((uintptr_t)out1, (uintptr_t)arg1,
                                (uintptr_t)arg2, (uintptr_t)arg3);
}


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

x86 assembly (clang, -O2):
<fiat_25519_selectznz>:
jmp    1030 <internal_fiat_25519_selectznz@plt>

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

LLVM IR (-O2):
define void @fiat_25519_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = ptrtoint i32* %0 to i64
%6 = ptrtoint i32* %2 to i64
%7 = ptrtoint i32* %3 to i64
%8 = tail call i32 @internal_fiat_25519_selectznz(i64 %5, i64 %1, i64 %6, i64 %7)
ret void
}
int irint(double f) { return (int)(f + 0.5); }


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

x86 assembly (clang, -O2):
<irint>:
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @irint(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = fptosi double %2 to i32
ret i32 %3
}
__attribute__((no)) void *gen_load_locked_di(void *x, void *y) { return x; }


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

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

LLVM IR (-O0):
define i8* @gen_load_locked_di(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
ret i8* %5
}

LLVM IR (-O2):
define i8* @gen_load_locked_di(i8* readnone returned %0, i8* nocapture readnone %1) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ showText(char *);
void showMinus(void) { showText("&minus;"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"&minus;\00"
define void @showMinus() {
%1 = call i32 @showText(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"&minus;\00"
define void @showMinus() {
%1 = tail call i32 @showText(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
long double __qacos(long double);
long double intr_wrap_002(long double p1) { return __qacos(p1); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qacos@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define x86_fp80 @intr_wrap_002(x86_fp80 %0) {
%2 = tail call x86_fp80 @__qacos(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ my_string;

/* Variables and functions */
int /*<<< orphan*/ nested(char **, unsigned int *, int);
void nested_call(void) {
  char my_string[] = "hello";
  char *my_pointers[] = {my_string};
  unsigned int my_sizes[] = {sizeof(my_string)};
  nested(my_pointers, my_sizes, 1);
}


x86 assembly (clang, -O0):
<nested_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xedc(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0x6(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x1,%edx
call   1030 <nested@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nested_call>:
sub    $0x18,%rsp
movw   $0x6f,0xc(%rsp)
movl   $0x6c6c6568,0x8(%rsp)
6c
lea    0x8(%rsp),%rax
mov    %rax,0x10(%rsp)
movl   $0x6,0x4(%rsp)
lea    0x10(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <nested@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.nested_call.my_string = [6 x i8] c"hello\00"
@__const.nested_call.my_sizes = [1 x i32] [i32 6]
define void @nested_call() {
%1 = alloca [6 x i8]
%2 = alloca [1 x i8*]
%3 = alloca [1 x i32]
%4 = bitcast [6 x i8]* %1 to i8*
%5 = getelementptr inbounds [1 x i8*], [1 x i8*]* %2, i64 0, i64 0
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
store i8* %6, i8** %5
%7 = bitcast [1 x i32]* %3 to i8*
%8 = getelementptr inbounds [1 x i8*], [1 x i8*]* %2, i64 0, i64 0
%9 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%10 = call i32 @nested(i8** %8, i32* %9, i32 1)
ret void
}

LLVM IR (-O2):
@__const.nested_call.my_string = [6 x i8] c"hello\00"
define void @nested_call() {
%1 = alloca [6 x i8]
%2 = alloca [1 x i8*]
%3 = alloca [1 x i32]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%5 = bitcast [1 x i8*]* %2 to i8*
%6 = getelementptr inbounds [1 x i8*], [1 x i8*]* %2, i64 0, i64 0
store i8* %4, i8** %6
%7 = bitcast [1 x i32]* %3 to i8*
%8 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 6, i32* %8
%9 = call i32 @nested(i8** %6, i32* %8, i32 1)
ret void
}
void foo(int *a) {
  ++a;
  *a = 8;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x8,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x8,0x4(%rdi)
ret

LLVM IR (-O0):
define void @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i32 1
store i32* %4, i32** %2
%5 = load i32*, i32** %2
store i32 8, i32* %5
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
store i32 8, i32* %2
ret void
}