xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ start_str;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int format_iso8601(char *, int, int /*<<< orphan*/);
char *make_message(char *, char *);
__attribute__((malloc)) char *incomplete_name(int64_t start) {
  char start_str[200];
  int ret = format_iso8601(start_str, sizeof(start_str), start);
  if (ret)
    return NULL;
  return make_message("%s--incomplete", start_str);
}


x86 assembly (clang, -O0):
<incomplete_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %edi,-0xc(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0xc8,%esi
call   1040 <format_iso8601@plt>
mov    %eax,-0xe4(%rbp)
cmpl   $0x0,-0xe4(%rbp)
je     1162 <incomplete_name+0x42>
movq   $0x0,-0x8(%rbp)
jmp    1179 <incomplete_name+0x59>
lea    -0xe0(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1030 <make_message@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<incomplete_name>:
sub    $0xc8,%rsp
mov    %edi,%edx
mov    %rsp,%rdi
mov    $0xc8,%esi
call   1040 <format_iso8601@plt>
test   %eax,%eax
je     1144 <incomplete_name+0x24>
xor    %eax,%eax
add    $0xc8,%rsp
ret
lea    0xeb5(%rip),%rdi
mov    %rsp,%rsi
call   1030 <make_message@plt>
add    $0xc8,%rsp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s--incomplete\00"
define noalias i8* @incomplete_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [200 x i8]
%5 = alloca i32
store i32 %0, i32* %3
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @format_iso8601(i8* %6, i32 200, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i8* null, i8** %2
br label %15
12: ; preds = %1
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%14 = call i8* @make_message(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %12, %11
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s--incomplete\00"
define noalias i8* @incomplete_name(i32 %0) {
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = call i32 @format_iso8601(i8* %3, i32 200, i32 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i8* @make_message(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %8
8: ; preds = %1, %6
%9 = phi i8* [ %7, %6 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
scalar_t__ inc_addr(void *, int);
scalar_t__ shim_migrate_pages(int /*<<< orphan*/, int, unsigned long *,
                              unsigned long *);
int bad_migrate_pages(void *addr) {
  return (int)shim_migrate_pages(getpid(), 1, (unsigned long *)addr,
                                 (unsigned long *)inc_addr(addr, 1));
}


x86 assembly (clang, -O0):
<bad_migrate_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1050 <inc_addr@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
mov    $0x1,%esi
call   1030 <shim_migrate_pages@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_migrate_pages>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <inc_addr@plt>
mov    %ebp,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <shim_migrate_pages@plt>

LLVM IR (-O0):
define i32 @bad_migrate_pages(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @getpid()
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
%6 = load i8*, i8** %2
%7 = call i64 @inc_addr(i8* %6, i32 1)
%8 = inttoptr i64 %7 to i64*
%9 = call i64 @shim_migrate_pages(i32 %3, i32 1, i64* %5, i64* %8)
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @bad_migrate_pages(i8* %0) {
%2 = tail call i32 (...) @getpid()
%3 = bitcast i8* %0 to i64*
%4 = tail call i64 @inc_addr(i8* %0, i32 1)
%5 = inttoptr i64 %4 to i64*
%6 = tail call i64 @shim_migrate_pages(i32 %2, i32 1, i64* %3, i64* %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Type definitions */
struct vmfile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/, int, size_t);
int /*<<< orphan*/ vmfile_data(struct vmfile *);
void vmfile_memset(struct vmfile *vmb, int c, size_t n) {
  memset(vmfile_data(vmb), c, n);
}


x86 assembly (clang, -O0):
<vmfile_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vmfile_data@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmfile_memset>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1030 <vmfile_data@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <memset@plt>

LLVM IR (-O0):
%struct.vmfile = type { i32 }
define void @vmfile_memset(%struct.vmfile* %0, i32 %1, i64 %2) {
%4 = alloca %struct.vmfile*
%5 = alloca i32
%6 = alloca i64
store %struct.vmfile* %0, %struct.vmfile** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load %struct.vmfile*, %struct.vmfile** %4
%8 = call i32 @vmfile_data(%struct.vmfile* %7)
%9 = load i32, i32* %5
%10 = load i64, i64* %6
%11 = call i32 @memset(i32 %8, i32 %9, i64 %10)
ret void
}

LLVM IR (-O2):
%struct.vmfile = type { i32 }
define void @vmfile_memset(%struct.vmfile* %0, i32 %1, i64 %2) {
%4 = tail call i32 @vmfile_data(%struct.vmfile* %0)
%5 = tail call i32 @memset(i32 %4, i32 %1, i64 %2)
ret void
}
/* Type definitions */
struct job {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct job *);
void job_free(struct job *job) { free(job); }


x86 assembly (clang, -O0):
<job_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):
<job_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.job = type { i32 }
define void @job_free(%struct.job* nocapture %0) {
%2 = tail call i32 @free(%struct.job* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ n;

/* Variables and functions */
int /*<<< orphan*/ be32toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char const *, int);
uint32_t ntoh32(const char *p) {
  uint32_t n;
  memcpy(&n, p, sizeof(n));
  return be32toh(n);
}


x86 assembly (clang, -O0):
<ntoh32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1040 <be32toh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntoh32>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <be32toh@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ntoh32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
%7 = call i32 @be32toh(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ntoh32(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @be32toh(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void helloworld() {
  putchar('H');
  putchar('e');
  putchar('\n');
}


x86 assembly (clang, -O0):
<helloworld>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<helloworld>:
push   %rax
mov    $0x48,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @helloworld() {
%1 = call i32 @putchar(i8 signext 72)
%2 = call i32 @putchar(i8 signext 101)
%3 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @helloworld() {
%1 = tail call i32 @putchar(i8 signext 72)
%2 = tail call i32 @putchar(i8 signext 101)
%3 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int ho2cu(double *, double *, int);
int om2ho(double *, double *, int);
int om2cu(double *om, double *cu, int p) {
  double ho[3];
  int trash;
  trash = om2ho(om, ho, p);
  trash = ho2cu(ho, cu, p);
  return 1;
}


x86 assembly (clang, -O0):
<om2cu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <om2ho@plt>
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <ho2cu@plt>
mov    %eax,-0x34(%rbp)
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om2cu>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rsp,%r15
mov    %r15,%rsi
call   1030 <om2ho@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <ho2cu@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @om2cu(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca [3 x double]
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%11 = load i32, i32* %6
%12 = call i32 @om2ho(double* %9, double* %10, i32 %11)
store i32 %12, i32* %8
%13 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = call i32 @ho2cu(double* %13, double* %14, i32 %15)
store i32 %16, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @om2cu(double* %0, double* %1, i32 %2) {
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %4 to i8*
%6 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%7 = call i32 @om2ho(double* %0, double* %6, i32 %2)
%8 = call i32 @ho2cu(double* %6, double* %1, i32 %2)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void __error_exit(char *emsg) {
  fprintf(stderr, "%s", emsg);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @__error_exit(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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @__error_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ key;

/* Variables and functions */
int ini_find(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int ini_find_default(char *param) {
  char key[256];
  snprintf(key, (sizeof(key)), "%s:%s", "default", param);
  return ini_find(key);
}


x86 assembly (clang, -O0):
<ini_find_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    $0x100,%esi
lea    0xeba(%rip),%rdx
lea    0xeb9(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1040 <ini_find@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini_find_default>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%r8
lea    0xece(%rip),%rdx
lea    0xecd(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ini_find@plt>
add    $0x100,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s:%s\00"
@.str.1 = [8 x i8] c"default\00"
define i32 @ini_find_default(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 256, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = call i32 @ini_find(i8* %3)
ret i32 %5
}
int is_utf8_start(unsigned char c) { return c <= 0x7F || (c & 0xC0) != 0xC0; }


x86 assembly (clang, -O0):
<is_utf8_start>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7f,%ecx
mov    %al,-0x2(%rbp)
jle    1130 <is_utf8_start+0x30>
movzbl -0x1(%rbp),%eax
and    $0xc0,%eax
cmp    $0xc0,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_utf8_start>:
xor    %eax,%eax
cmp    $0xc0,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_utf8_start(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sle i32 %4, 127
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = and i32 %8, 192
%10 = icmp ne i32 %9, 192
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_utf8_start(i8 zeroext %0) {
%2 = icmp ult i8 %0, -64
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ binomDynamic(int, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  printf("%lu\n", binomDynamic(7, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
mov    $0x3,%esi
call   1030 <binomDynamic@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = tail call i32 @binomDynamic(i32 7, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ build_file_name(char *, char *, int);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int sstab_bld_name(char *sstab_name, char *tab_name, int tab_name_len,
                   int sstabid) {
  memset((void *)(sstab_name), 0, (size_t)(128));
  memcpy((void *)(sstab_name), (const void *)(tab_name),
         (size_t)(tab_name_len));
  build_file_name("sstable", sstab_name + tab_name_len, sstabid);
  return 1;
}


x86 assembly (clang, -O0):
<sstab_bld_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
mov    -0x18(%rbp),%edx
lea    0xe84(%rip),%rdi
call   1030 <build_file_name@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sstab_bld_name>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%rbx
mov    $0x80,%edx
xor    %esi,%esi
call   1040 <memset@plt>
movslq %ebp,%rbp
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   1050 <memcpy@plt>
add    %rbp,%rbx
lea    0xe97(%rip),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <build_file_name@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"sstable\00"
define i32 @sstab_bld_name(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = call i32 @memset(i8* %9, i32 0, i64 128)
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = call i32 @memcpy(i8* %11, i8* %12, i64 %14)
%16 = load i8*, i8** %5
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i32, i32* %8
%21 = call i32 @build_file_name(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %19, i32 %20)
ret i32 1
}

LLVM IR (-O2):
@.str = [8 x i8] c"sstable\00"
define i32 @sstab_bld_name(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @memset(i8* %0, i32 0, i64 128)
%6 = sext i32 %2 to i64
%7 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %6)
%8 = getelementptr inbounds i8, i8* %0, i64 %6
%9 = tail call i32 @build_file_name(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ copy(char *, char *);
int unlink(char *);
int move(char *source, char *dest) {
  if (!copy(source, dest))
    return 0;
  if ((unlink(source)) == -1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <copy@plt>
cmp    $0x0,%eax
jne    1152 <move+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1177 <move+0x57>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
jne    1170 <move+0x50>
movl   $0x0,-0x4(%rbp)
jmp    1177 <move+0x57>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move>:
push   %rbx
mov    %rdi,%rbx
call   1040 <copy@plt>
test   %eax,%eax
je     1141 <move+0x21>
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @move(i8* %0, i8* %1) {
%3 = tail call i32 @copy(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @unlink(i8* %0)
%7 = icmp ne i32 %6, -1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ entab(char *);
int /*<<< orphan*/ settabs(int, char **, char *);
int main(int argc, char *argv[]) {
  char tabstop[250 + 1];
  settabs(argc, argv, tabstop);
  entab(tabstop);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1030 <settabs@plt>
mov    %rbx,%rdi
call   1040 <entab@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [251 x i8]
%4 = getelementptr inbounds [251 x i8], [251 x i8]* %3, i64 0, i64 0
%5 = call i32 @settabs(i32 %0, i8** %1, i8* %4)
%6 = call i32 @entab(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void die(int code) {
  fprintf(stderr, "Err: %x\n", code);
  exit(-1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"Err: %x\0A\00"
define void @die(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"Err: %x\0A\00"
define void @die(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
void mpool_destroy() {}


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

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

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

LLVM IR (-O2):
define void @mpool_destroy() {
ret void
}
int test_2(int x, int n) {
  n &= 0x1f;
  x |= (0x01 << n);
  return x;
}


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

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

LLVM IR (-O0):
define i32 @test_2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 31
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_2(i32 %0, i32 %1) {
%3 = and i32 %1, 31
%4 = shl nuw i32 1, %3
%5 = or i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int function() {
  char *nick_name = "WeaponX";
  printf("What's your name %s?\n", nick_name);
  printf("What's your name %s?\n");
  return 0;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
push   %rbx
lea    0xef0(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"WeaponX\00"
@.str.1 = [22 x i8] c"What's your name %s?\0A\00"
define i32 @function() {
%1 = alloca i8*
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"WeaponX\00"
@.str.1 = [22 x i8] c"What's your name %s?\0A\00"
define i32 @function() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int main(int argc, char *argv[]) {
  int printf;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
float ps2_msec_to_sec(float ms) { return ms * 0.001f; }


x86 assembly (clang, -O0):
<ps2_msec_to_sec>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps2_msec_to_sec>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ps2_msec_to_sec(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3F50624DE0000000
ret float %4
}

LLVM IR (-O2):
define float @ps2_msec_to_sec(float %0) {
%2 = fmul float %0, 0x3F50624DE0000000
ret float %2
}
int do_600() { return 600; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x258,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x258,%eax
ret

LLVM IR (-O0):
define i32 @do_600() {
ret i32 600
}

LLVM IR (-O2):
define i32 @do_600() {
ret i32 600
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *shortdefname(const char *fullname) {
  const char *p;
  if (fullname == NULL) {
    return NULL;
  } else if ((p = strrchr(fullname, '.')) == NULL) {
    return fullname;
  } else {
    return p + 1;
  }
}


x86 assembly (clang, -O0):
<shortdefname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <shortdefname+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1169 <shortdefname+0x59>
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115d <shortdefname+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <shortdefname+0x59>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortdefname>:
test   %rdi,%rdi
je     1133 <shortdefname+0x23>
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,%rcx
add    $0x1,%rax
test   %rcx,%rcx
cmove  %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @shortdefname(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 46)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* %0, i8* %6
br label %8
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %7, %3 ]
ret i8* %9
}
int globusl_url_isscheme_special(char x) {
  if (x == ';' || x == '/' || x == '?' || x == ':' || x == '@' || x == '=' ||
      x == '&') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<globusl_url_isscheme_special>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x3b,%eax
je     1165 <globusl_url_isscheme_special+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     1165 <globusl_url_isscheme_special+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x3f,%eax
je     1165 <globusl_url_isscheme_special+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x3a,%eax
je     1165 <globusl_url_isscheme_special+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x40,%eax
je     1165 <globusl_url_isscheme_special+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x3d,%eax
je     1165 <globusl_url_isscheme_special+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x26,%eax
jne    1171 <globusl_url_isscheme_special+0x71>
movl   $0x1,-0x4(%rbp)
jmp    1178 <globusl_url_isscheme_special+0x78>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<globusl_url_isscheme_special>:
add    $0xda,%dil
cmp    $0x1a,%dil
ja     111f <globusl_url_isscheme_special+0x1f>
mov    $0x1,%eax
movzbl %dil,%ecx
mov    $0x6b00201,%edx
bt     %rcx,%rdx
jae    111f <globusl_url_isscheme_special+0x1f>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @globusl_url_isscheme_special(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 59
br i1 %6, label %31, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 47
br i1 %10, label %31, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 63
br i1 %14, label %31, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 58
br i1 %18, label %31, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 64
br i1 %22, label %31, label %23
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 61
br i1 %26, label %31, label %27
27: ; preds = %23
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 38
br i1 %30, label %31, label %32
31: ; preds = %27, %23, %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %33
32: ; preds = %27
store i32 0, i32* %2
br label %33
33: ; preds = %32, %31
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @globusl_url_isscheme_special(i8 signext %0) {
switch i8 %0, label %2 [
i8 64, label %3
i8 63, label %3
i8 61, label %3
i8 59, label %3
i8 58, label %3
i8 47, label %3
i8 38, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ set_to_3(int *const);
int /*<<< orphan*/ set_to_5(int **);
main() {
  int i;
  int *const p = &i;
  int **pp;
  pp = &p;
  *p = 5;
  set_to_3(p);
  set_to_5(pp);
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <set_to_3@plt>
mov    -0x18(%rbp),%rdi
call   1040 <set_to_5@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rdi
mov    %rdi,0x10(%rsp)
movl   $0x5,0xc(%rsp)
call   1030 <set_to_3@plt>
lea    0x10(%rsp),%rdi
call   1040 <set_to_5@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32** %2 to i8*
store i32* %1, i32** %2
store i32 5, i32* %1
%5 = call i32 @set_to_3(i32* %1)
%6 = call i32 @set_to_5(i32** %2)
%7 = load i32, i32* %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fdiv_preg64_qword(int reg64) {
  put8(0xDC);
  put8(0x30 + reg64);
}


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

x86 assembly (clang, -O2):
<fdiv_preg64_qword>:
push   %rbx
mov    %edi,%ebx
mov    $0xdc,%edi
call   1030 <put8@plt>
add    $0x30,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fdiv_preg64_qword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 220)
%4 = load i32, i32* %2
%5 = add nsw i32 48, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @fdiv_preg64_qword(i32 %0) {
%2 = tail call i32 @put8(i32 220)
%3 = add nsw i32 %0, 48
%4 = tail call i32 @put8(i32 %3)
ret void
}
return_42() { return 42; }


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

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

LLVM IR (-O0):
define i32 @return_42() {
ret i32 42
}

LLVM IR (-O2):
define i32 @return_42() {
ret i32 42
}
int dns_cache_pollfd(struct dns_cache *cache __attribute__((unused))) {
  return -1;
}


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

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

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

LLVM IR (-O2):
%struct.dns_cache = type opaque
define i32 @dns_cache_pollfd(%struct.dns_cache* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void *myalloc(size_t n) {
  void *p;
  p = malloc(n);
  if (p == NULL) {
    {
      fprintf(stderr, strerror(ENOMEM));
      puts("");
      exit(-1);
    };
  }
  return p;
}


x86 assembly (clang, -O0):
<myalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11af <myalloc+0x5f>
mov    0x2e5d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1070 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rsi
call   1040 <fprintf@plt>
lea    0xe60(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myalloc>:
push   %rbx
call   1050 <malloc@plt>
test   %rax,%rax
je     115d <myalloc+0xd>
pop    %rbx
ret
mov    0x2e74(%rip),%rax
mov    (%rax),%ebx
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1070 <strerror@plt>
mov    %ebx,%edi
mov    %rax,%rsi
call   1040 <fprintf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@ENOMEM = global i32 0
@.str = [1 x i8] zeroinitializer
define i8* @myalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* @ENOMEM
%11 = call i8* @strerror(i32 %10)
%12 = call i32 @fprintf(i32 %9, i8* %11)
%13 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@ENOMEM = global i32 0
define noalias i8* @myalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @ENOMEM
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* %7)
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int arch_intsize();
int /*<<< orphan*/ cgdefb(int /*<<< orphan*/);
int /*<<< orphan*/ gendata();
void genalign(int k) {
  gendata();
  while (k++ % arch_intsize())
    cgdefb(0);
}


x86 assembly (clang, -O0):
<genalign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gendata@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <arch_intsize@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1172 <genalign+0x42>
xor    %edi,%edi
call   1030 <cgdefb@plt>
jmp    1142 <genalign+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genalign>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <gendata@plt>
xor    %eax,%eax
call   1050 <arch_intsize@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     116c <genalign+0x3c>
add    $0x1,%ebx
nop
xor    %edi,%edi
call   1030 <cgdefb@plt>
xor    %eax,%eax
call   1050 <arch_intsize@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
add    $0x1,%ebx
test   %edx,%edx
jne    1150 <genalign+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @genalign(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gendata()
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = call i32 (...) @arch_intsize()
%8 = srem i32 %5, %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = call i32 @cgdefb(i32 0)
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @genalign(i32 %0) {
%2 = tail call i32 (...) @gendata()
%3 = tail call i32 (...) @arch_intsize()
%4 = srem i32 %0, %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %8, %6 ], [ %0, %1 ]
%8 = add nsw i32 %7, 1
%9 = tail call i32 @cgdefb(i32 0)
%10 = tail call i32 (...) @arch_intsize()
%11 = srem i32 %8, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void putnc(char *s, short len) {
  short i;
  for (i = 0; i < len; i++)
    putchar(s[i]);
  putchar(10);
}


x86 assembly (clang, -O0):
<putnc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xc(%rbp)
movswl -0xc(%rbp),%eax
movswl -0xa(%rbp),%ecx
cmp    %ecx,%eax
jge    115c <putnc+0x4c>
mov    -0x8(%rbp),%rax
movswq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xc(%rbp)
jmp    1129 <putnc+0x19>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putnc>:
push   %r15
push   %r14
push   %rbx
test   %si,%si
jle    1143 <putnc+0x33>
mov    %rdi,%r14
movzwl %si,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <putnc+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @putnc(i8* nocapture %0, i16 signext %1) {
%3 = icmp sgt i16 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i16 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
unsigned char hex(unsigned char val) {
  if (val < 10) {
    return '0' + val;
  } else {
    return 'a' + val - 10;
  }
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1126 <hex+0x26>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1133 <hex+0x33>
movzbl -0x2(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
cmp    $0xa,%dil
mov    $0x30,%ecx
mov    $0x57,%eax
cmovb  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @hex(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = add nsw i32 48, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %18
12: ; preds = %1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = add nsw i32 97, %14
%16 = sub nsw i32 %15, 10
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %18
18: ; preds = %12, %7
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @hex(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
%3 = select i1 %2, i8 48, i8 87
%4 = add i8 %3, %0
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ xml_read();
void glogbook_read(void) { xml_read(); }


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

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

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

LLVM IR (-O2):
define void @glogbook_read() {
%1 = tail call i32 (...) @xml_read()
ret void
}
/* Type definitions */
struct usb_endpoint_descriptor {
  int dummy;
};

/* Variables and functions */
scalar_t__ usb_endpoint_dir_in(struct usb_endpoint_descriptor const *);
scalar_t__ usb_endpoint_xfer_isoc(struct usb_endpoint_descriptor const *);
int usb_endpoint_is_isoc_in(const struct usb_endpoint_descriptor *epd) {
  return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd));
}


x86 assembly (clang, -O0):
<usb_endpoint_is_isoc_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <usb_endpoint_xfer_isoc@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115a <usb_endpoint_is_isoc_in+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <usb_endpoint_dir_in@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_endpoint_is_isoc_in>:
push   %rbx
mov    %rdi,%rbx
call   1030 <usb_endpoint_xfer_isoc@plt>
test   %rax,%rax
je     1143 <usb_endpoint_is_isoc_in+0x23>
mov    %rbx,%rdi
call   1040 <usb_endpoint_dir_in@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_isoc_in(%struct.usb_endpoint_descriptor* %0) {
%2 = alloca %struct.usb_endpoint_descriptor*
store %struct.usb_endpoint_descriptor* %0, %struct.usb_endpoint_descriptor** %2
%3 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%4 = call i64 @usb_endpoint_xfer_isoc(%struct.usb_endpoint_descriptor* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%8 = call i64 @usb_endpoint_dir_in(%struct.usb_endpoint_descriptor* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_isoc_in(%struct.usb_endpoint_descriptor* %0) {
%2 = tail call i64 @usb_endpoint_xfer_isoc(%struct.usb_endpoint_descriptor* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @usb_endpoint_dir_in(%struct.usb_endpoint_descriptor* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
void ffi_call_STDCALL(void) {}


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

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

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

LLVM IR (-O2):
define void @ffi_call_STDCALL() {
ret void
}