xunge/DecIR huggingface dataset:
void conv2cpy(dst, src) char *dst;
char *src;
{
  register char tmp;
  tmp = *src++;
  *dst++ = *src++;
  *dst++ = tmp;
}


x86 assembly (clang, -O0):
<conv2cpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv2cpy>:
movzwl (%rsi),%eax
rol    $0x8,%ax
mov    %ax,(%rdi)
ret

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

LLVM IR (-O2):
define void @conv2cpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %1
%5 = load i8, i8* %3
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %0
store i8 %4, i8* %6
ret void
}
/* Variables and functions */
void *memcpy(int /*<<< orphan*/, void const *, size_t const);
int /*<<< orphan*/ xmalloc(size_t const);
void *xmemdup(void const *p, const size_t s) {
  return memcpy(xmalloc(s), p, s);
}


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

x86 assembly (clang, -O2):
<xmemdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <xmalloc@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @xmemdup(i8* %0, i64 %1) {
%3 = tail call i32 @xmalloc(i64 %1)
%4 = tail call i8* @memcpy(i32 %3, i8* %0, i64 %1)
ret i8* %4
}
int subtract(int a, int b, int (*sub_function)(int, int)) {
  return sub_function(a, b);
}


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

x86 assembly (clang, -O2):
<subtract>:
jmp    *%rdx

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

LLVM IR (-O2):
define i32 @subtract(i32 %0, i32 %1, i32 (i32, i32)* nocapture %2) {
%4 = tail call i32 %2(i32 %0, i32 %1)
ret i32 %4
}
const char *skip_key(const char *str) {
  while (*str >= 35 && *str <= 122 && *str != ';')
    str++;
  return str;
}


x86 assembly (clang, -O0):
<skip_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x23,%ecx
mov    %al,-0x9(%rbp)
jl     1142 <skip_key+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x7a,%ecx
mov    %al,-0x9(%rbp)
jg     1142 <skip_key+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <skip_key+0x52>
jmp    1163 <skip_key+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_key+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_key>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    $0x3b,%cl
je     1125 <skip_key+0x25>
add    $0x85,%cl
cmp    $0xa7,%cl
ja     1110 <skip_key+0x10>
ret

LLVM IR (-O0):
define i8* @skip_key(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %20, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 35
br i1 %7, label %8, label %18
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 122
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 59
br label %18
18: ; preds = %13, %8, %3
%19 = phi i1 [ false, %8 ], [ false, %3 ], [ %17, %13 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %2
br label %3
23: ; preds = %18
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
define i8* @skip_key(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %9, %2 ]
%4 = load i8, i8* %3
%5 = add i8 %4, -123
%6 = icmp ult i8 %5, -88
%7 = icmp eq i8 %4, 59
%8 = or i1 %7, %6
%9 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %8, label %10, label %2
10: ; preds = %2
ret i8* %3
}
void writePort1(unsigned short int port, unsigned char value) {}


x86 assembly (clang, -O0):
<writePort1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @writePort1(i16 zeroext %0, i8 zeroext %1) {
ret void
}
unsigned int PutDataIntoIvr729Player(void *pIvrPlay, const unsigned char *pData,
                                     unsigned int nCount) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @PutDataIntoIvr729Player(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
ret i32 0
}

LLVM IR (-O2):
define i32 @PutDataIntoIvr729Player(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ EISDIR;
scalar_t__ errno;
int syscall(int, char const *);
int remove(const char *path) {
  int r = syscall(10, path);
  return (r && errno == EISDIR) ? syscall(40, path) : r;
}


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1030 <syscall@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1167 <remove+0x57>
mov    0x2e9a(%rip),%rax
mov    (%rax),%rax
mov    0x2ea0(%rip),%rcx
cmp    (%rcx),%rax
jne    1167 <remove+0x57>
mov    -0x8(%rbp),%rsi
mov    $0x28,%edi
call   1030 <syscall@plt>
mov    %eax,-0x10(%rbp)
jmp    116d <remove+0x5d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <syscall@plt>
test   %eax,%eax
je     1149 <remove+0x39>
mov    0x2eac(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2eb2(%rip),%rdx
cmp    (%rdx),%rcx
jne    114b <remove+0x3b>
mov    $0x28,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <syscall@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@EISDIR = global i64 0
define i32 @remove(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @syscall(i32 10, i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i64, i64* @errno
%10 = load i64, i64* @EISDIR
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i8*, i8** %2
%14 = call i32 @syscall(i32 40, i8* %13)
br label %17
15: ; preds = %8, %1
%16 = load i32, i32* %3
br label %17
17: ; preds = %15, %12
%18 = phi i32 [ %14, %12 ], [ %16, %15 ]
ret i32 %18
}

LLVM IR (-O2):
@errno = global i64 0
@EISDIR = global i64 0
define i32 @remove(i8* %0) {
%2 = tail call i32 @syscall(i32 10, i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EISDIR
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @syscall(i32 40, i8* %0)
br label %10
10: ; preds = %1, %4, %8
%11 = phi i32 [ %9, %8 ], [ %2, %4 ], [ 0, %1 ]
ret i32 %11
}
void handle_SEGV(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_SEGV(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_chaiscript_comments() {
  test_parser_verify_parse(test_parser_sourcefile("chaiscript", " //comment"),
                           "chaiscript", "", "//comment", 0);
}


x86 assembly (clang, -O0):
<test_chaiscript_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xece(%rip),%rdx
lea    0xebe(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_chaiscript_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xed7(%rip),%rdx
lea    0xec7(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"chaiscript\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_chaiscript_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"chaiscript\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_chaiscript_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
#define EINVAL 128
int /*<<< orphan*/ printf(char *, char *);
void validaCondWait(int e) {
  char *mensaje = "\n\t-Se produjo el error";
  switch (e) {
  case EINVAL:
    printf("%s EINVAL ( The value specified by cond or the value specified by "
           "mutex is invalid.) \n\n",
           mensaje);
    break;
  }
}


x86 assembly (clang, -O0):
<validaCondWait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
jne    1149 <validaCondWait+0x39>
jmp    1139 <validaCondWait+0x29>
mov    -0x10(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validaCondWait>:
cmp    $0x80,%edi
jne    112b <validaCondWait+0x1b>
lea    0xef8(%rip),%rdi
lea    0xeda(%rip),%rsi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0A\09-Se produjo el error\00"
@.str.1 = [88 x i8] c"%s EINVAL ( The value specified by cond or the value specified by mutex is invalid.) \0A\0A\00"
define void @validaCondWait(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
switch i32 %4, label %8 [
i32 128, label %5
]
5: ; preds = %1
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %1, %5
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0A\09-Se produjo el error\00"
@.str.1 = [88 x i8] c"%s EINVAL ( The value specified by cond or the value specified by mutex is invalid.) \0A\0A\00"
define void @validaCondWait(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
ret void
}
double D_sign(a, b)
double a, b;
{
  double x;
  x = (a >= 0 ? a : -a);
  return (b >= 0 ? x : -x);
}


x86 assembly (clang, -O0):
<D_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112f <D_sign+0x2f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1150 <D_sign+0x50>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     117b <D_sign+0x7b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    119c <D_sign+0x9c>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<D_sign>:
movapd 0xef8(%rip),%xmm2
movapd %xmm0,%xmm3
xorpd  %xmm2,%xmm3
xorpd  %xmm4,%xmm4
xorpd  %xmm5,%xmm5
cmplesd %xmm0,%xmm5
andpd  %xmm5,%xmm0
andnpd %xmm3,%xmm5
orpd   %xmm5,%xmm0
xorpd  %xmm0,%xmm2
cmplesd %xmm1,%xmm4
andpd  %xmm4,%xmm0
andnpd %xmm2,%xmm4
orpd   %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @D_sign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fcmp oge double %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %13
10: ; preds = %2
%11 = load double, double* %3
%12 = fneg double %11
br label %13
13: ; preds = %10, %8
%14 = phi double [ %9, %8 ], [ %12, %10 ]
store double %14, double* %5
%15 = load double, double* %4
%16 = fcmp oge double %15, 0.000000e+00
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %5
br label %22
19: ; preds = %13
%20 = load double, double* %5
%21 = fneg double %20
br label %22
22: ; preds = %19, %17
%23 = phi double [ %18, %17 ], [ %21, %19 ]
ret double %23
}

LLVM IR (-O2):
define double @D_sign(double %0, double %1) {
%3 = fcmp oge double %0, 0.000000e+00
%4 = fneg double %0
%5 = select i1 %3, double %0, double %4
%6 = fcmp oge double %1, 0.000000e+00
%7 = fneg double %5
%8 = select i1 %6, double %5, double %7
ret double %8
}
/* Variables and functions */
void *memchr(const void *buf, int c, int count) {
  int i;
  for (i = 0; i < count; i++)
    if (*(char *)buf == c)
      return (void *)buf;
    else
      buf++;
  return (void *)0;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    115d <memchr+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    113e <memchr+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <memchr+0x65>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114f <memchr+0x4f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <memchr+0x15>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %edx,%edx
jle    1120 <memchr+0x20>
mov    %rdi,%rax
nopw   0x0(%rax,%rax,1)
movsbl (%rax),%ecx
cmp    %esi,%ecx
je     1122 <memchr+0x22>
add    $0x1,%rax
add    $0xffffffff,%edx
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3, %11
%6 = phi i32 [ %13, %11 ], [ 0, %3 ]
%7 = phi i8* [ %12, %11 ], [ %0, %3 ]
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, %1
br i1 %10, label %15, label %11
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = add nuw nsw i32 %6, 1
%14 = icmp eq i32 %13, %2
br i1 %14, label %15, label %5
15: ; preds = %5, %11, %3
%16 = phi i8* [ null, %3 ], [ null, %11 ], [ %7, %5 ]
ret i8* %16
}
void encode_float(float *f, unsigned char *buffer) {
  unsigned int *uf = (unsigned int *)f;
  buffer[0] = *uf & 0xFF;
  buffer[1] = (*uf >> 8) & 0xFF;
  buffer[2] = (*uf >> 16) & 0xFF;
  buffer[3] = (*uf >> 24) & 0xFF;
}


x86 assembly (clang, -O0):
<encode_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_float>:
mov    (%rdi),%al
mov    %al,(%rsi)
mov    0x1(%rdi),%al
mov    %al,0x1(%rsi)
mov    0x2(%rdi),%al
mov    %al,0x2(%rsi)
mov    0x3(%rdi),%al
mov    %al,0x3(%rsi)
ret

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

LLVM IR (-O2):
define void @encode_float(float* nocapture %0, i8* nocapture writeonly %1) {
%3 = bitcast float* %0 to i32*
%4 = load i32, i32* %3
%5 = trunc i32 %4 to i8
store i8 %5, i8* %1
%6 = load i32, i32* %3
%7 = lshr i32 %6, 8
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %8, i8* %9
%10 = load i32, i32* %3
%11 = lshr i32 %10, 16
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %12, i8* %13
%14 = load i32, i32* %3
%15 = lshr i32 %14, 24
%16 = trunc i32 %15 to i8
%17 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %16, i8* %17
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_WriteCommand(int);
void LCD_ShowCursor(void) { LCD_WriteCommand(0x08 | 0x04 | 0x02); }


x86 assembly (clang, -O0):
<LCD_ShowCursor>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe,%edi
call   1030 <LCD_WriteCommand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_ShowCursor>:
mov    $0xe,%edi
jmp    1030 <LCD_WriteCommand@plt>

LLVM IR (-O0):
define void @LCD_ShowCursor() {
%1 = call i32 @LCD_WriteCommand(i32 14)
ret void
}

LLVM IR (-O2):
define void @LCD_ShowCursor() {
%1 = tail call i32 @LCD_WriteCommand(i32 14)
ret void
}
void gtk_icon_view_get_selection_mode() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_get_selection_mode() {
ret void
}
char *libwebsock_version_string(void) { return "libwebsock 1.0.7"; }


x86 assembly (clang, -O0):
<libwebsock_version_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libwebsock_version_string>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"libwebsock 1.0.7\00"
define i8* @libwebsock_version_string() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"libwebsock 1.0.7\00"
define i8* @libwebsock_version_string() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ NOTICEREF;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ NOTICEREF_it;
NOTICEREF *d2i_NOTICEREF(NOTICEREF **a, const unsigned char **in, long len) {
  return (NOTICEREF *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &NOTICEREF_it);
}


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

x86 assembly (clang, -O2):
<d2i_NOTICEREF>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@NOTICEREF_it = global i32 0
define i32* @d2i_NOTICEREF(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @NOTICEREF_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@NOTICEREF_it = global i32 0
define i32* @d2i_NOTICEREF(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @NOTICEREF_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
int radix_tree_exception(void *arg) {
  return __builtin_expect(!!((unsigned long)arg & (1 | 2)), 0);
}


x86 assembly (clang, -O0):
<radix_tree_exception>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix_tree_exception>:
xor    %eax,%eax
test   $0x3,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @radix_tree_exception(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, 3
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = sext i32 %9 to i64
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @radix_tree_exception(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 3
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_98int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x98 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_98int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x98,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_98int64_highword_mem>:
testb  $0x98,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_98int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 152
%7 = icmp ne i64 %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_98int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 652835028992
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int generate() {
  printf("\n****************\n");
  printf(".text\n");
}


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

x86 assembly (clang, -O2):
<generate>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [18 x i8] c"\0A****************\00"
@str.2 = [6 x i8] c".text\00"
define i32 @generate() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
ret i32 undef
}
long kernel___Int_rsh___impl(long self, long i) { return self >> i; }


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

x86 assembly (clang, -O2):
<kernel___Int_rsh___impl>:
mov    %rsi,%rcx
mov    %rdi,%rax
sar    %cl,%rax
ret

LLVM IR (-O0):
define i64 @kernel___Int_rsh___impl(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 = load i64, i64* %4
%7 = ashr i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @kernel___Int_rsh___impl(i64 %0, i64 %1) {
%3 = ashr i64 %0, %1
ret i64 %3
}
void foo130() {}


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

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

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

LLVM IR (-O2):
define void @foo130() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ DAC_Init();
void Sound_Init() {
  DAC_Init();
  (*((volatile uint32_t *)0xE000E010)) = 0;
  (*((volatile uint32_t *)0xE000E014)) = 7255;
  (*((volatile uint32_t *)0xE000E018)) = 0;
  (*((volatile uint32_t *)0xE000ED20)) =
      ((*((volatile uint32_t *)0xE000ED20)) & 0x00FFFFFF) | 0x20000000;
  (*((volatile uint32_t *)0xE000E010)) = 0x0007;
}


x86 assembly (clang, -O0):
<Sound_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DAC_Init@plt>
mov    $0xe000e010,%eax
movl   $0x0,(%rax)
mov    $0xe000e014,%eax
movl   $0x1c57,(%rax)
mov    $0xe000e018,%eax
movl   $0x0,(%rax)
mov    $0xe000ed20,%eax
mov    (%rax),%ecx
and    $0xffffff,%ecx
or     $0x20000000,%ecx
mov    $0xe000ed20,%eax
mov    %ecx,(%rax)
mov    $0xe000e010,%eax
movl   $0x7,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sound_Init>:
push   %rax
xor    %eax,%eax
call   1030 <DAC_Init@plt>
mov    $0xe000e010,%eax
movl   $0x0,(%rax)
movl   $0x1c57,0x4(%rax)
movl   $0x0,0x8(%rax)
mov    $0xffffff,%ecx
and    0xd10(%rax),%ecx
or     $0x20000000,%ecx
mov    %ecx,0xd10(%rax)
movl   $0x7,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @Sound_Init() {
%1 = call i32 (...) @DAC_Init()
store volatile i32 0, i32* inttoptr (i64 3758153744 to i32*)
store volatile i32 7255, i32* inttoptr (i64 3758153748 to i32*)
store volatile i32 0, i32* inttoptr (i64 3758153752 to i32*)
%2 = load volatile i32, i32* inttoptr (i64 3758157088 to i32*)
%3 = and i32 %2, 16777215
%4 = or i32 %3, 536870912
store volatile i32 %4, i32* inttoptr (i64 3758157088 to i32*)
store volatile i32 7, i32* inttoptr (i64 3758153744 to i32*)
ret void
}

LLVM IR (-O2):
define void @Sound_Init() {
%1 = tail call i32 (...) @DAC_Init()
store volatile i32 0, i32* inttoptr (i64 3758153744 to i32*)
store volatile i32 7255, i32* inttoptr (i64 3758153748 to i32*)
store volatile i32 0, i32* inttoptr (i64 3758153752 to i32*)
%2 = load volatile i32, i32* inttoptr (i64 3758157088 to i32*)
%3 = and i32 %2, 16777215
%4 = or i32 %3, 536870912
store volatile i32 %4, i32* inttoptr (i64 3758157088 to i32*)
store volatile i32 7, i32* inttoptr (i64 3758153744 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void PrintVersion() {
  printf("[rly08 version %s]", "1.0");
  printf("\n\n");
}


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

x86 assembly (clang, -O2):
<PrintVersion>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee4(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"[rly08 version %s]\00"
@.str.1 = [4 x i8] c"1.0\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
define void @PrintVersion() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"[rly08 version %s]\00"
@.str.1 = [4 x i8] c"1.0\00"
@str = [2 x i8] c"\0A\00"
define void @PrintVersion() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
void cvt_s_w(int *source, float *dest) { *dest = *source; }


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

x86 assembly (clang, -O2):
<cvt_s_w>:
cvtsi2ssl (%rdi),%xmm0
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @cvt_s_w(i32* %0, float* %1) {
%3 = alloca i32*
%4 = alloca float*
store i32* %0, i32** %3
store float* %1, float** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to float
%8 = load float*, float** %4
store float %7, float* %8
ret void
}

LLVM IR (-O2):
define void @cvt_s_w(i32* nocapture %0, float* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = sitofp i32 %3 to float
store float %4, float* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, size_t);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *r = malloc((size + 3) & ~3);
  if (r == NULL && size != 0)
    fatal("Failed to malloc %zu bytes.\n", size);
  return r;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x3,%rdi
and    $0xfffffffffffffffc,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1167 <xmalloc+0x47>
cmpq   $0x0,-0x8(%rbp)
je     1167 <xmalloc+0x47>
mov    -0x8(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x3,%rdi
and    $0xfffffffffffffffc,%rdi
call   1030 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1150 <xmalloc+0x30>
test   %r14,%r14
jne    1150 <xmalloc+0x30>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
call   1040 <fatal@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Failed to malloc %zu bytes.\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 3
%6 = and i64 %5, -4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %1
%11 = load i64, i64* %2
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i64, i64* %2
%15 = call i32 @fatal(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %13, %10, %1
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [29 x i8] c"Failed to malloc %zu bytes.\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = add i64 %0, 3
%3 = and i64 %2, -4
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
%6 = icmp ne i64 %0, 0
%7 = and i1 %6, %5
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 @fatal(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %10
10: ; preds = %8, %1
ret i8* %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  short y;
};
typedef TYPE_1__ XTimeCoord;

/* Variables and functions */
void set_XTimeCoord_y(void *_p, short _v) { ((XTimeCoord *)_p)->y = (short)_v; }


x86 assembly (clang, -O0):
<set_XTimeCoord_y>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XTimeCoord_y>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i16 }
define void @set_XTimeCoord_y(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i16 %5, i16* %8
ret void
}

LLVM IR (-O2):
define void @set_XTimeCoord_y(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ writeln(char *);
int /*<<< orphan*/ writestr(char *);
void writenum(char *propname, int n) {
  char sbuff[20];
  writestr(propname);
  sprintf(sbuff, "%4d", n);
  writeln(sbuff);
}


x86 assembly (clang, -O0):
<writenum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <writestr@plt>
lea    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xeaa(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <writeln@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writenum>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
call   1040 <writestr@plt>
lea    0xebb(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <writeln@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%4d\00"
define void @writenum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [20 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @writestr(i8* %6)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%12 = call i32 @writeln(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%4d\00"
define void @writenum(i8* %0, i32 %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @writestr(i8* %0)
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%7 = call i32 @writeln(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writeMonthlyClimate2(char *);
void writeMonthlyClimate2_R(char **siteDir) { writeMonthlyClimate2(*siteDir); }


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

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

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

LLVM IR (-O2):
define void @writeMonthlyClimate2_R(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @writeMonthlyClimate2(i8* %2)
ret void
}
/* Variables and functions */
int OK;
int PDC_fix_cursor(int flag) { return (OK); }


x86 assembly (clang, -O0):
<PDC_fix_cursor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDC_fix_cursor>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@OK = global i32 0
define i32 @PDC_fix_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @OK
ret i32 %3
}

LLVM IR (-O2):
@OK = global i32 0
define i32 @PDC_fix_cursor(i32 %0) {
%2 = load i32, i32* @OK
ret i32 %2
}
void logit(const int loglevel, const int verbosity, const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @logit(i32 %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_postadd_int8_t(int /*<<< orphan*/ *, int);
int8_t atomic_postinc_int8_t(int8_t *var) {
  return atomic_postadd_int8_t(var, 1);
}


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

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

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

LLVM IR (-O2):
define i32 @atomic_postinc_int8_t(i32* %0) {
%2 = tail call i32 @atomic_postadd_int8_t(i32* %0, i32 1)
ret i32 %2
}
double do_fsincos(void) {
  double res;
  __asm__ __volatile__("fldln2\n\t"
                       "fsincos\n\t"
                       "fsub %%st(1)\n\t"
                       "fstpl 0(%0)"
                       :
                       : "r"(&res));
  return res;
}


x86 assembly (clang, -O0):
<do_fsincos>:
push   %rbp
mov    %rsp,%rbp
lea    -0x8(%rbp),%rax
fldln2
fsincos
fsub   %st(1),%st
fstpl  (%rax)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_fsincos>:
lea    -0x8(%rsp),%rax
fldln2
fsincos
fsub   %st(1),%st
fstpl  (%rax)
movsd  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @do_fsincos() {
%1 = alloca double
%2 = load double, double* %1
ret double %2
}

LLVM IR (-O2):
define double @do_fsincos() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = load double, double* %1
ret double %3
}
/* Type definitions */
struct xml_reader {
  int dummy;
};
struct manifest_tpk {
  int dummy;
};

/* Variables and functions */
int xml_read_accept_pop(struct xml_reader *);
int end_simple_pop(struct xml_reader *reader, const char *name,
                   struct manifest_tpk *manif) {
  return xml_read_accept_pop(reader);
}


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

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

LLVM IR (-O0):
%struct.xml_reader = type { i32 }
%struct.manifest_tpk = type { i32 }
define i32 @end_simple_pop(%struct.xml_reader* %0, i8* %1, %struct.manifest_tpk* %2) {
%4 = alloca %struct.xml_reader*
%5 = alloca i8*
%6 = alloca %struct.manifest_tpk*
store %struct.xml_reader* %0, %struct.xml_reader** %4
store i8* %1, i8** %5
store %struct.manifest_tpk* %2, %struct.manifest_tpk** %6
%7 = load %struct.xml_reader*, %struct.xml_reader** %4
%8 = call i32 @xml_read_accept_pop(%struct.xml_reader* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.xml_reader = type { i32 }
%struct.manifest_tpk = type { i32 }
define i32 @end_simple_pop(%struct.xml_reader* %0, i8* nocapture readnone %1, %struct.manifest_tpk* nocapture readnone %2) {
%4 = tail call i32 @xml_read_accept_pop(%struct.xml_reader* %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ b();
int /*<<< orphan*/ c(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello");
  b();
  c(6);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <b@plt>
mov    $0x6,%edi
call   1060 <c@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <b@plt>
mov    $0x6,%edi
call   1060 <c@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @b()
%3 = tail call i32 @c(i32 6)
%4 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: mygrep PATTERN [OPTION].... [FILE]...\n");
  printf("Try 'mygrep -h' for more information.\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Usage: mygrep PATTERN [OPTION].... [FILE]...\0A\00"
@.str.1 = [39 x i8] c"Try 'mygrep -h' for more information.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"Usage: mygrep PATTERN [OPTION].... [FILE]...\00"
@str.2 = [38 x i8] c"Try 'mygrep -h' for more information.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.2, i64 0, i64 0))
ret void
}