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

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *_vf_time_now(void) {
  time_t tyme;
  char *str;
  tyme = time(NULL);
  str = ctime(&tyme);
  str[strlen(str) - 1] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<_vf_time_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_vf_time_now>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_vf_time_now() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 0, i8* %10
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @_vf_time_now() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8 0, i8* %8
ret i8* %4
}
/* Variables and functions */
char *getenv(char *);
char *get_shell() {
  char *shell = getenv("SHELL");
  return shell ? shell : "/bin/sh";
}


x86 assembly (clang, -O0):
<get_shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <get_shell+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1150 <get_shell+0x40>
lea    0xebf(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1150 <get_shell+0x40>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_shell>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xedf(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"SHELL\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define i8* @get_shell() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i8*, i8** %1
br label %8
7: ; preds = %0
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"SHELL\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
define i8* @get_shell() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) { return islower(c) ? 'A' + (c - 'a') : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113e <toupper+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <toupper+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 97
%9 = add nsw i32 65, %8
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t
hci_event_encryption_change_get_connection_handle(const uint8_t *event) {
  return little_endian_read_16(event, 3);
}


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

x86 assembly (clang, -O2):
<hci_event_encryption_change_get_connection_handle>:
mov    $0x3,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @hci_event_encryption_change_get_connection_handle(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _cleanup();
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
halt() {
  _cleanup();
  _exit(0);
}


x86 assembly (clang, -O0):
<halt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <_cleanup@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<halt>:
push   %rax
xor    %eax,%eax
call   1040 <_cleanup@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @halt() {
%1 = call i32 (...) @_cleanup()
%2 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @halt() {
%1 = tail call i32 (...) @_cleanup()
%2 = tail call i32 @_exit(i32 0)
unreachable
}
/* Type definitions */
struct buddyinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ proc_buddyinfo_free(struct buddyinfo *);
void buddyinfo_freep(struct buddyinfo **bi) { proc_buddyinfo_free(*bi); }


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

x86 assembly (clang, -O2):
<buddyinfo_freep>:
mov    (%rdi),%rdi
jmp    1030 <proc_buddyinfo_free@plt>

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

LLVM IR (-O2):
%struct.buddyinfo = type { i32 }
define void @buddyinfo_freep(%struct.buddyinfo** nocapture %0) {
%2 = load %struct.buddyinfo*, %struct.buddyinfo** %0
%3 = tail call i32 @proc_buddyinfo_free(%struct.buddyinfo* %2)
ret void
}
/* Variables and functions */
char *hello();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("[message from rust lib]\n%s\n\n", hello());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <hello@plt>
mov    %rax,%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"[message from rust lib]\0A%s\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i8* (...) @hello()
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"[message from rust lib]\0A%s\0A\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @hello()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
float inch_to_mm(float value) { return value * 25.4f; }


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

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

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

LLVM IR (-O2):
define float @inch_to_mm(float %0) {
%2 = fmul float %0, 0x4039666660000000
ret float %2
}
/* Type definitions */
struct swbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ swbuf_free(int /*<<< orphan*/);
int /*<<< orphan*/ swbuf_lead(struct swbuf *);
void swbuf_deinit(struct swbuf *b) { swbuf_free(swbuf_lead(b)); }


x86 assembly (clang, -O0):
<swbuf_deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <swbuf_lead@plt>
mov    %eax,%edi
call   1030 <swbuf_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swbuf_deinit>:
push   %rax
call   1040 <swbuf_lead@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <swbuf_free@plt>

LLVM IR (-O0):
%struct.swbuf = type { i32 }
define void @swbuf_deinit(%struct.swbuf* %0) {
%2 = alloca %struct.swbuf*
store %struct.swbuf* %0, %struct.swbuf** %2
%3 = load %struct.swbuf*, %struct.swbuf** %2
%4 = call i32 @swbuf_lead(%struct.swbuf* %3)
%5 = call i32 @swbuf_free(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.swbuf = type { i32 }
define void @swbuf_deinit(%struct.swbuf* %0) {
%2 = tail call i32 @swbuf_lead(%struct.swbuf* %0)
%3 = tail call i32 @swbuf_free(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, int /*<<< orphan*/ const *, int);
unsigned _wyr32(const uint8_t *p) {
  unsigned v;
  memcpy(&v, p, 4);
  return v;
}


x86 assembly (clang, -O0):
<_wyr32>:
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),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_wyr32(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i32* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ dissector_init_ethernet(int);
void dissector_init_all(int fnttype) { dissector_init_ethernet(fnttype); }


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

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

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

LLVM IR (-O2):
define void @dissector_init_all(i32 %0) {
%2 = tail call i32 @dissector_init_ethernet(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_madd_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test49(__m64 a, __m64 b) { return _mm_madd_pi16(a, b); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ len_squared_negated_vnvn(double const *, double const *,
                                            int /*<<< orphan*/ const);
double sqrt(int /*<<< orphan*/);
double len_negated_vnvn(const double v0[], const double v1[], const uint dims) {
  return sqrt(len_squared_negated_vnvn(v0, v1, dims));
}


x86 assembly (clang, -O0):
<len_negated_vnvn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <len_squared_negated_vnvn@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<len_negated_vnvn>:
push   %rax
call   1030 <len_squared_negated_vnvn@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @len_negated_vnvn(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load i32, i32* %6
%10 = call i32 @len_squared_negated_vnvn(double* %7, double* %8, i32 %9)
%11 = call double @sqrt(i32 %10)
ret double %11
}

LLVM IR (-O2):
define double @len_negated_vnvn(double* %0, double* %1, i32 %2) {
%4 = tail call i32 @len_squared_negated_vnvn(double* %0, double* %1, i32 %2)
%5 = tail call double @sqrt(i32 %4)
ret double %5
}
int cmd_protect(int argc, char **argv) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cmd_protect(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct fastbuf {
  int dummy;
};

/* Variables and functions */
int bget_utf8_repl(struct fastbuf *, int);
int bget_utf8(struct fastbuf *b) { return bget_utf8_repl(b, 0xfffc); }


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

x86 assembly (clang, -O2):
<bget_utf8>:
mov    $0xfffc,%esi
jmp    1030 <bget_utf8_repl@plt>

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

LLVM IR (-O2):
%struct.fastbuf = type { i32 }
define i32 @bget_utf8(%struct.fastbuf* %0) {
%2 = tail call i32 @bget_utf8_repl(%struct.fastbuf* %0, i32 65532)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ error(char *);
void fail(char *err) {
  error(err);
  abort();
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <error@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
call   1040 <error@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i8* %3)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @fail(i8* %0) {
%2 = tail call i32 @error(i8* %0)
%3 = tail call i32 (...) @abort()
unreachable
}
float complement(float x) { return 1 - x; }


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

x86 assembly (clang, -O2):
<complement>:
movss  0xef8(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @complement(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float 1.000000e+00, %3
ret float %4
}

LLVM IR (-O2):
define float @complement(float %0) {
%2 = fsub float 1.000000e+00, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ change_owner(char *, char *, char *);
int check_file(char *);
int /*<<< orphan*/ move_file(char *, char *);
void handle_login() {
  if (check_file("/tmp/new_login") != -1) {
    move_file("/tmp/new_login", "/usr/application/lighttpd_login");
    change_owner("/usr/application/lighttpd_login", "www-data", "www-data");
  }
}


x86 assembly (clang, -O0):
<handle_login>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <check_file@plt>
cmp    $0xffffffff,%eax
je     1172 <handle_login+0x42>
lea    0xeb0(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <move_file@plt>
lea    0xeac(%rip),%rdi
lea    0xec5(%rip),%rdx
mov    %rdx,%rsi
call   1040 <change_owner@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_login>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <check_file@plt>
cmp    $0xffffffff,%eax
je     116b <handle_login+0x3b>
lea    0xeb7(%rip),%rdi
lea    0xebf(%rip),%rbx
mov    %rbx,%rsi
call   1030 <move_file@plt>
lea    0xed0(%rip),%rdx
mov    %rbx,%rdi
mov    %rdx,%rsi
pop    %rbx
jmp    1040 <change_owner@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/tmp/new_login\00"
@.str.1 = [32 x i8] c"/usr/application/lighttpd_login\00"
@.str.2 = [9 x i8] c"www-data\00"
define void @handle_login() {
%1 = call i32 @check_file(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @move_file(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @change_owner(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"/tmp/new_login\00"
@.str.1 = [32 x i8] c"/usr/application/lighttpd_login\00"
@.str.2 = [9 x i8] c"www-data\00"
define void @handle_login() {
%1 = tail call i32 @check_file(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @move_file(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @change_owner(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %3, %0
ret void
}
void XtHooksOfDisplay() {}


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

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

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

LLVM IR (-O2):
define void @XtHooksOfDisplay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char *);
int main(void) {
  char *str;
  str = "Hello World!";
  ft_putstr(str);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <ft_putstr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ft_putstr(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int strtoul(char const *, int /*<<< orphan*/, int);
unsigned cstring_to_uint(const char *s, int base) {
  return (s != 0) ? strtoul(s, 0, base) : 0;
}


x86 assembly (clang, -O0):
<cstring_to_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <cstring_to_uint+0x30>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <strtoul@plt>
mov    %eax,-0x10(%rbp)
jmp    114a <cstring_to_uint+0x3a>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <cstring_to_uint+0x3a>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstring_to_uint>:
test   %rdi,%rdi
je     111e <cstring_to_uint+0xe>
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <strtoul@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @cstring_to_uint(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @strtoul(i8* %8, i32 0, i32 %9)
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %7
%13 = phi i32 [ %10, %7 ], [ 0, %11 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @cstring_to_uint(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @strtoul(i8* %0, i32 0, i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
scalar_t__ is_lower(int);
int ft_toupper(int c) {
  if (is_lower(c))
    return (c - 32);
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <is_lower@plt>
cmp    $0x0,%rax
je     113b <ft_toupper+0x2b>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <ft_toupper+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_lower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = tail call i64 @is_lower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int ntohs(unsigned short);
int select_packet(void *workspace, unsigned char *packet, int id1, int id2,
                  int id3, int id4) {
  int pkid;
  pkid = ntohs(*(unsigned short *)packet);
  if (pkid == id1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<select_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movzwl (%rax),%edi
call   1030 <ntohs@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1155 <select_packet+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115c <select_packet+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_packet>:
push   %rbx
mov    %edx,%ebx
movzwl (%rsi),%edi
call   1030 <ntohs@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @select_packet(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %8
store i8* %1, i8** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%15 = load i8*, i8** %9
%16 = bitcast i8* %15 to i16*
%17 = load i16, i16* %16
%18 = call i32 @ntohs(i16 zeroext %17)
store i32 %18, i32* %14
%19 = load i32, i32* %14
%20 = load i32, i32* %10
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %6
store i32 1, i32* %7
br label %24
23: ; preds = %6
store i32 0, i32* %7
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @select_packet(i8* nocapture readnone %0, i8* nocapture %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = bitcast i8* %1 to i16*
%8 = load i16, i16* %7
%9 = tail call i32 @ntohs(i16 zeroext %8)
%10 = icmp eq i32 %9, %2
%11 = zext i1 %10 to i32
ret i32 %11
}
void dv2_sub(double *a, double *b) {
  a[0] -= b[0];
  a[1] -= b[1];
}


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

x86 assembly (clang, -O2):
<dv2_sub>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
subsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
subsd  0x8(%rsi),%xmm1
movsd  %xmm1,0x8(%rdi)
ret

LLVM IR (-O0):
define void @dv2_sub(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fsub double %10, %7
store double %11, double* %9
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fsub double %17, %14
store double %18, double* %16
ret void
}

LLVM IR (-O2):
define void @dv2_sub(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = fsub double %4, %3
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fsub double %9, %7
store double %10, double* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aliConvTests();
int main() { aliConvTests(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @aliConvTests()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @aliConvTests()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int);
int /*<<< orphan*/ output_byte(int);
int /*<<< orphan*/ output_modrm(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fldcw(int addr) {
  assem_debug("fldcw %x", addr);
  output_byte(0xd9);
  output_modrm(0, 5, 5);
  output_w32(addr);
}


x86 assembly (clang, -O0):
<emit_fldcw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xd9,%edi
call   1050 <output_byte@plt>
xor    %edi,%edi
mov    $0x5,%edx
mov    %edx,%esi
call   1060 <output_modrm@plt>
mov    -0x4(%rbp),%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fldcw>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
call   1030 <assem_debug@plt>
mov    $0xd9,%edi
call   1050 <output_byte@plt>
xor    %edi,%edi
mov    $0x5,%esi
mov    $0x5,%edx
call   1060 <output_modrm@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"fldcw %x\00"
define void @emit_fldcw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @assem_debug(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @output_byte(i32 217)
%6 = call i32 @output_modrm(i32 0, i32 5, i32 5)
%7 = load i32, i32* %2
%8 = call i32 @output_w32(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"fldcw %x\00"
define void @emit_fldcw(i32 %0) {
%2 = tail call i32 @assem_debug(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @output_byte(i32 217)
%4 = tail call i32 @output_modrm(i32 0, i32 5, i32 5)
%5 = tail call i32 @output_w32(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ floor(double);
int commFloor_D(double x) { return (int)floor(x); }


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

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

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

LLVM IR (-O2):
define i32 @commFloor_D(double %0) {
%2 = tail call i64 @floor(double %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uintmax_t;
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  if (sizeof(uintmax_t) < sizeof(key_t)) {
    printf("#error uintmax smaller than key_t. "
           "Sizes: %u and %u\n",
           sizeof(uintmax_t), sizeof(key_t));
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int fs_file_exists(char *);
int _fexists(char *path) { return fs_file_exists(path); }


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

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

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

LLVM IR (-O2):
define i32 @_fexists(i8* %0) {
%2 = tail call i32 @fs_file_exists(i8* %0)
ret i32 %2
}
float vec4_dot(float *a, float *b) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
}


x86 assembly (clang, -O0):
<vec4_dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4_dot>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm2
mulss  0x8(%rsi),%xmm2
addss  %xmm1,%xmm2
movss  0xc(%rdi),%xmm0
mulss  0xc(%rsi),%xmm0
addss  %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define float @vec4_dot(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
%16 = getelementptr inbounds float, float* %0, i64 3
%17 = load float, float* %16
%18 = getelementptr inbounds float, float* %1, i64 3
%19 = load float, float* %18
%20 = tail call float @llvm.fmuladd.f32(float %17, float %19, float %15)
ret float %20
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
size_t strxfrm(char *, char const *, size_t);
size_t strxfrm_l(char *dest, const char *src, size_t n, locale_t l) {
  return strxfrm(dest, src, n);
}


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

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

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

LLVM IR (-O2):
define i64 @strxfrm_l(i8* nocapture %0, i8* nocapture %1, i64 %2, i32 %3) {
%5 = tail call i64 @strxfrm(i8* %0, i8* %1, i64 %2)
ret i64 %5
}
char v_char_func() { return (0); }


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

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

LLVM IR (-O0):
define signext i8 @v_char_func() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @v_char_func() {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void print_html_head(char *descr, char *title) {
  printf("	<!doctype html>\n	<html lang='de'>\n	"
         "<head>\n	<meta charset='utf-8'>\n	<meta name='viewport' "
         "content='width=device-width, initial-scale=1.0'>\n	<meta "
         "name='description' content='%s'>\n	<meta "
         "http-equiv='Cache-Control' content='no-cache, no-store, "
         "must-revalidate' />\n	<meta http-equiv='Pragma' content='no-cache' "
         "/>\n	<meta http-equiv='Expires' content='0' />\n	<link "
         "rel='stylesheet' href='/css/forms.css'>\n	<link rel='shortcut "
         "icon' href='/favicon.png' />\n	<title>InfoWall -- "
         "%s</title>\n	</head>\n",
         descr, title);
}


x86 assembly (clang, -O0):
<print_html_head>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_html_head>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [492 x i8] c"\09<!doctype html>\0A\09<html lang='de'>\0A\09<head>\0A\09<meta charset='utf-8'>\0A\09<meta name='viewport' content='width=device-width, initial-scale=1.0'>\0A\09<meta name='description' content='%s'>\0A\09<meta http-equiv='Cache-Control' content='no-cache, no-store, must-revalidate' />\0A\09<meta http-equiv='Pragma' content='no-cache' />\0A\09<meta http-equiv='Expires' content='0' />\0A\09<link rel='stylesheet' href='/css/forms.css'>\0A\09<link rel='shortcut icon' href='/favicon.png' />\0A\09<title>InfoWall -- %s</title>\0A\09</head>\0A\00"
define void @print_html_head(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([492 x i8], [492 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [492 x i8] c"\09<!doctype html>\0A\09<html lang='de'>\0A\09<head>\0A\09<meta charset='utf-8'>\0A\09<meta name='viewport' content='width=device-width, initial-scale=1.0'>\0A\09<meta name='description' content='%s'>\0A\09<meta http-equiv='Cache-Control' content='no-cache, no-store, must-revalidate' />\0A\09<meta http-equiv='Pragma' content='no-cache' />\0A\09<meta http-equiv='Expires' content='0' />\0A\09<link rel='stylesheet' href='/css/forms.css'>\0A\09<link rel='shortcut icon' href='/favicon.png' />\0A\09<title>InfoWall -- %s</title>\0A\09</head>\0A\00"
define void @print_html_head(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([492 x i8], [492 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
extern unsigned unsigned_to_unsigned(int x, int k) { return x + k; }


x86 assembly (clang, -O0):
<unsigned_to_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_to_unsigned>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @unsigned_to_unsigned(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void noop(int btnIdx) {}


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

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

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

LLVM IR (-O2):
define void @noop(i32 %0) {
ret void
}
const char *CONSIST_STAT(int s) {
  return ((s & (0x08 | 0x40)) == (0x08 | 0x40))
             ? "mid cons."
             : (((s & (0x08 | 0x40)) == 0x08)
                    ? "top cons."
                    : (((s & (0x08 | 0x40)) == 0x40) ? "sub cons."
                                                     : "Not Consisted"));
}


x86 assembly (clang, -O0):
<CONSIST_STAT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x48,%eax
cmp    $0x48,%eax
jne    1126 <CONSIST_STAT+0x26>
lea    0xee3(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    116c <CONSIST_STAT+0x6c>
mov    -0x4(%rbp),%eax
and    $0x48,%eax
cmp    $0x8,%eax
jne    1145 <CONSIST_STAT+0x45>
lea    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1164 <CONSIST_STAT+0x64>
mov    -0x4(%rbp),%edx
and    $0x48,%edx
lea    0xecc(%rip),%rax
lea    0xebb(%rip),%rcx
cmp    $0x40,%edx
cmove  %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CONSIST_STAT>:
and    $0x48,%edi
cmp    $0x8,%edi
je     1115 <CONSIST_STAT+0x15>
cmp    $0x48,%edi
jne    111d <CONSIST_STAT+0x1d>
lea    0xeec(%rip),%rax
ret
lea    0xeee(%rip),%rax
ret
cmp    $0x40,%edi
lea    0xeed(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"mid cons.\00"
@.str.1 = [10 x i8] c"top cons.\00"
@.str.2 = [10 x i8] c"sub cons.\00"
@.str.3 = [14 x i8] c"Not Consisted\00"
define i8* @CONSIST_STAT(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 72
%5 = icmp eq i32 %4, 72
br i1 %5, label %6, label %7
6: ; preds = %1
br label %20
7: ; preds = %1
%8 = load i32, i32* %2
%9 = and i32 %8, 72
%10 = icmp eq i32 %9, 8
br i1 %10, label %11, label %12
11: ; preds = %7
br label %18
12: ; preds = %7
%13 = load i32, i32* %2
%14 = and i32 %13, 72
%15 = icmp eq i32 %14, 64
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0)
br label %18
18: ; preds = %12, %11
%19 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), %11 ], [ %17, %12 ]
br label %20
20: ; preds = %18, %6
%21 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %6 ], [ %19, %18 ]
ret i8* %21
}

LLVM IR (-O2):
@.str = [10 x i8] c"mid cons.\00"
@.str.1 = [10 x i8] c"top cons.\00"
@.str.2 = [10 x i8] c"sub cons.\00"
@.str.3 = [14 x i8] c"Not Consisted\00"
define i8* @CONSIST_STAT(i32 %0) {
%2 = and i32 %0, 72
switch i32 %2, label %3 [
i32 72, label %7
i32 8, label %6
]
3: ; preds = %1
%4 = icmp eq i32 %2, 64
%5 = select i1 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0)
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %3
%8 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %1 ], [ %5, %3 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), %6 ]
ret i8* %8
}
int dup2(int oldfd, int newfd) {
  ;
  typeof(dup2) *orig_dup2 = osym("dup2");
  int rc = (*orig_dup2)(oldfd, newfd);
  if (rc >= 0) {
    trace_dup(oldfd, rc);
  }
  return rc;
}


x86 assembly (clang, -O0):
<dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <osym@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   *%rax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1168 <dup2+0x48>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1040 <trace_dup@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <osym@plt>
cltq
mov    %ebx,%edi
mov    %ebp,%esi
call   *%rax
mov    %eax,%ebp
test   %eax,%eax
js     114e <dup2+0x2e>
mov    %ebx,%edi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <trace_dup@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"dup2\00"
define i32 @dup2(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @osym to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32 (i32, i32)*
%6 = tail call i32 %5(i32 %0, i32 %1)
%7 = icmp sgt i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @trace_dup to i32 (i32, i32, ...)*)(i32 %0, i32 %6)
br label %10
10: ; preds = %8, %2
ret i32 %6
}
/* Type definitions */
struct Cyc___cycFILE {
  int dummy;
};
struct Cyc_Interface_I {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Interface_print(struct Cyc_Interface_I *,
                                       struct Cyc___cycFILE *);
void Cyc_Interface_save(struct Cyc_Interface_I *i, struct Cyc___cycFILE *f) {
  Cyc_Interface_print(i, f);
}


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

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

LLVM IR (-O0):
%struct.Cyc_Interface_I = type { i32 }
%struct.Cyc___cycFILE = type { i32 }
define void @Cyc_Interface_save(%struct.Cyc_Interface_I* %0, %struct.Cyc___cycFILE* %1) {
%3 = alloca %struct.Cyc_Interface_I*
%4 = alloca %struct.Cyc___cycFILE*
store %struct.Cyc_Interface_I* %0, %struct.Cyc_Interface_I** %3
store %struct.Cyc___cycFILE* %1, %struct.Cyc___cycFILE** %4
%5 = load %struct.Cyc_Interface_I*, %struct.Cyc_Interface_I** %3
%6 = load %struct.Cyc___cycFILE*, %struct.Cyc___cycFILE** %4
%7 = call i32 @Cyc_Interface_print(%struct.Cyc_Interface_I* %5, %struct.Cyc___cycFILE* %6)
ret void
}

LLVM IR (-O2):
%struct.Cyc_Interface_I = type { i32 }
%struct.Cyc___cycFILE = type { i32 }
define void @Cyc_Interface_save(%struct.Cyc_Interface_I* %0, %struct.Cyc___cycFILE* %1) {
%3 = tail call i32 @Cyc_Interface_print(%struct.Cyc_Interface_I* %0, %struct.Cyc___cycFILE* %1)
ret void
}