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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void end_picture(FILE *ofile) {
  fprintf(ofile, "%%%%Trailer\n");
  fprintf(ofile, "%%%%EOF\n");
}


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

x86 assembly (clang, -O2):
<end_picture>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xee6(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"%%%%Trailer\0A\00"
@.str.1 = [9 x i8] c"%%%%EOF\0A\00"
define void @end_picture(i32* nocapture %0) {
%2 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fputc(unsigned char, int /*<<< orphan*/ *);
int snapshot_write_byte(FILE *f, unsigned char data) {
  if (fputc(data, f) == EOF)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<snapshot_write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1030 <fputc@plt>
mov    0x2eb0(%rip),%rcx
cmp    (%rcx),%rax
jne    114d <snapshot_write_byte+0x3d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <snapshot_write_byte+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snapshot_write_byte>:
push   %rax
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
call   1030 <fputc@plt>
mov    0x2ec3(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @snapshot_write_byte(i32* %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8
store i32* %0, i32** %4
store i8 %1, i8* %5
%6 = load i8, i8* %5
%7 = load i32*, i32** %4
%8 = call i64 @fputc(i8 zeroext %6, i32* %7)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @snapshot_write_byte(i32* nocapture %0, i8 zeroext %1) {
%3 = tail call i64 @fputc(i8 zeroext %1, i32* %0)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: \r\n"
          "-p <port> <must exist>\r\n"
          "-i <ip>   \r\n"
          "-n <number of threads:default %d>\r\n"
          "-s <thread stack size <1..20>MB>\r\n"
          "-h help \r\n",
          128);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x80,%edx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x80,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [125 x i8] c"Usage: \0D\0A-p <port> <must exist>\0D\0A-i <ip> \0D\0A-n <number of threads:default %d>\0D\0A-s <thread stack size <1..20>MB>\0D\0A-h help \0D\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str, i64 0, i64 0), i32 128)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [125 x i8] c"Usage: \0D\0A-p <port> <must exist>\0D\0A-i <ip> \0D\0A-n <number of threads:default %d>\0D\0A-s <thread stack size <1..20>MB>\0D\0A-h help \0D\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str, i64 0, i64 0), i32 128)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float);
void foo(int x, float s) { printf("%d %f\n", x, s); }


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

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d %f\0A\00"
define void @foo(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 float, float* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, float %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %f\0A\00"
define void @foo(i32 %0, float %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, float %1)
ret void
}
/* Type definitions */
struct Audio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SDL_PauseAudio(int /*<<< orphan*/);
void sdl_audio_play(struct Audio *audio) { SDL_PauseAudio(0); }


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

x86 assembly (clang, -O2):
<sdl_audio_play>:
xor    %edi,%edi
jmp    1030 <SDL_PauseAudio@plt>

LLVM IR (-O0):
%struct.Audio = type { i32 }
define void @sdl_audio_play(%struct.Audio* %0) {
%2 = alloca %struct.Audio*
store %struct.Audio* %0, %struct.Audio** %2
%3 = call i32 @SDL_PauseAudio(i32 0)
ret void
}

LLVM IR (-O2):
%struct.Audio = type { i32 }
define void @sdl_audio_play(%struct.Audio* nocapture readnone %0) {
%2 = tail call i32 @SDL_PauseAudio(i32 0)
ret void
}
/* Type definitions */
typedef unsigned short volatile uint32_t;

/* Variables and functions */
uint32_t USBIntStatusEndpoint(uint32_t ui32Base) {
  uint32_t ui32Status;
  ;
  ui32Status = (*((volatile unsigned short *)(ui32Base + 0x00000002)));
  ui32Status |= ((*((volatile unsigned short *)(ui32Base + 0x00000004))) << 16);
  return (ui32Status);
}


x86 assembly (clang, -O0):
<USBIntStatusEndpoint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%eax
add    $0x2,%eax
cltq
mov    (%rax),%ax
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%eax
add    $0x4,%eax
cltq
mov    (%rax),%ax
movzwl %ax,%ecx
shl    $0x10,%ecx
mov    -0x4(%rbp),%ax
movzwl %ax,%eax
or     %ecx,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBIntStatusEndpoint>:
mov    %di,-0x2(%rsp)
movzwl -0x2(%rsp),%eax
movzwl 0x2(%rax),%eax
mov    %ax,-0x4(%rsp)
movzwl -0x2(%rsp),%eax
movzwl 0x4(%rax),%eax
movzwl -0x4(%rsp),%eax
mov    %ax,-0x4(%rsp)
movzwl -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define zeroext i16 @USBIntStatusEndpoint(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store volatile i16 %0, i16* %2
%4 = load volatile i16, i16* %2
%5 = zext i16 %4 to i32
%6 = add nsw i32 %5, 2
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i16*
%9 = load volatile i16, i16* %8
store volatile i16 %9, i16* %3
%10 = load volatile i16, i16* %2
%11 = zext i16 %10 to i32
%12 = add nsw i32 %11, 4
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i16*
%15 = load volatile i16, i16* %14
%16 = zext i16 %15 to i32
%17 = shl i32 %16, 16
%18 = load volatile i16, i16* %3
%19 = zext i16 %18 to i32
%20 = or i32 %19, %17
%21 = trunc i32 %20 to i16
store volatile i16 %21, i16* %3
%22 = load volatile i16, i16* %3
ret i16 %22
}

LLVM IR (-O2):
define zeroext i16 @USBIntStatusEndpoint(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store volatile i16 %0, i16* %2
%4 = bitcast i16* %3 to i8*
%5 = load volatile i16, i16* %2
%6 = zext i16 %5 to i64
%7 = add nuw nsw i64 %6, 2
%8 = inttoptr i64 %7 to i16*
%9 = load volatile i16, i16* %8
store volatile i16 %9, i16* %3
%10 = load volatile i16, i16* %2
%11 = zext i16 %10 to i64
%12 = add nuw nsw i64 %11, 4
%13 = inttoptr i64 %12 to i16*
%14 = load volatile i16, i16* %13
%15 = load volatile i16, i16* %3
store volatile i16 %15, i16* %3
%16 = load volatile i16, i16* %3
ret i16 %16
}
void gtk_action_is_sensitive() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_is_sensitive() {
ret void
}
int Operand_soffset_ator(unsigned int *valp, unsigned int pc) {
  *valp -= pc;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_soffset_ator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_soffset_ator>:
sub    %esi,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_soffset_ator(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = sub i32 %3, %1
store i32 %4, i32* %0
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int, unsigned int);
char *dispRuntime(unsigned rt) {
  static char *fmtbuf;
  fmtbuf = malloc(32);
  snprintf(fmtbuf, 32, "%u.%03.3u", rt / 1000, rt % 1000);
  return (fmtbuf);
}


x86 assembly (clang, -O0):
<dispRuntime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,0x2efc(%rip)
mov    0x2ef5(%rip),%rdi
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
mov    $0x3e8,%esi
xor    %edx,%edx
div    %esi
mov    %edx,%r8d
mov    $0x20,%esi
lea    0xe94(%rip),%rdx
call   1030 <snprintf@plt>
mov    0x2ec0(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispRuntime>:
push   %rbx
mov    %edi,%ebx
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,0x2f04(%rip)
mov    %ebx,%ecx
imul   $0x10624dd3,%rcx,%rcx
shr    $0x26,%rcx
imul   $0x3e8,%ecx,%edx
sub    %edx,%ebx
lea    0xeb0(%rip),%rdx
mov    %rax,%rdi
mov    $0x20,%esi
mov    %ebx,%r8d
call   1030 <snprintf@plt>
mov    0x2ed1(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@dispRuntime.fmtbuf = internal global i8* null
@.str = [10 x i8] c"%u.%03.3u\00"
define i8* @dispRuntime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i8* @malloc(i32 32)
store i8* %3, i8** @dispRuntime.fmtbuf
%4 = load i8*, i8** @dispRuntime.fmtbuf
%5 = load i32, i32* %2
%6 = udiv i32 %5, 1000
%7 = load i32, i32* %2
%8 = urem i32 %7, 1000
%9 = call i32 @snprintf(i8* %4, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
%10 = load i8*, i8** @dispRuntime.fmtbuf
ret i8* %10
}

LLVM IR (-O2):
@dispRuntime.fmtbuf = internal unnamed_addr global i8* null
@.str = [10 x i8] c"%u.%03.3u\00"
define i8* @dispRuntime(i32 %0) {
%2 = tail call dereferenceable_or_null(32) i8* @malloc(i32 32)
store i8* %2, i8** @dispRuntime.fmtbuf
%3 = udiv i32 %0, 1000
%4 = urem i32 %0, 1000
%5 = tail call i32 @snprintf(i8* %2, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i8*, i8** @dispRuntime.fmtbuf
ret i8* %6
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR6A_set(void) { return U_WMRCORENONE_set("U_WMR6A"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR6A\00"
define i8* @U_WMR6A_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR6A\00"
define i8* @U_WMR6A_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int __attribute__((no)) foo_hidden(void) { return -20; }


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

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

LLVM IR (-O0):
define i32 @foo_hidden() {
ret i32 -20
}

LLVM IR (-O2):
define i32 @foo_hidden() {
ret i32 -20
}
int valid(char input) {
  if ((input >= 48) && (input <= 57))
    return 0;
  else if ((input >= 65) && (input <= 70))
    return 0;
  else if ((input >= 97) && (input <= 102))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<valid>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <valid+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <valid+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1183 <valid+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <valid+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     1156 <valid+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1183 <valid+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     117c <valid+0x7c>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     117c <valid+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    1183 <valid+0x83>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid>:
lea    -0x3a(%rdi),%eax
cmp    $0xf6,%al
setb   %al
lea    -0x47(%rdi),%ecx
cmp    $0xfa,%cl
setb   %cl
add    $0x99,%dil
cmp    $0xfa,%dil
setb   %dl
and    %al,%cl
and    %dl,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @valid(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %2
br label %31
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 70
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %2
br label %31
21: ; preds = %16, %12
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 102
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 0, i32* %2
br label %31
30: ; preds = %25, %21
store i32 1, i32* %2
br label %31
31: ; preds = %30, %29, %20, %11
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @valid(i8 signext %0) {
%2 = add i8 %0, -58
%3 = icmp ult i8 %2, -10
%4 = add i8 %0, -71
%5 = icmp ult i8 %4, -6
%6 = add i8 %0, -103
%7 = icmp ult i8 %6, -6
%8 = and i1 %3, %5
%9 = and i1 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
_Complex float foo(_Complex float x) {
  float r = __real x;
  float i = __imag x;
  _Complex float z;
  __real z = r;
  __imag z = i;
  return z;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define <2 x float> @foo(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = alloca float
%5 = alloca float
%6 = alloca { float, float }
%7 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %7
%8 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%9 = load float, float* %8
store float %9, float* %4
%10 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%11 = load float, float* %10
store float %11, float* %5
%12 = load float, float* %4
%13 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 0
store float %12, float* %13
%14 = load float, float* %5
%15 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 1
store float %14, float* %15
%16 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 0
%17 = load float, float* %16
%18 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 1
%19 = load float, float* %18
%20 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%21 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %17, float* %20
store float %19, float* %21
%22 = bitcast { float, float }* %2 to <2 x float>*
%23 = load <2 x float>, <2 x float>* %22
ret <2 x float> %23
}

LLVM IR (-O2):
define <2 x float> @foo(<2 x float> returned %0) {
ret <2 x float> %0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
__attribute__((weak)) float sinf(float a) { abort(); }


x86 assembly (clang, -O0):
<sinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
define weak float @sinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define weak float @sinf(float %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
testMod() { printf("%d %% %d = %d\n", 11, 4, 11 % 4); }


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

x86 assembly (clang, -O2):
<testMod>:
lea    0xee9(%rip),%rdi
mov    $0xb,%esi
mov    $0x4,%edx
mov    $0x3,%ecx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"%d %% %d = %d\0A\00"
define i32 @testMod() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 11, i32 4, i32 3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void dummy_release(void *vcap) { free(vcap); }


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

x86 assembly (clang, -O2):
<dummy_release>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @dummy_release(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_4Euint8_reg(unsigned char val) {
  return ((val) & (0x4E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Euint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x4e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Euint8_reg>:
test   $0x4e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_4Euint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 78
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RST(int);
void RST38() { RST(0x38); }


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

x86 assembly (clang, -O2):
<RST38>:
mov    $0x38,%edi
jmp    1030 <RST@plt>

LLVM IR (-O0):
define void @RST38() {
%1 = call i32 @RST(i32 56)
ret void
}

LLVM IR (-O2):
define void @RST38() {
%1 = tail call i32 @RST(i32 56)
ret void
}
char *estrdup(const char *str) {
  void *ret = strdup(str);
  if (!ret)
    mfatal("strdup", strlen(str));
  return ret;
}


x86 assembly (clang, -O0):
<estrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <estrdup+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rsi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <mfatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115d <estrdup+0x2d>
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    0xead(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <mfatal@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"strdup\00"
define i8* @estrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i64 @strlen(i8* %9)
%11 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @mfatal to i32 (i8*, i64, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"strdup\00"
define i8* @estrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @mfatal to i32 (i8*, i64, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %5)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ perror(char const *);
FILE *Fopen(const char *path, const char *mode) {
  FILE *ret = fopen(path, mode);
  if (ret == NULL) {
    do {
      int e = errno;
      perror(path);
      exit(e);
    } while (0);
  }
  return ret;
}


x86 assembly (clang, -O0):
<Fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117e <Fopen+0x4e>
jmp    1161 <Fopen+0x31>
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0x1c(%rbp),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fopen>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fopen@plt>
test   %rax,%rax
je     1147 <Fopen+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%ebp
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
define i32* @Fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %7, i8* %8)
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %20
12: ; preds = %2
br label %13
13: ; preds = %12
%14 = load i32, i32* @errno
store i32 %14, i32* %6
%15 = load i8*, i8** %3
%16 = call i32 @perror(i8* %15)
%17 = load i32, i32* %6
%18 = call i32 @exit(i32 %17)
unreachable
19: ; No predecessors!
br label %20
20: ; preds = %19, %2
%21 = load i32*, i32** %5
ret i32* %21
}

LLVM IR (-O2):
@errno = global i32 0
define noalias i32* @Fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @perror(i8* %0)
%8 = tail call i32 @exit(i32 %6)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Variables and functions */
unsigned int random();
unsigned long dslib_random(unsigned int max) { return (random() % (max + 1)); }


x86 assembly (clang, -O0):
<dslib_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dslib_random>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
add    $0x1,%ebx
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @dslib_random(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @random()
%4 = load i32, i32* %2
%5 = add i32 %4, 1
%6 = urem i32 %3, %5
%7 = zext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @dslib_random(i32 %0) {
%2 = tail call i32 (...) @random()
%3 = add i32 %0, 1
%4 = urem i32 %2, %3
%5 = zext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_CONF;
long sysconf(int /*<<< orphan*/);
long idris2_getNProcessors() { return sysconf(_SC_NPROCESSORS_CONF); }


x86 assembly (clang, -O0):
<idris2_getNProcessors>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<idris2_getNProcessors>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_CONF = global i32 0
define i64 @idris2_getNProcessors() {
%1 = load i32, i32* @_SC_NPROCESSORS_CONF
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_CONF = global i32 0
define i64 @idris2_getNProcessors() {
%1 = load i32, i32* @_SC_NPROCESSORS_CONF
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
/* Variables and functions */
int testcolorproc();
int testcolorproc2();
int testfader();
int testfilehelper();
int main(int argc, char **argv) {
  int result = 0;
  result |= testcolorproc();
  result |= testcolorproc2();
  result |= testfilehelper();
  result |= testfader();
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1050 <testcolorproc@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1060 <testcolorproc2@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <testfilehelper@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <testfader@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <testcolorproc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <testcolorproc2@plt>
mov    %eax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1040 <testfilehelper@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <testfader@plt>
or     %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 (...) @testcolorproc()
%8 = load i32, i32* %6
%9 = or i32 %8, %7
store i32 %9, i32* %6
%10 = call i32 (...) @testcolorproc2()
%11 = load i32, i32* %6
%12 = or i32 %11, %10
store i32 %12, i32* %6
%13 = call i32 (...) @testfilehelper()
%14 = load i32, i32* %6
%15 = or i32 %14, %13
store i32 %15, i32* %6
%16 = call i32 (...) @testfader()
%17 = load i32, i32* %6
%18 = or i32 %17, %16
store i32 %18, i32* %6
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testcolorproc()
%4 = tail call i32 (...) @testcolorproc2()
%5 = or i32 %4, %3
%6 = tail call i32 (...) @testfilehelper()
%7 = or i32 %5, %6
%8 = tail call i32 (...) @testfader()
%9 = or i32 %7, %8
ret i32 %9
}
unsigned int to_long_int_convertor1(unsigned char array[]) {
  unsigned int n;
  n = array[0] << 16;
  n |= array[1] << 8;
  n |= array[2];
  return n;
}


x86 assembly (clang, -O0):
<to_long_int_convertor1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_long_int_convertor1>:
movzbl (%rdi),%eax
shl    $0x10,%eax
movzbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movzbl 0x2(%rdi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @to_long_int_convertor1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 16
store i32 %8, i32* %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @to_long_int_convertor1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 16
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
ret i32 %13
}
/* Variables and functions */
double log(double const);
double pow(double const, int);
double const sqrt(int);
double dnorml(const double x, const double mu, const double sigma) {
  return -log((sqrt(2 * 3.141592653589793238462643383279502884197169399375)) *
              sigma) -
         pow(x - mu, 2) / (2.0 * sigma * sigma);
}


x86 assembly (clang, -O0):
<dnorml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    $0x6,%edi
call   1050 <sqrt@plt>
mulsd  -0x18(%rbp),%xmm0
call   1030 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  0xe65(%rip),%xmm2
mulsd  -0x18(%rbp),%xmm2
mulsd  -0x18(%rbp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnorml>:
sub    $0x38,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    $0x6,%edi
call   1050 <sqrt@plt>
mulsd  0x8(%rsp),%xmm0
call   1030 <log@plt>
xorpd  0xe9d(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  0x8(%rsp),%xmm2
movapd %xmm2,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movapd 0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @dnorml(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = call double @sqrt(i32 6)
%8 = load double, double* %6
%9 = fmul double %7, %8
%10 = call double @log(double %9)
%11 = fneg double %10
%12 = load double, double* %4
%13 = load double, double* %5
%14 = fsub double %12, %13
%15 = call double @pow(double %14, i32 2)
%16 = load double, double* %6
%17 = fmul double 2.000000e+00, %16
%18 = load double, double* %6
%19 = fmul double %17, %18
%20 = fdiv double %15, %19
%21 = fsub double %11, %20
ret double %21
}

LLVM IR (-O2):
define double @dnorml(double %0, double %1, double %2) {
%4 = tail call double @sqrt(i32 6)
%5 = fmul double %4, %2
%6 = tail call double @log(double %5)
%7 = fneg double %6
%8 = fsub double %0, %1
%9 = tail call double @pow(double %8, i32 2)
%10 = fmul double %2, 2.000000e+00
%11 = fmul double %10, %2
%12 = fdiv double %9, %11
%13 = fsub double %7, %12
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ cmos_write_byte(unsigned int, unsigned char);
void cmos_write_all(unsigned char data[]) {
  unsigned i;
  for (i = 14; i < 256; i++)
    cmos_write_byte(i, data[i]);
}


x86 assembly (clang, -O0):
<cmos_write_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xe,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jae    1151 <cmos_write_all+0x41>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movzbl (%rax,%rcx,1),%esi
call   1030 <cmos_write_byte@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <cmos_write_all+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmos_write_all>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xe,%ebx
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%esi
mov    %ebx,%edi
call   1030 <cmos_write_byte@plt>
add    $0x1,%rbx
cmp    $0x100,%rbx
jne    1120 <cmos_write_all+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @cmos_write_all(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 14, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 256
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = call i32 @cmos_write_byte(i32 %8, i8 zeroext %13)
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @cmos_write_all(i8* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 14, %1 ], [ %8, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = trunc i64 %3 to i32
%7 = tail call i32 @cmos_write_byte(i32 %6, i8 zeroext %5)
%8 = add nuw nsw i64 %3, 1
%9 = icmp eq i64 %8, 256
br i1 %9, label %10, label %2
10: ; preds = %2
ret void
}
unsigned _leap_years_before(unsigned year) {
  --year;
  return (year / 4) - (year / 100) + (year / 400);
}


x86 assembly (clang, -O0):
<_leap_years_before>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_leap_years_before>:
add    $0xffffffff,%edi
imul   $0x51eb851f,%rdi,%rax
mov    %edi,%ecx
shr    $0x2,%ecx
mov    %rax,%rdx
shr    $0x25,%rdx
sub    %edx,%ecx
shr    $0x27,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_leap_years_before(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = udiv i32 %5, 4
%7 = load i32, i32* %2
%8 = udiv i32 %7, 100
%9 = sub i32 %6, %8
%10 = load i32, i32* %2
%11 = udiv i32 %10, 400
%12 = add i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_leap_years_before(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 2
%4 = udiv i32 %2, 100
%5 = sub nsw i32 %3, %4
%6 = udiv i32 %2, 400
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
char *strstr(char const *, char *);
void get_host_from_url(const char *url, const char **host, int *hostlen) {
  const char *rest;
  *host = strstr(url, "://");
  *host += 3;
  rest = strstr(*host, "/");
  *hostlen = rest - *host;
}


x86 assembly (clang, -O0):
<get_host_from_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x3,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xea8(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_host_from_url>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
lea    0xece(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,%rbx
add    $0x3,%rbx
mov    %rbx,(%r15)
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
sub    %ebx,%eax
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"://\00"
@.str.1 = [2 x i8] c"/\00"
define void @get_host_from_url(i8* %0, i8** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = call i8* @strstr(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = load i8**, i8*** %5
store i8* %9, i8** %10
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i64 3
store i8* %13, i8** %11
%14 = load i8**, i8*** %5
%15 = load i8*, i8** %14
%16 = call i8* @strstr(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %16, i8** %7
%17 = load i8*, i8** %7
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
%20 = ptrtoint i8* %17 to i64
%21 = ptrtoint i8* %19 to i64
%22 = sub i64 %20, %21
%23 = trunc i64 %22 to i32
%24 = load i32*, i32** %6
store i32 %23, i32* %24
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"://\00"
define void @get_host_from_url(i8* %0, i8** nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds i8, i8* %4, i64 3
store i8* %5, i8** %1
%6 = tail call i8* @strchr(i8* %5, i32 47)
%7 = ptrtoint i8* %6 to i64
%8 = ptrtoint i8* %5 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %2
ret void
}
/* Variables and functions */
char *getenv(char *);
char *mygetenv(char *variable, char *deflt) {
  char *value;
  value = getenv(variable);
  if (value == NULL || *value == '\0') {
    return (deflt);
  }
  return (value);
}


x86 assembly (clang, -O0):
<mygetenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1148 <mygetenv+0x38>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1155 <mygetenv+0x45>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <mygetenv+0x4d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mygetenv>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     1125 <mygetenv+0x15>
cmpb   $0x0,(%rax)
cmovne %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mygetenv(i8* %0, i8* %1) {
%3 = alloca i8*
%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 = call i8* @getenv(i8* %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp eq i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i8*, i8** %6
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11, %2
%17 = load i8*, i8** %5
store i8* %17, i8** %3
br label %20
18: ; preds = %11
%19 = load i8*, i8** %6
store i8* %19, i8** %3
br label %20
20: ; preds = %18, %16
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @mygetenv(i8* nocapture %0, i8* readnone %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i8* %1, i8* %3
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ %1, %2 ], [ %8, %5 ]
ret i8* %10
}
/* Variables and functions */
int foo(int, int);
int m;
main() {
  register m;
  m = foo(2, 3);
  return m;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x2,%edi
mov    $0x3,%esi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
@m = global i32 0
define i32 @main() {
%1 = tail call i32 @foo(i32 2, i32 3)
ret i32 %1
}
void pathunix(char *path) {
  int i;
  for (i = 0; path[i]; ++i)
    if (path[i] == '\\')
      path[i] = '/';
}


x86 assembly (clang, -O0):
<pathunix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1155 <pathunix+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    1142 <pathunix+0x42>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x2f,(%rax,%rcx,1)
jmp    1147 <pathunix+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <pathunix+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathunix>:
jmp    1117 <pathunix+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x2f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x5c,%al
je     1110 <pathunix+0x10>
test   %al,%al
jne    1113 <pathunix+0x13>
ret

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

LLVM IR (-O2):
define void @pathunix(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 92, label %6
]
6: ; preds = %2
store i8 47, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ M_E;
double pow(int /*<<< orphan*/, double);
double fn(double x) { return 1 + x + pow(M_E, x); }


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
push   %rax
movsd  0xee7(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
call   1030 <pow@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_E = global i32 0
define double @fn(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = load i32, i32* @M_E
%6 = load double, double* %2
%7 = call double @pow(i32 %5, double %6)
%8 = fadd double %4, %7
ret double %8
}

LLVM IR (-O2):
@M_E = global i32 0
define double @fn(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = load i32, i32* @M_E
%4 = tail call double @pow(i32 %3, double %0)
%5 = fadd double %2, %4
ret double %5
}
long version_adr(void) {
  extern char version[];
  return (long)version;
}


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

x86 assembly (clang, -O2):
<version_adr>:
mov    0x2ee1(%rip),%rax
ret

LLVM IR (-O0):
@version = external global [0 x i8]
define i64 @version_adr() {
ret i64 ptrtoint ([0 x i8]* @version to i64)
}

LLVM IR (-O2):
@version = external global [0 x i8]
define i64 @version_adr() {
ret i64 ptrtoint ([0 x i8]* @version to i64)
}