xunge/DecIR huggingface dataset:
void d2i_ASN1_PRINTABLESTRING(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_ASN1_PRINTABLESTRING() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ KDMKTONE;
int /*<<< orphan*/ LC_CTYPE;
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_CTYPE, "");
  int ch;
  int ms = 5000;
  int freq = 440;
  int fd = 0;
  ioctl(fd, KDMKTONE, (ms << 16 | 1193180 / freq));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1040 <setlocale@plt>
movl   $0x1388,-0xc(%rbp)
movl   $0x1b8,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2e75(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
mov    %eax,-0x18(%rbp)
mov    $0x1234dc,%eax
cltd
idivl  -0x10(%rbp)
mov    -0x18(%rbp),%edx
or     %eax,%edx
call   1030 <ioctl@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <setlocale@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    $0x13880a97,%edx
call   1030 <ioctl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_CTYPE = global i32 0
@.str = [1 x i8] zeroinitializer
@KDMKTONE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* @LC_CTYPE
%7 = call i32 @setlocale(i32 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 5000, i32* %3
store i32 440, i32* %4
store i32 0, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* @KDMKTONE
%10 = load i32, i32* %3
%11 = shl i32 %10, 16
%12 = load i32, i32* %4
%13 = sdiv i32 1193180, %12
%14 = or i32 %11, %13
%15 = call i32 @ioctl(i32 %8, i32 %9, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@LC_CTYPE = global i32 0
@.str = [1 x i8] zeroinitializer
@KDMKTONE = global i32 0
define i32 @main() {
%1 = load i32, i32* @LC_CTYPE
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @KDMKTONE
%4 = tail call i32 @ioctl(i32 0, i32 %3, i32 327682711)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_tend();
void htmd(void) { __builtin_tend(); }


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

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

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

LLVM IR (-O2):
define void @htmd() {
%1 = tail call i32 (...) @__builtin_tend()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ app_init();
int /*<<< orphan*/ app_run();
int main(void) {
  app_init();
  for (;;)
    app_run();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <app_init@plt>
mov    $0x0,%al
call   1040 <app_run@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <app_init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <app_run@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @app_init()
br label %3
3: ; preds = %3, %0
%4 = call i32 (...) @app_run()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @app_init()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @app_run()
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_self();
__attribute__((always_)) pthread_t eal_gettid() { return pthread_self(); }


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

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

LLVM IR (-O0):
define i32 @eal_gettid() {
%1 = call i32 (...) @pthread_self()
ret i32 %1
}

LLVM IR (-O2):
define i32 @eal_gettid() {
%1 = tail call i32 (...) @pthread_self()
ret i32 %1
}
void av_buffer_unref() {}


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

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

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

LLVM IR (-O2):
define void @av_buffer_unref() {
ret void
}
/* Variables and functions */
int nybble(char const);
unsigned char hex(const char *data) {
  return (nybble(data[0]) << 4) | nybble(data[1]);
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <nybble@plt>
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <nybble@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <nybble@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <nybble@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @hex(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i32 @nybble(i8 signext %5)
%7 = shl i32 %6, 4
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = call i32 @nybble(i8 signext %10)
%12 = or i32 %7, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @hex(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @nybble(i8 signext %2)
%4 = shl i32 %3, 4
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i32 @nybble(i8 signext %6)
%8 = or i32 %7, %4
%9 = trunc i32 %8 to i8
ret i8 %9
}
union U1 {
  int i;
  char j;
} f2() {
  ;
}


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

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

LLVM IR (-O0):
%union.U1 = type { i32 }
define i32 @f2() {
%1 = alloca %union.U1
%2 = getelementptr inbounds %union.U1, %union.U1* %1, i32 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @f2() {
ret i32 undef
}
int somelib(void) {
  int unused_var;
  return 33;
}


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

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

LLVM IR (-O0):
define i32 @somelib() {
%1 = alloca i32
ret i32 33
}

LLVM IR (-O2):
define i32 @somelib() {
ret i32 33
}
/* Variables and functions */
void *allocator_759E0635(size_t);
void *malloc(size_t size) { return allocator_759E0635(size); }


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

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

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

LLVM IR (-O2):
define i8* @malloc(i64 %0) {
%2 = tail call i8* @allocator_759E0635(i64 %0)
ret i8* %2
}
int pmi_simple_client_abort(struct pmi_simple_client *pmi, int exit_code,
                            const char *error_msg) {
  return -1;
}


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

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

LLVM IR (-O0):
%struct.pmi_simple_client = type opaque
define i32 @pmi_simple_client_abort(%struct.pmi_simple_client* %0, i32 %1, i8* %2) {
%4 = alloca %struct.pmi_simple_client*
%5 = alloca i32
%6 = alloca i8*
store %struct.pmi_simple_client* %0, %struct.pmi_simple_client** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.pmi_simple_client = type opaque
define i32 @pmi_simple_client_abort(%struct.pmi_simple_client* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
float tanf(float);
float IvTan(float a) { return tanf(a); }


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

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

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

LLVM IR (-O2):
define float @IvTan(float %0) {
%2 = tail call float @tanf(float %0)
ret float %2
}
int onWakeUp(const void *self) { return 10; }


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

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

LLVM IR (-O0):
define i32 @onWakeUp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 10
}

LLVM IR (-O2):
define i32 @onWakeUp(i8* nocapture readnone %0) {
ret i32 10
}
/* Variables and functions */
bool nrf52_errata_62(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_62() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, char const *);
void print_time(int flag, const char *message, float time) {
  if (flag)
    printf("%0.2f ms for %s\n", time, message);
}


x86 assembly (clang, -O0):
<print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <print_time+0x33>
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time>:
test   %edi,%edi
je     1120 <print_time+0x10>
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%0.2f ms for %s\0A\00"
define void @print_time(i32 %0, i8* %1, float %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca float
store i32 %0, i32* %4
store i8* %1, i8** %5
store float %2, float* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load float, float* %6
%11 = load i8*, i8** %5
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float %10, i8* %11)
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%0.2f ms for %s\0A\00"
define void @print_time(i32 %0, i8* %1, float %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float %2, i8* %1)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void perror_exit(char *s) {
  printf("Error: %s\n", s);
  exit(-1);
}


x86 assembly (clang, -O0):
<perror_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<perror_exit>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @perror_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @perror_exit(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
int second_fn(const int time_var, const char *from, const char *to) {
  printf("%s %i %li %li\n", __FUNCTION__, time_var, (long)from, (long)to);
  return generic_fn(time_var, (long)from, (long)to, 0, 60);
}


x86 assembly (clang, -O0):
<second_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xebb(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x3c,%r8d
mov    $0x0,%al
call   1030 <generic_fn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<second_fn>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
mov    $0x3c,%r8d
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <generic_fn@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s %i %li %li\0A\00"
@__FUNCTION__.second_fn = [10 x i8] c"second_fn\00"
define i32 @second_fn(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = load i8*, i8** %6
%11 = ptrtoint i8* %10 to i64
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.second_fn, i64 0, i64 0), i32 %7, i64 %9, i64 %11)
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
%16 = load i8*, i8** %6
%17 = ptrtoint i8* %16 to i64
%18 = call i32 (i32, i64, i64, i32, i32, ...) bitcast (i32 (...)* @generic_fn to i32 (i32, i64, i64, i32, i32, ...)*)(i32 %13, i64 %15, i64 %17, i32 0, i32 60)
ret i32 %18
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s %i %li %li\0A\00"
@__FUNCTION__.second_fn = [10 x i8] c"second_fn\00"
define i32 @second_fn(i32 %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %2 to i64
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.second_fn, i64 0, i64 0), i32 %0, i64 %4, i64 %5)
%7 = tail call i32 (i32, i64, i64, i32, i32, ...) bitcast (i32 (...)* @generic_fn to i32 (i32, i64, i64, i32, i32, ...)*)(i32 %0, i64 %4, i64 %5, i32 0, i32 60)
ret i32 %7
}
void foo211() {}


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

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

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

LLVM IR (-O2):
define void @foo211() {
ret void
}
int func(int a, int b) {
  static int c = 1;
  static int d = 2;
  c += a;
  d += b;
  return c + d;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    0x2f0d(%rip),%eax
mov    %eax,0x2f07(%rip)
mov    -0x8(%rbp),%eax
add    0x2f02(%rip),%eax
mov    %eax,0x2efc(%rip)
mov    0x2ef2(%rip),%eax
add    0x2ef0(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
add    0x2f1a(%rip),%edi
mov    %edi,0x2f14(%rip)
add    0x2f12(%rip),%esi
mov    %esi,0x2f0c(%rip)
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
@func.c = internal global i32 1
@func.d = internal global i32 2
define i32 @func(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* @func.c
%7 = add nsw i32 %6, %5
store i32 %7, i32* @func.c
%8 = load i32, i32* %4
%9 = load i32, i32* @func.d
%10 = add nsw i32 %9, %8
store i32 %10, i32* @func.d
%11 = load i32, i32* @func.c
%12 = load i32, i32* @func.d
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
@func.c = internal unnamed_addr global i32 1
@func.d = internal unnamed_addr global i32 2
define i32 @func(i32 %0, i32 %1) {
%3 = load i32, i32* @func.c
%4 = add nsw i32 %3, %0
store i32 %4, i32* @func.c
%5 = load i32, i32* @func.d
%6 = add nsw i32 %5, %1
store i32 %6, i32* @func.d
%7 = add nsw i32 %6, %4
ret i32 %7
}
int ioCanListPathOfSize(char *pathString, int pathStringLength) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ioCanListPathOfSize(i8* nocapture readnone %0, i32 %1) {
ret i32 1
}
OP(ed, b6) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_2()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
int isdirpunct(c)
int c;
{ return (c == '/'); }


x86 assembly (clang, -O0):
<isdirpunct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2f,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdirpunct>:
xor    %eax,%eax
cmp    $0x2f,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isdirpunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 47
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isdirpunct(i32 %0) {
%2 = icmp eq i32 %0, 47
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
long double __log1pl(long double x) {
  fputs("__log1pl not implemented\n", stderr);
  __set_errno(ENOSYS);
  return 0.0;
}


x86 assembly (clang, -O0):
<__log1pl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__log1pl>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
@.str = [26 x i8] c"__log1pl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__log1pl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
@.str = [26 x i8] c"__log1pl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__log1pl(x86_fp80 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret x86_fp80 0xK00000000000000000000
}
/* Variables and functions */
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
scalar_t__ waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *,
                   int /*<<< orphan*/);
void sig_chld(int sig) {
  while (waitpid(0, NULL, WNOHANG) > 0) {
    ;
  }
  signal(SIGCHLD, sig_chld);
}


x86 assembly (clang, -O0):
<sig_chld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <waitpid@plt>
cmp    $0x0,%rax
jle    114e <sig_chld+0x2e>
jmp    112b <sig_chld+0xb>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    0x2e72(%rip),%rsi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_chld>:
push   %rbx
mov    0x2ec0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <waitpid@plt>
test   %rax,%rax
jg     1130 <sig_chld+0x10>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    0x2e80(%rip),%rsi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@WNOHANG = global i32 0
@SIGCHLD = global i32 0
define void @sig_chld(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 0, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i32, i32* @SIGCHLD
%10 = call i32 @signal(i32 %9, void (i32)* @sig_chld)
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@SIGCHLD = global i32 0
define void @sig_chld(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 0, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = load i32, i32* @SIGCHLD
%8 = tail call i32 @signal(i32 %7, void (i32)* @sig_chld)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, char const *, ...);
void syntax(const char *op, const char *msg) {
  if (op && *op)
    error("%s: %s", op, msg);
  else
    error("%s", msg);
}


x86 assembly (clang, -O0):
<syntax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <syntax+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1156 <syntax+0x46>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
jmp    1168 <syntax+0x58>
mov    -0x10(%rbp),%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syntax>:
mov    %rsi,%rdx
test   %rdi,%rdi
je     112e <syntax+0x1e>
mov    %rdi,%rsi
cmpb   $0x0,(%rdi)
je     112e <syntax+0x1e>
lea    0xed9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <error@plt>
lea    0xecf(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
jmp    1030 <error@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
@.str.1 = [3 x i8] c"%s\00"
define void @syntax(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 (i8*, i8*, ...) @error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %11
9: ; preds = %4, %2
%10 = tail call i32 (i8*, i8*, ...) @error(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dskhead(int osvers, int osrel, int ossub) {
  printf("disk           busy read/s KB/read  "
         "writ/s KB/writ avque avserv _dsk_");
}


x86 assembly (clang, -O0):
<dskhead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [70 x i8] c"disk busy read/s KB/read writ/s KB/writ avque avserv _dsk_\00"
define void @dskhead(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 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"disk busy read/s KB/read writ/s KB/writ avque avserv _dsk_\00"
define void @dskhead(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint_fast32_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t softfloat_shiftRightJam64(uint64_t a, uint_fast32_t count) {
  return (count < 63) ? a >> count | ((uint64_t)(a << (-count & 63)) != 0)
                      : (a != 0);
}


x86 assembly (clang, -O0):
<softfloat_shiftRightJam64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x3f,-0x8(%rbp)
jge    1141 <softfloat_shiftRightJam64+0x41>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x3f,%ecx
shl    %cl,%edx
mov    %edx,%ecx
cmp    $0x0,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <softfloat_shiftRightJam64+0x50>
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<softfloat_shiftRightJam64>:
cmp    $0x3e,%esi
jg     1119 <softfloat_shiftRightJam64+0x19>
mov    %esi,%ecx
mov    %edi,%edx
sar    %cl,%edx
neg    %cl
shl    %cl,%edi
xor    %eax,%eax
test   %edi,%edi
setne  %al
or     %edx,%eax
ret
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @softfloat_shiftRightJam64(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 = icmp slt i32 %5, 63
br i1 %6, label %7, label %19
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = ashr i32 %8, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sub nsw i32 0, %12
%14 = and i32 %13, 63
%15 = shl i32 %11, %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
%18 = or i32 %10, %17
br label %23
19: ; preds = %2
%20 = load i32, i32* %3
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %19, %7
%24 = phi i32 [ %18, %7 ], [ %22, %19 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @softfloat_shiftRightJam64(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 63
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = ashr i32 %0, %1
%6 = sub nsw i32 0, %1
%7 = and i32 %6, 63
%8 = shl i32 %0, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
%11 = or i32 %5, %10
br label %15
12: ; preds = %2
%13 = icmp ne i32 %0, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %12, %4
%16 = phi i32 [ %11, %4 ], [ %14, %12 ]
ret i32 %16
}
/* Variables and functions */
int asm_close(int);
int __attribute__((section("libgloss_epiphany"))) _close(int fildes) {
  return asm_close(fildes);
}


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

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

LLVM IR (-O0):
define i32 @_close(i32 %0) section "libgloss_epiphany" {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @asm_close(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @_close(i32 %0) section "libgloss_epiphany" {
%2 = tail call i32 @asm_close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ error_msg_and_die(char *);
int /*<<< orphan*/ exit(int);
void die_out_of_memory(void) {
  static int recursed;
  if (recursed)
    exit(1);
  recursed = 1;
  error_msg_and_die("Out of memory");
}


x86 assembly (clang, -O0):
<die_out_of_memory>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f09(%rip)
je     113b <die_out_of_memory+0x1b>
mov    $0x1,%edi
call   1040 <exit@plt>
movl   $0x1,0x2eef(%rip)
lea    0xeb4(%rip),%rdi
call   1030 <error_msg_and_die@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<die_out_of_memory>:
push   %rax
cmpb   $0x1,0x2f0c(%rip)
je     113e <die_out_of_memory+0x1e>
movb   $0x1,0x2f03(%rip)
lea    0xec8(%rip),%rdi
pop    %rax
jmp    1030 <error_msg_and_die@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@die_out_of_memory.recursed = internal global i32 0
@.str = [14 x i8] c"Out of memory\00"
define void @die_out_of_memory() {
%1 = load i32, i32* @die_out_of_memory.recursed
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @exit(i32 1)
unreachable
5: ; preds = %0
store i32 1, i32* @die_out_of_memory.recursed
%6 = call i32 @error_msg_and_die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@die_out_of_memory.recursed = internal unnamed_addr global i1 false
@.str = [14 x i8] c"Out of memory\00"
define void @die_out_of_memory() {
%1 = load i1, i1* @die_out_of_memory.recursed
br i1 %1, label %2, label %4
2: ; preds = %0
%3 = tail call i32 @exit(i32 1)
unreachable
4: ; preds = %0
store i1 true, i1* @die_out_of_memory.recursed
%5 = tail call i32 @error_msg_and_die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int lenchars_file(char *);
scalar_t__ readchars_file(char *, int /*<<< orphan*/, int *);
short *readsignal_file(char *fn, int *N) {
  int nbytes = lenchars_file(fn);
  *N = nbytes / sizeof(short);
  short *data = (short *)readchars_file(fn, 0, &nbytes);
  return data;
}


x86 assembly (clang, -O0):
<readsignal_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <lenchars_file@plt>
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shr    $0x1,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
lea    -0x14(%rbp),%rdx
call   1030 <readchars_file@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readsignal_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <lenchars_file@plt>
mov    %eax,0x4(%rsp)
sar    %eax
mov    %eax,(%r14)
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <readchars_file@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i16* @readsignal_file(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i16*
store i8* %0, i8** %3
store i32* %1, i32** %4
%7 = load i8*, i8** %3
%8 = call i32 @lenchars_file(i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = udiv i64 %10, 2
%12 = trunc i64 %11 to i32
%13 = load i32*, i32** %4
store i32 %12, i32* %13
%14 = load i8*, i8** %3
%15 = call i64 @readchars_file(i8* %14, i32 0, i32* %5)
%16 = inttoptr i64 %15 to i16*
store i16* %16, i16** %6
%17 = load i16*, i16** %6
ret i16* %17
}

LLVM IR (-O2):
define i16* @readsignal_file(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @lenchars_file(i8* %0)
store i32 %5, i32* %3
%6 = ashr i32 %5, 1
store i32 %6, i32* %1
%7 = call i64 @readchars_file(i8* %0, i32 0, i32* %3)
%8 = inttoptr i64 %7 to i16*
ret i16* %8
}
void qt_error(void) {
  extern void abort(void);
  abort();
}


x86 assembly (clang, -O0):
<qt_error>:
push   %rbp
mov    %rsp,%rbp
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<qt_error>:
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @qt_error() {
unreachable
}

LLVM IR (-O2):
define void @qt_error() {
tail call void @abort()
unreachable
}
/* Variables and functions */
char *jsonTopoAddDevice(char *, char *, char *, int /*<<< orphan*/ *, int);
char *jsonTopoAddPump(char *mac, char *name, int sid) {
  return (jsonTopoAddDevice("pmp", mac, name, NULL, sid));
}


x86 assembly (clang, -O0):
<jsonTopoAddPump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%r8d
lea    0xeca(%rip),%rdi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <jsonTopoAddDevice@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonTopoAddPump>:
mov    %edx,%r8d
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
xor    %ecx,%ecx
jmp    1030 <jsonTopoAddDevice@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"pmp\00"
define i8* @jsonTopoAddPump(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i8* @jsonTopoAddDevice(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32* null, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"pmp\00"
define i8* @jsonTopoAddPump(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @jsonTopoAddDevice(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32* null, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ vga_tx(int /*<<< orphan*/);
void vga_str(char *str) {
  while (*str)
    vga_tx(*str++);
}


x86 assembly (clang, -O0):
<vga_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <vga_str+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <vga_tx@plt>
jmp    111c <vga_str+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <vga_str+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <vga_tx@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <vga_str+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @vga_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @vga_tx(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
unsigned long atol(char *);
int /*<<< orphan*/ factorial(unsigned long);
int main(int argc, char *argv[]) {
  unsigned long input = atol(argv[1]);
  factorial(input);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atol@plt>
mov    %rax,%rdi
call   1030 <factorial@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**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i64 @atol(i8* %9)
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = call i32 @factorial(i64 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @atol(i8* %4)
%6 = tail call i32 @factorial(i64 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ adjust_max_heap(int *, int, int);
void build_max_heap(int *datas, int length) {
  int i;
  for (i = length / 2; i > 0; i--)
    adjust_max_heap(datas, length, i);
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1154 <build_max_heap+0x44>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <adjust_max_heap@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <build_max_heap+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1146 <build_max_heap+0x36>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <adjust_max_heap@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %5, %4 ]
%8 = tail call i32 @adjust_max_heap(i32* %0, i32 %1, i32 %7)
%9 = add nsw i32 %7, -1
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
int sigmask(int n) { return 1 << ((n)-1); }


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

x86 assembly (clang, -O2):
<sigmask>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @sigmask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = shl i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @sigmask(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = shl nuw i32 1, %2
ret i32 %3
}
int main(int argc, const char *argv[]) { return 42; }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x2a,%eax
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
ret i32 42
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int (*)());
int /*<<< orphan*/ write(int, char *, int);
handler() {
  write(1, "Heb um gevangen\n", 16);
  signal(SIGINT, handler);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xecc(%rip),%rsi
mov    $0x10,%edx
call   1030 <write@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    0x2e92(%rip),%rsi
call   1040 <signal@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0x10,%edx
call   1030 <write@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rsi
pop    %rax
jmp    1040 <signal@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Heb um gevangen\0A\00"
@SIGINT = global i32 0
define i32 @handler() {
%1 = alloca i32
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 16)
%3 = load i32, i32* @SIGINT
%4 = call i32 @signal(i32 %3, i32 (...)* bitcast (i32 ()* @handler to i32 (...)*))
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [17 x i8] c"Heb um gevangen\0A\00"
@SIGINT = global i32 0
define i32 @handler() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 16)
%2 = load i32, i32* @SIGINT
%3 = tail call i32 @signal(i32 %2, i32 (...)* bitcast (i32 ()* @handler to i32 (...)*))
ret i32 undef
}
double *returner(int *const *i, double *d) {
  (void)(i);
  return d;
}


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

x86 assembly (clang, -O2):
<returner>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define double* @returner(i32** nocapture readnone %0, double* readnone returned %1) {
ret double* %1
}
/* Variables and functions */
scalar_t__ ExecCfg(char *, int /*<<< orphan*/);
int /*<<< orphan*/ LoadConf();
long sockOpen() {
  if (ExecCfg("open", 0) == 0)
    return -1;
  LoadConf();
  return 0;
}


x86 assembly (clang, -O0):
<sockOpen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
xor    %esi,%esi
call   1030 <ExecCfg@plt>
cmp    $0x0,%rax
jne    114d <sockOpen+0x2d>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    115c <sockOpen+0x3c>
mov    $0x0,%al
call   1040 <LoadConf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockOpen>:
push   %rbx
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1030 <ExecCfg@plt>
test   %rax,%rax
je     113f <sockOpen+0x1f>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <LoadConf@plt>
jmp    1146 <sockOpen+0x26>
mov    $0xffffffffffffffff,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"open\00"
define i64 @sockOpen() {
%1 = alloca i64
%2 = call i64 @ExecCfg(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i64 -1, i64* %1
br label %7
5: ; preds = %0
%6 = call i32 (...) @LoadConf()
store i64 0, i64* %1
br label %7
7: ; preds = %5, %4
%8 = load i64, i64* %1
ret i64 %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"open\00"
define i64 @sockOpen() {
%1 = tail call i64 @ExecCfg(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @LoadConf()
br label %5
5: ; preds = %0, %3
%6 = phi i64 [ 0, %3 ], [ -1, %0 ]
ret i64 %6
}
/* Variables and functions */
char *smalloc(size_t);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
char *strappend(char *s1, char *s2) {
  size_t s1_len;
  size_t total_size;
  char *r;
  s1_len = strlen(s1);
  total_size = s1_len + strlen(s2) + 1;
  r = smalloc(total_size);
  strcpy(r, s1);
  strcpy(r + s1_len, s2);
  return r;
}


x86 assembly (clang, -O0):
<strappend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <smalloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
add    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strappend>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <smalloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    %r12,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strappend(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = load i8*, i8** %4
%12 = call i64 @strlen(i8* %11)
%13 = add i64 %10, %12
%14 = add i64 %13, 1
store i64 %14, i64* %6
%15 = load i64, i64* %6
%16 = call i8* @smalloc(i64 %15)
store i8* %16, i8** %7
%17 = load i8*, i8** %7
%18 = load i8*, i8** %3
%19 = call i32 @strcpy(i8* %17, i8* %18)
%20 = load i8*, i8** %7
%21 = load i64, i64* %5
%22 = getelementptr inbounds i8, i8* %20, i64 %21
%23 = load i8*, i8** %4
%24 = call i32 @strcpy(i8* %22, i8* %23)
%25 = load i8*, i8** %7
ret i8* %25
}

LLVM IR (-O2):
define i8* @strappend(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @smalloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = getelementptr inbounds i8, i8* %7, i64 %3
%10 = tail call i32 @strcpy(i8* %9, i8* %1)
ret i8* %7
}