xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  while (1) {
    int map = (int)getchar();
    getchar();
    printf("%d\n", map);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i64 (...) @getchar()
%5 = trunc i64 %4 to i32
store i32 %5, i32* %2
%6 = call i64 (...) @getchar()
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %3
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i64 (...) @getchar()
%3 = trunc i64 %2 to i32
%4 = tail call i64 (...) @getchar()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ DirectIndexedIndirectE0(int);
int /*<<< orphan*/ STA16(int /*<<< orphan*/, int);
void Op81E0M0(void) { STA16(DirectIndexedIndirectE0(2), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op81E0M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <DirectIndexedIndirectE0@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <STA16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op81E0M0>:
push   %rax
mov    $0x2,%edi
call   1030 <DirectIndexedIndirectE0@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <STA16@plt>

LLVM IR (-O0):
define void @Op81E0M0() {
%1 = call i32 @DirectIndexedIndirectE0(i32 2)
%2 = call i32 @STA16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op81E0M0() {
%1 = tail call i32 @DirectIndexedIndirectE0(i32 2)
%2 = tail call i32 @STA16(i32 %1, i32 16777215)
ret void
}
/* Variables and functions */
scalar_t__ atanh(double);
float atanhf(float x) { return (float)atanh((double)x); }


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

x86 assembly (clang, -O2):
<atanhf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <atanh@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @atanhf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @atanh(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @atanhf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @atanh(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
void ClientConnect(void) {}


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

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

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

LLVM IR (-O2):
define void @ClientConnect() {
ret void
}
/* Type definitions */
union bpf_attr {
  int target_fd;
  int attach_type;
};
typedef enum bpf_attach_type {
  ____Placeholder_bpf_attach_type
} bpf_attach_type;
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_PROG_DETACH;
int /*<<< orphan*/ memset(union bpf_attr *, int /*<<< orphan*/, int);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_prog_detach(int target_fd, enum bpf_attach_type type) {
  union bpf_attr attr;
  memset(&attr, 0, sizeof(attr));
  attr.target_fd = target_fd;
  attr.attach_type = type;
  return sys_bpf(BPF_PROG_DETACH, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_prog_detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_prog_detach>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %ebx,(%rsp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_PROG_DETACH = global i32 0
define i32 @bpf_prog_detach(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %union.bpf_attr
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @memset(%union.bpf_attr* %5, i32 0, i32 4)
%7 = load i32, i32* %3
%8 = bitcast %union.bpf_attr* %5 to i32*
store i32 %7, i32* %8
%9 = load i32, i32* %4
%10 = bitcast %union.bpf_attr* %5 to i32*
store i32 %9, i32* %10
%11 = load i32, i32* @BPF_PROG_DETACH
%12 = call i32 @sys_bpf(i32 %11, %union.bpf_attr* %5, i32 4)
ret i32 %12
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_PROG_DETACH = global i32 0
define i32 @bpf_prog_detach(i32 %0, i32 %1) {
%3 = alloca %union.bpf_attr
%4 = bitcast %union.bpf_attr* %3 to i8*
%5 = call i32 @memset(%union.bpf_attr* %3, i32 0, i32 4)
%6 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %3, i64 0, i32 0
store i32 %1, i32* %6
%7 = load i32, i32* @BPF_PROG_DETACH
%8 = call i32 @sys_bpf(i32 %7, %union.bpf_attr* %3, i32 4)
ret i32 %8
}
/* Variables and functions */
int dal_reg_read(unsigned int, unsigned int, unsigned int *);
int emac2_reg_get(unsigned int dev_id, unsigned int reg_addr,
                  unsigned int *pvalue) {
  return dal_reg_read(dev_id, reg_addr + 0x108000, pvalue);
}


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

x86 assembly (clang, -O2):
<emac2_reg_get>:
add    $0x108000,%esi
jmp    1030 <dal_reg_read@plt>

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

LLVM IR (-O2):
define i32 @emac2_reg_get(i32 %0, i32 %1, i32* %2) {
%4 = add i32 %1, 1081344
%5 = tail call i32 @dal_reg_read(i32 %0, i32 %4, i32* %2)
ret i32 %5
}
unsigned long hashstring(const char *str) {
  unsigned long hash = 0;
  while (*str) {
    hash = hash * 31 + *str;
    str++;
  }
  return hash % 1000;
}


x86 assembly (clang, -O0):
<hashstring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <hashstring+0x42>
imul   $0x1f,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <hashstring+0x10>
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashstring>:
mov    (%rdi),%al
test   %al,%al
je     1152 <hashstring+0x52>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %rcx,%rdx
shl    $0x5,%rdx
sub    %rcx,%rdx
movsbq %al,%rcx
add    %rdx,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hashstring+0x10>
mov    %rcx,%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
mul    %rdx
shr    $0x4,%rdx
imul   $0x3e8,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,%rax
ret
xor    %ecx,%ecx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @hashstring(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 31
%9 = sext i8 %5 to i64
%10 = add i64 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i64 %10, 1000
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 0, %1 ], [ %15, %14 ]
ret i64 %17
}
void __attribute__((weak)) dma1_stream0_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<dma1_stream0_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dma1_stream0_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.dma1_stream0_isr = [17 x i8] c"dma1_stream0_isr\00"
define weak void @dma1_stream0_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.dma1_stream0_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.dma1_stream0_isr = [17 x i8] c"dma1_stream0_isr\00"
define weak void @dma1_stream0_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.dma1_stream0_isr, i64 0, i64 0))
ret void
}
void _JsString_Deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @_JsString_Deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debugprintf(char *, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void check_socket(int fd) {
  if (fd < 0) {
    perror("Error: Socket Corrupt ");
    exit(errno);
  } else {
    debugprintf("Client Socket: %d In Use\n", fd);
  }
}


x86 assembly (clang, -O0):
<check_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    115f <check_socket+0x2f>
lea    0xeb4(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <debugprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_socket>:
test   %edi,%edi
js     1142 <check_socket+0x12>
mov    %edi,%esi
lea    0xeda(%rip),%rdi
jmp    1030 <debugprintf@plt>
push   %rax
lea    0xeb6(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Error: Socket Corrupt \00"
@errno = global i32 0
@.str.1 = [26 x i8] c"Client Socket: %d In Use\0A\00"
define void @check_socket(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @errno
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @debugprintf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Error: Socket Corrupt \00"
@errno = global i32 0
@.str.1 = [26 x i8] c"Client Socket: %d In Use\0A\00"
define void @check_socket(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @errno
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
%8 = tail call i32 @debugprintf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
int imax(int a, int b) { return a < b ? b : a; }


x86 assembly (clang, -O0):
<imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <imax+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imax+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void ThrowException(char const *errorMessage) {
  printf("Exception Thrown: \n");
  printf("          %s\n", errorMessage);
  exit(1);
}


x86 assembly (clang, -O0):
<ThrowException>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ThrowException>:
push   %rbx
mov    %rdi,%rbx
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str.1 = [14 x i8] c" %s\0A\00"
@str = [19 x i8] c"Exception Thrown: \00"
define void @ThrowException(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void *append_bytes(void *buffer_ptr, void *src_ptr, int num_bytes) {
  memcpy(buffer_ptr, src_ptr, num_bytes);
  return buffer_ptr + num_bytes;
}


x86 assembly (clang, -O0):
<append_bytes>:
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 <memcpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_bytes>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
call   1030 <memcpy@plt>
movslq %ebx,%rax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @append_bytes(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr i8, i8* %11, i64 %13
ret i8* %14
}

LLVM IR (-O2):
define i8* @append_bytes(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%5 = sext i32 %2 to i64
%6 = getelementptr i8, i8* %0, i64 %5
ret i8* %6
}
/* Variables and functions */
char *strchr(char const *, char);
int index_of(const char *s, char c) {
  char *s2 = strchr(s, c);
  if (s2 == NULL)
    return -1;
  return s2 - s;
}


x86 assembly (clang, -O0):
<index_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114a <index_of+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <index_of+0x48>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_of>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @index_of(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
%7 = load i8*, i8** %4
%8 = load i8, i8* %5
%9 = call i8* @strchr(i8* %7, i8 signext %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %20
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %4
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %13, %12
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @index_of(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
int rpmatch(char const *);
__attribute__((__weak__, __always___)) int
softboundmpx_rpmatch(const char *response) {
  return rpmatch(response);
}


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

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

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

LLVM IR (-O2):
define weak i32 @softboundmpx_rpmatch(i8* %0) {
%2 = tail call i32 @rpmatch(i8* %0)
ret i32 %2
}
extern double __copysign(double x, double y) {
  return __builtin_copysign(x, y);
}


x86 assembly (clang, -O0):
<__copysign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__copysign>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @__copysign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.copysign.f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__copysign(double %0, double %1) {
%3 = tail call double @llvm.copysign.f64(double %0, double %1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_poly1305_relax(uintptr_t, uintptr_t);
void fiat_poly1305_relax(uint64_t out1[3], const uint64_t arg1[3]) {
  internal_fiat_poly1305_relax((uintptr_t)out1, (uintptr_t)arg1);
}


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

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

LLVM IR (-O0):
define void @fiat_poly1305_relax(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_poly1305_relax(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_poly1305_relax(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_poly1305_relax(i64 %3, i64 %4)
ret void
}
void __dprint(int type, const char *str, ...) {}


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

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

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

LLVM IR (-O2):
define void @__dprint(i32 %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
int strncmp(const char *str1, const char *str2, size_t n) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @strncmp(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VirtualFree(void *);
void BigFree(void *address) {
  if (address == 0)
    return;
  VirtualFree(address);
}


x86 assembly (clang, -O0):
<BigFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <BigFree+0x1c>
jmp    1135 <BigFree+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <VirtualFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BigFree>:
test   %rdi,%rdi
je     111a <BigFree+0xa>
jmp    1030 <VirtualFree@plt>
ret

LLVM IR (-O0):
define void @BigFree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @VirtualFree(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @BigFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @VirtualFree(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
scalar_t__ _gettemp(char *, int *, int /*<<< orphan*/, int /*<<< orphan*/,
                    int /*<<< orphan*/);
char *_mktemp(char *path) {
  return (_gettemp(path, (int *)NULL, 0, 0, 0) ? path : (char *)NULL);
}


x86 assembly (clang, -O0):
<_mktemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <_gettemp@plt>
cmp    $0x0,%rax
je     1149 <_mktemp+0x39>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1154 <_mktemp+0x44>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1154 <_mktemp+0x44>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mktemp>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <_gettemp@plt>
test   %rax,%rax
cmovne %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_mktemp(i8* %0) {
%2 = tail call i64 @_gettemp(i8* %0, i32* null, i32 0, i32 0, i32 0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* null, i8* %0
ret i8* %4
}
void gpio_set_data_in(unsigned int port, unsigned int wide) {}


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

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

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

LLVM IR (-O2):
define void @gpio_set_data_in(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef size_t uint8_t;

/* Variables and functions */
void stringCopy(char *string, char *original) {
  uint8_t i = 0;
  while (original[i] > 0) {
    string[i] = original[i];
    i++;
  }
  string[i] = 0;
}


x86 assembly (clang, -O0):
<stringCopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jle    1150 <stringCopy+0x50>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <stringCopy+0x14>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringCopy>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
jle    1120 <stringCopy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rdi,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jg     1110 <stringCopy+0x10>
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @stringCopy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp sgt i8 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i64 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %8
%9 = add i64 %7, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp sgt i8 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %5, %2
%14 = phi i64 [ 0, %2 ], [ %9, %5 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_d3();
int /*<<< orphan*/ take_struct_d3(int /*<<< orphan*/);
void test_struct_d3() { take_struct_d3(return_struct_d3()); }


x86 assembly (clang, -O0):
<test_struct_d3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_struct_d3@plt>
mov    %eax,%edi
call   1030 <take_struct_d3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_d3>:
push   %rax
xor    %eax,%eax
call   1040 <return_struct_d3@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_struct_d3@plt>

LLVM IR (-O0):
define void @test_struct_d3() {
%1 = call i32 (...) @return_struct_d3()
%2 = call i32 @take_struct_d3(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_d3() {
%1 = tail call i32 (...) @return_struct_d3()
%2 = tail call i32 @take_struct_d3(i32 %1)
ret void
}
/* Variables and functions */
void Sys_GLimpSafeInit(void) {}


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

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

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

LLVM IR (-O2):
define void @Sys_GLimpSafeInit() {
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_35(uint64_t x) {
  __asm__("rolq $35, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_35>:
mov    %rdi,%rax
rol    $0x23,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_35(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$35, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_35(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$35, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int max(a, b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
double pow(int, double);
double upperEdge(double center, int frac) {
  return center * pow(10, (3.0 / (10.0 * 2 * frac)));
}


x86 assembly (clang, -O0):
<upperEdge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xebd(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upperEdge>:
push   %rax
movsd  %xmm0,(%rsp)
cvtsi2sd %edi,%xmm1
mulsd  0xede(%rip),%xmm1
movsd  0xede(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @upperEdge(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to double
%8 = fmul double 2.000000e+01, %7
%9 = fdiv double 3.000000e+00, %8
%10 = call double @pow(i32 10, double %9)
%11 = fmul double %5, %10
ret double %11
}

LLVM IR (-O2):
define double @upperEdge(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fmul double %3, 2.000000e+01
%5 = fdiv double 3.000000e+00, %4
%6 = tail call double @pow(i32 10, double %5)
%7 = fmul double %6, %0
ret double %7
}
double Sleef_copysign(double x, double y) { return __builtin_copysign(x, y); }


x86 assembly (clang, -O0):
<Sleef_copysign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_copysign>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Sleef_copysign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @llvm.copysign.f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @Sleef_copysign(double %0, double %1) {
%3 = tail call double @llvm.copysign.f64(double %0, double %1)
ret double %3
}
void TimerIC4PrescalerSet(unsigned long ulBase, unsigned long ulPrescaler) {

  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) &= ~0x00000C00;
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) |= (ulPrescaler << 8);
}


x86 assembly (clang, -O0):
<TimerIC4PrescalerSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%rcx
and    $0xfffffffffffff3ff,%rcx
mov    %rcx,0x1c(%rax)
mov    -0x10(%rbp),%rdx
shl    $0x8,%rdx
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerIC4PrescalerSet>:
andq   $0xfffffffffffff3ff,0x1c(%rdi)
ff
shl    $0x8,%rsi
or     %rsi,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @TimerIC4PrescalerSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 28
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -3073
store volatile i64 %9, i64* %7
%10 = load i64, i64* %4
%11 = shl i64 %10, 8
%12 = load i64, i64* %3
%13 = add i64 %12, 28
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = or i64 %15, %11
store volatile i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @TimerIC4PrescalerSet(i64 %0, i64 %1) {
%3 = add i64 %0, 28
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -3073
store volatile i64 %6, i64* %4
%7 = shl i64 %1, 8
%8 = load volatile i64, i64* %4
%9 = or i64 %8, %7
store volatile i64 %9, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ do_remove();
void abort_gzip_signal() {
  do_remove();
  _exit(1);
}


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

x86 assembly (clang, -O2):
<abort_gzip_signal>:
push   %rax
xor    %eax,%eax
call   1040 <do_remove@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @abort_gzip_signal() {
%1 = call i32 (...) @do_remove()
%2 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @abort_gzip_signal() {
%1 = tail call i32 (...) @do_remove()
%2 = tail call i32 @_exit(i32 1)
unreachable
}
void print_rusage(void) {}


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

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

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

LLVM IR (-O2):
define void @print_rusage() {
ret void
}
/* Variables and functions */
int GCI_invert_Gaussian(float **, int);
int GCI_invert(float **a, int n) { return GCI_invert_Gaussian(a, n); }


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

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

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

LLVM IR (-O2):
define i32 @GCI_invert(float** %0, i32 %1) {
%3 = tail call i32 @GCI_invert_Gaussian(float** %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float ang_rad;
  printf("Angulo em Radiano: ");
  scanf("%f", &ang_rad);
  printf("Angulo em Grau: %.2f", ang_rad * 180 / 3.14);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xeb3(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9a(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xeb2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xeb2(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xeae(%rip),%xmm0
lea    0xec6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Angulo em Radiano: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [21 x i8] c"Angulo em Grau: %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fmul float %5, 1.800000e+02
%7 = fpext float %6 to double
%8 = fdiv double %7, 3.140000e+00
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Angulo em Radiano: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [21 x i8] c"Angulo em Grau: %.2f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, 1.800000e+02
%7 = fpext float %6 to double
%8 = fdiv double %7, 3.140000e+00
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void Funkcija1() { puts("This is function one."); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"This is function one.\00"
define void @Funkcija1() {
%1 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"This is function one.\00"
define void @Funkcija1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void thread_yield() { exit(1); }


x86 assembly (clang, -O0):
<thread_yield>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<thread_yield>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @thread_yield() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @thread_yield() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
int do_final_battle(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @do_final_battle() {
ret i32 0
}
int test_imm_98uint16_mem(unsigned short *val) {
  return ((*val) & (-0x98 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_98uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff68,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_98uint16_mem>:
movzwl (%rdi),%eax
test   $0xff68,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_98uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -152
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_98uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -152
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Chord179(long, long, long, long, double, double,
                            unsigned long);
void chord(long x, long y, long rx, long ry, double sa, double ea,
           unsigned long c) {
  Chord179(x, y, rx, ry, sa, ea, c);
}


x86 assembly (clang, -O0):
<chord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x38(%rbp),%r8
call   1030 <Chord179@plt>
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @chord(i64 %0, i64 %1, i64 %2, i64 %3, double %4, double %5, i64 %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca double
%13 = alloca double
%14 = alloca i64
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store double %4, double* %12
store double %5, double* %13
store i64 %6, i64* %14
%15 = load i64, i64* %8
%16 = load i64, i64* %9
%17 = load i64, i64* %10
%18 = load i64, i64* %11
%19 = load double, double* %12
%20 = load double, double* %13
%21 = load i64, i64* %14
%22 = call i32 @Chord179(i64 %15, i64 %16, i64 %17, i64 %18, double %19, double %20, i64 %21)
ret void
}

LLVM IR (-O2):
define void @chord(i64 %0, i64 %1, i64 %2, i64 %3, double %4, double %5, i64 %6) {
%8 = tail call i32 @Chord179(i64 %0, i64 %1, i64 %2, i64 %3, double %4, double %5, i64 %6)
ret void
}
/* Variables and functions */
size_t base64_encoded_size(size_t);
char *malloc(size_t);
char *base64_alloc_encode_buffer(size_t input_size) {
  size_t encoded_size = base64_encoded_size(input_size);
  char *buffer = malloc(encoded_size + 1);
  buffer[encoded_size] = 0;
  return buffer;
}


x86 assembly (clang, -O0):
<base64_alloc_encode_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <base64_encoded_size@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_alloc_encode_buffer>:
push   %rbx
call   1030 <base64_encoded_size@plt>
mov    %rax,%rbx
lea    0x1(%rax),%rdi
call   1040 <malloc@plt>
movb   $0x0,(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @base64_alloc_encode_buffer(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call i64 @base64_encoded_size(i64 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i64, i64* %3
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8 0, i8* %12
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @base64_alloc_encode_buffer(i64 %0) {
%2 = tail call i64 @base64_encoded_size(i64 %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = getelementptr inbounds i8, i8* %4, i64 %2
store i8 0, i8* %5
ret i8* %4
}
int test_imm_51uint16_mem(unsigned short *val) {
  return ((*val) & (-0x51 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_51uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffffaf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_51uint16_mem>:
movzwl (%rdi),%eax
test   $0xffaf,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_51uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -81
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_51uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -81
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}