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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int DESBruteForceDecryptCL(uint64_t *output, uint32_t size, uint64_t key_start,
                           uint64_t data) {
  fprintf(stderr, "Unabled to open OpenCL Context.\n OpenCL Support was not "
                  "enabled at compile time\n");
  return 0;
}


x86 assembly (clang, -O0):
<DESBruteForceDecryptCL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESBruteForceDecryptCL>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [81 x i8] c"Unabled to open OpenCL Context.\0A OpenCL Support was not enabled at compile time\0A\00"
define i32 @DESBruteForceDecryptCL(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [81 x i8] c"Unabled to open OpenCL Context.\0A OpenCL Support was not enabled at compile time\0A\00"
define i32 @DESBruteForceDecryptCL(i32* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ io_program_out(int, int);
int /*<<< orphan*/ io_usleep(int);
void pic12_bulk_erase_program_memory(void) {
  io_program_out(0x09, 6);
  io_usleep((10000));
}


x86 assembly (clang, -O0):
<pic12_bulk_erase_program_memory>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
mov    $0x6,%esi
call   1040 <io_program_out@plt>
mov    $0x2710,%edi
call   1030 <io_usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic12_bulk_erase_program_memory>:
push   %rax
mov    $0x9,%edi
mov    $0x6,%esi
call   1040 <io_program_out@plt>
mov    $0x2710,%edi
pop    %rax
jmp    1030 <io_usleep@plt>

LLVM IR (-O0):
define void @pic12_bulk_erase_program_memory() {
%1 = call i32 @io_program_out(i32 9, i32 6)
%2 = call i32 @io_usleep(i32 10000)
ret void
}

LLVM IR (-O2):
define void @pic12_bulk_erase_program_memory() {
%1 = tail call i32 @io_program_out(i32 9, i32 6)
%2 = tail call i32 @io_usleep(i32 10000)
ret void
}
int fun338() { return 338; }


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

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

LLVM IR (-O0):
define i32 @fun338() {
ret i32 338
}

LLVM IR (-O2):
define i32 @fun338() {
ret i32 338
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
void cpyfile(FILE *input, FILE *output) {
  int ch = 0;
  rewind(input);
  rewind(output);
  while ((ch = fgetc(input)) != EOF) {
    fputc(ch, output);
  }
}


x86 assembly (clang, -O0):
<cpyfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e7c(%rip),%rcx
cmp    (%rcx),%eax
je     1185 <cpyfile+0x55>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <fputc@plt>
jmp    1159 <cpyfile+0x29>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpyfile>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <rewind@plt>
mov    %r14,%rdi
call   1030 <rewind@plt>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
mov    0x2e91(%rip),%r15
cmp    (%r15),%eax
je     1177 <cpyfile+0x47>
nopl   0x0(%rax)
mov    %eax,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    (%r15),%eax
jne    1160 <cpyfile+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @cpyfile(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%6 = load i32*, i32** %3
%7 = call i32 @rewind(i32* %6)
%8 = load i32*, i32** %4
%9 = call i32 @rewind(i32* %8)
br label %10
10: ; preds = %15, %2
%11 = load i32*, i32** %3
%12 = call i32 @fgetc(i32* %11)
store i32 %12, i32* %5
%13 = load i32, i32* @EOF
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = load i32, i32* %5
%17 = load i32*, i32** %4
%18 = call i32 @fputc(i32 %16, i32* %17)
br label %10
19: ; preds = %10
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @cpyfile(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @rewind(i32* %0)
%4 = tail call i32 @rewind(i32* %1)
%5 = tail call i32 @fgetc(i32* %0)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %14, label %8
8: ; preds = %2, %8
%9 = phi i32 [ %11, %8 ], [ %5, %2 ]
%10 = tail call i32 @fputc(i32 %9, i32* %1)
%11 = tail call i32 @fgetc(i32* %0)
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %8
14: ; preds = %8, %2
ret void
}
long long r2(void *x) { return *(long long *)(x + 32766); }


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

x86 assembly (clang, -O2):
<r2>:
mov    0x7ffe(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @r2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32766
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @r2(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32766
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ GenerateString(int, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  char *s1;
  scanf("%d", &x);
  s1 = (char *)malloc(sizeof(char) * (1 << (x - 1)));
  s1[0] = 'a';
  GenerateString(x, s1);
  printf("%s", s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x61,(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <GenerateString@plt>
mov    -0x10(%rbp),%rsi
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%cl
add    $0xff,%cl
mov    $0x1,%edi
shl    %cl,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movb   $0x61,(%rax)
mov    0xc(%rsp),%edi
mov    %rax,%rsi
call   1040 <GenerateString@plt>
lea    0xe81(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 1
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 97, i8* %14
%15 = load i32, i32* %2
%16 = load i8*, i8** %3
%17 = call i32 @GenerateString(i32 %15, i8* %16)
%18 = load i8*, i8** %3
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
%6 = shl nuw i32 1, %5
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
store i8 97, i8* %8
%9 = load i32, i32* %1
%10 = call i32 @GenerateString(i32 %9, i8* %8)
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}
int Kit_Float2Int(float Val) { return *((int *)&Val); }


x86 assembly (clang, -O0):
<Kit_Float2Int>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kit_Float2Int>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @Kit_Float2Int(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = bitcast float* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @Kit_Float2Int(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PCMPEQD(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x76);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


x86 assembly (clang, -O0):
<MMX_PCMPEQD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x76,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PCMPEQD>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x76,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PCMPEQD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 118)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_PCMPEQD(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 118)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
/* Variables and functions */
scalar_t__ memset(char *, char, int);
int /*<<< orphan*/ puts(char *);
void memsetTest() {
  char str[] = "almost every programmer should know memset!";
  puts((char *)memset(str, '-', 6));
}


x86 assembly (clang, -O0):
<memsetTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x2c,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x2d,%esi
mov    $0x6,%edx
call   1040 <memset@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memsetTest>:
sub    $0x38,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x2d,%esi
mov    $0x6,%edx
call   1040 <memset@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.memsetTest.str = [44 x i8] c"almost every programmer should know memset!\00"
define void @memsetTest() {
%1 = alloca [44 x i8]
%2 = bitcast [44 x i8]* %1 to i8*
%3 = getelementptr inbounds [44 x i8], [44 x i8]* %1, i64 0, i64 0
%4 = call i64 @memset(i8* %3, i8 signext 45, i32 6)
%5 = inttoptr i64 %4 to i8*
%6 = call i32 @puts(i8* %5)
ret void
}

LLVM IR (-O2):
@__const.memsetTest.str = [44 x i8] c"almost every programmer should know memset!\00"
define void @memsetTest() {
%1 = alloca [44 x i8]
%2 = getelementptr inbounds [44 x i8], [44 x i8]* %1, i64 0, i64 0
%3 = call i64 @memset(i8* %2, i8 signext 45, i32 6)
%4 = inttoptr i64 %3 to i8*
%5 = call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void online_menu(void) {
  printf("%s is a daemon intended to listen for API requests.\n\n"
         "Usage: %s [ -h | -v ] [ options ]\n\n",
         "rapiddisk"
         "d",
         "rapiddisk"
         "d");
  printf("Functions:\n"
         "\t-h\tPrint this exact help menu.\n"
         "\t-p\tChange port to listen on (default: 9118).\n"
         "\t-V\tEnable debug messages to stdout (this is ugly).\n"
         "\t-v\tPrint out version information.\n\n");
}


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

x86 assembly (clang, -O2):
<online_menu>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf2a(%rip),%rdx
mov    %rdx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf24(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [89 x i8] c"%s is a daemon intended to listen for API requests.\0A\0AUsage: %s [ -h | -v ] [ options ]\0A\0A\00"
@.str.1 = [11 x i8] c"rapiddiskd\00"
@.str.2 = [178 x i8] c"Functions:\0A\09-h\09Print this exact help menu.\0A\09-p\09Change port to listen on (default: 9118).\0A\09-V\09Enable debug messages to stdout (this is ugly).\0A\09-v\09Print out version information.\0A\0A\00"
define void @online_menu() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [89 x i8] c"%s is a daemon intended to listen for API requests.\0A\0AUsage: %s [ -h | -v ] [ options ]\0A\0A\00"
@.str.1 = [11 x i8] c"rapiddiskd\00"
@str = [177 x i8] c"Functions:\0A\09-h\09Print this exact help menu.\0A\09-p\09Change port to listen on (default: 9118).\0A\09-V\09Enable debug messages to stdout (this is ugly).\0A\09-v\09Print out version information.\0A\00"
define void @online_menu() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([177 x i8], [177 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ saa7114_write_reg(int, unsigned char);
int saa7114_set_decoder_saturation(unsigned char saturation) {
  saa7114_write_reg(0x0C, (unsigned char)(saturation >> 1));
  return (0);
}


x86 assembly (clang, -O0):
<saa7114_set_decoder_saturation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    $0xc,%edi
movzbl %al,%esi
call   1030 <saa7114_write_reg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saa7114_set_decoder_saturation>:
push   %rax
shr    %dil
movzbl %dil,%esi
mov    $0xc,%edi
call   1030 <saa7114_write_reg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @saa7114_set_decoder_saturation(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 1
%6 = trunc i32 %5 to i8
%7 = call i32 @saa7114_write_reg(i32 12, i8 zeroext %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @saa7114_set_decoder_saturation(i8 zeroext %0) {
%2 = lshr i8 %0, 1
%3 = tail call i32 @saa7114_write_reg(i32 12, i8 zeroext %2)
ret i32 0
}
double subtract(double left, double right) { return left - right; }


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

x86 assembly (clang, -O2):
<subtract>:
subsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @subtract(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ cegar1(int, int);
int main() {
  int x, y;
  cegar1(x, y);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @cegar1(i32 undef, i32 undef)
ret i32 0
}
/* Variables and functions */
int toupper(int);
int _irc_toupper(int c) {
  switch (c) {
  case '|':
    return '\\';
  default:
    return toupper(c);
  }
}


x86 assembly (clang, -O0):
<_irc_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x7c,%eax
jne    1138 <_irc_toupper+0x28>
jmp    112c <_irc_toupper+0x1c>
movl   $0x5c,-0x4(%rbp)
jmp    1143 <_irc_toupper+0x33>
mov    -0x8(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_irc_toupper>:
cmp    $0x7c,%edi
jne    111b <_irc_toupper+0xb>
mov    $0x5c,%eax
ret
jmp    1030 <toupper@plt>

LLVM IR (-O0):
define i32 @_irc_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 124, label %5
]
5: ; preds = %1
store i32 92, i32* %2
br label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @toupper(i32 %7)
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @_irc_toupper(i32 %0) {
%2 = icmp eq i32 %0, 124
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @toupper(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 92, %1 ]
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ yp_buf_len;
  int /*<<< orphan*/ yp_buf_val;
};
typedef TYPE_1__ yp_buf;
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ xdr_bytes(int /*<<< orphan*/ *, char **,
                             int /*<<< orphan*/ *, int /*<<< orphan*/);
bool_t xdr_yp_buf(XDR *xdrs, yp_buf *objp) {
  return xdr_bytes(xdrs, (char **)&objp->yp_buf_val, (u_int *)&objp->yp_buf_len,
                   ~0);
}


x86 assembly (clang, -O0):
<xdr_yp_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
mov    -0x10(%rbp),%rdx
mov    $0xffffffff,%ecx
call   1030 <xdr_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_yp_buf>:
mov    %rsi,%rdx
add    $0x4,%rsi
mov    $0xffffffff,%ecx
jmp    1030 <xdr_bytes@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
define i32 @xdr_yp_buf(i32* %0, %struct.TYPE_3__* %1) {
%3 = alloca i32*
%4 = alloca %struct.TYPE_3__*
store i32* %0, i32** %3
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %4
%5 = load i32*, i32** %3
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 1
%8 = bitcast i32* %7 to i8**
%9 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
%11 = call i32 @xdr_bytes(i32* %5, i8** %8, i32* %10, i32 -1)
ret i32 %11
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
define i32 @xdr_yp_buf(i32* %0, %struct.TYPE_3__* %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%4 = bitcast i32* %3 to i8**
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%6 = tail call i32 @xdr_bytes(i32* %0, i8** %4, i32* %5, i32 -1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ueBytesFromChar(char);
char *ueStrSeek(char *src, size_t n) {
  size_t i = 0;
  char *iter = src;
  for (i = 0; i < n; i++) {
    iter += ueBytesFromChar(iter[0]);
  }
  return iter;
}


x86 assembly (clang, -O0):
<ueStrSeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1173 <ueStrSeek+0x63>
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ueBytesFromChar@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <ueStrSeek+0x28>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ueStrSeek>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %rsi,%rsi
je     1133 <ueStrSeek+0x23>
mov    %rsi,%r14
nop
movsbl (%rbx),%edi
call   1030 <ueBytesFromChar@plt>
cltq
add    %rax,%rbx
add    $0xffffffffffffffff,%r14
jne    1120 <ueStrSeek+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ueStrSeek(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i64 [ %11, %4 ], [ 0, %2 ]
%7 = load i8, i8* %5
%8 = tail call i32 @ueBytesFromChar(i8 signext %7)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
%11 = add nuw i64 %6, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i8* [ %0, %2 ], [ %10, %4 ]
ret i8* %14
}
int test_imm_7Eint64_midword_reg(long long val) {
  return ((val >> 16) & (0x7E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Eint64_midword_reg>:
test   $0x7e0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Eint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 126
%6 = icmp ne i64 %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_7Eint64_midword_reg(i64 %0) {
%2 = and i64 %0, 8257536
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ Util_equal(double const, double const);
double fabs(double const);
int Util_about(const double tar, const double x) {
  if (Util_equal(tar, x))
    return 1;
  double err;
  err = fabs(x * 1.0e-10);
  return fabs(x - tar) <= err;
}


x86 assembly (clang, -O0):
<Util_about>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <Util_equal@plt>
cmp    $0x0,%rax
je     1147 <Util_about+0x37>
movl   $0x1,-0x4(%rbp)
jmp    118d <Util_about+0x7d>
movsd  0xec1(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movaps 0xea5(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movaps 0xe8b(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Util_about>:
sub    $0x28,%rsp
movsd  %xmm0,0x8(%rsp)
movaps %xmm1,0x10(%rsp)
call   1030 <Util_equal@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1136 <Util_about+0x26>
add    $0x28,%rsp
ret
movsd  0xec2(%rip),%xmm0
movapd 0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movapd 0xec0(%rip),%xmm1
andpd  %xmm1,%xmm0
subsd  0x8(%rsp),%xmm2
andpd  %xmm1,%xmm2
xor    %eax,%eax
ucomisd %xmm2,%xmm0
setae  %al
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @Util_about(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = load double, double* %5
%9 = call i64 @Util_equal(double %7, double %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %23
12: ; preds = %2
%13 = load double, double* %5
%14 = fmul double %13, 1.000000e-10
%15 = call double @llvm.fabs.f64(double %14)
store double %15, double* %6
%16 = load double, double* %5
%17 = load double, double* %4
%18 = fsub double %16, %17
%19 = call double @llvm.fabs.f64(double %18)
%20 = load double, double* %6
%21 = fcmp ole double %19, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %12, %11
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @Util_about(double %0, double %1) {
%3 = tail call i64 @Util_equal(double %0, double %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = fmul double %1, 1.000000e-10
%7 = tail call double @llvm.fabs.f64(double %6)
%8 = fsub double %1, %0
%9 = tail call double @llvm.fabs.f64(double %8)
%10 = fcmp ole double %9, %7
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %2, %5
%13 = phi i32 [ %11, %5 ], [ 1, %2 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ LOCK_EX;
int O_CREAT;
int O_RDWR;
int /*<<< orphan*/ flock(char *, int /*<<< orphan*/);
int open(char *, int, int);
int main() {
  int fd;
  fd = open("hello", O_RDWR | O_CREAT, 0664);
  if (fd > 0) {
    flock("hello", LOCK_EX);
  }
  int i;
  while (1) {
    ++i;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    0x2eb9(%rip),%rax
or     (%rax),%esi
lea    0xeb8(%rip),%rdi
mov    $0x1b4,%edx
call   1030 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1174 <main+0x54>
mov    0x2e72(%rip),%rax
mov    (%rax),%esi
lea    0xe91(%rip),%rdi
call   1040 <flock@plt>
jmp    1179 <main+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1179 <main+0x59>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xec6(%rip),%rdi
mov    $0x1b4,%edx
call   1030 <open@plt>
test   %eax,%eax
jle    1160 <main+0x40>
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
lea    0xea8(%rip),%rdi
call   1040 <flock@plt>
nopl   (%rax)
jmp    1160 <main+0x40>

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@LOCK_EX = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @O_RDWR
%5 = load i32, i32* @O_CREAT
%6 = or i32 %4, %5
%7 = call i32 @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6, i32 436)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i32, i32* @LOCK_EX
%12 = call i32 @flock(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %0
br label %14
14: ; preds = %13, %14
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %14
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@LOCK_EX = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_CREAT
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3, i32 436)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @LOCK_EX
%8 = tail call i32 @flock(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %0
br label %10
10: ; preds = %9, %10
br label %10
}
int intcmp(void *a, void *b, void *aux) { return (*((int *)a) - *((int *)b)); }


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

x86 assembly (clang, -O2):
<intcmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @intcmp(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = sub nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @intcmp(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = sub nsw i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ wait(int);
int main(void) {
  unsigned long i = 0;
  (*(volatile unsigned long *)0x56000010) =
      (1 << (5 * 2)) | (1 << (6 * 2)) | (1 << (7 * 2)) | (1 << (8 * 2));
  while (1) {
    wait(30000);
    (*(volatile unsigned long *)0x56000014) = (~(i << 5));
    if (++i == 16)
      i = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x56000010,%eax
movq   $0x15400,(%rax)
mov    $0x7530,%edi
call   1030 <wait@plt>
mov    -0x10(%rbp),%rcx
shl    $0x5,%rcx
xor    $0xffffffffffffffff,%rcx
mov    $0x56000014,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x10,%rax
jne    116f <main+0x5f>
movq   $0x0,-0x10(%rbp)
jmp    1133 <main+0x23>

x86 assembly (clang, -O2):
<main>:
push   %rbx
movq   $0x15400,0x56000010
xor    %ebx,%ebx
nop
mov    $0x7530,%edi
call   1030 <wait@plt>
mov    %rbx,%rax
shl    $0x5,%rax
not    %rax
mov    %rax,0x56000014
56
add    $0x1,%rbx
cmp    $0x10,%rbx
mov    $0x0,%eax
cmove  %rax,%rbx
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
store volatile i64 87040, i64* inttoptr (i64 1442840592 to i64*)
br label %3
3: ; preds = %0, %12
%4 = call i32 @wait(i32 30000)
%5 = load i64, i64* %2
%6 = shl i64 %5, 5
%7 = xor i64 %6, -1
store volatile i64 %7, i64* inttoptr (i64 1442840596 to i64*)
%8 = load i64, i64* %2
%9 = add i64 %8, 1
store i64 %9, i64* %2
%10 = icmp eq i64 %9, 16
br i1 %10, label %11, label %12
11: ; preds = %3
store i64 0, i64* %2
br label %12
12: ; preds = %11, %3
br label %3
}

LLVM IR (-O2):
define i32 @main() {
store volatile i64 87040, i64* inttoptr (i64 1442840592 to i64*)
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %8, %1 ]
%3 = tail call i32 @wait(i32 30000)
%4 = shl i64 %2, 5
%5 = xor i64 %4, -1
store volatile i64 %5, i64* inttoptr (i64 1442840596 to i64*)
%6 = add i64 %2, 1
%7 = icmp eq i64 %6, 16
%8 = select i1 %7, i64 0, i64 %6
br label %1
}
int Operand_xt_wbr15_label_decode(unsigned int *valp) {
  unsigned xt_wbr15_label_0, xt_wbr15_imm_0;
  xt_wbr15_imm_0 = *valp & 0x7fff;
  xt_wbr15_label_0 = 0x4 + (((int)xt_wbr15_imm_0 << 17) >> 17);
  *valp = xt_wbr15_label_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_xt_wbr15_label_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x7fff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x11,%eax
sar    $0x11,%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_xt_wbr15_label_decode>:
mov    (%rdi),%eax
shl    $0x11,%eax
sar    $0x11,%eax
add    $0x4,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_xt_wbr15_label_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 32767
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 %8, 17
%10 = ashr i32 %9, 17
%11 = add nsw i32 4, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = load i32*, i32** %2
store i32 %12, i32* %13
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_xt_wbr15_label_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 17
%4 = ashr exact i32 %3, 17
%5 = add nsw i32 %4, 4
store i32 %5, i32* %0
ret i32 0
}
void lib_debug_check(void) {}


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

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

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

LLVM IR (-O2):
define void @lib_debug_check() {
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int clock_gettime(int, struct timespec *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  struct timespec tp;
  if (clock_gettime(9999, &tp) == -1) {
    printf("Test PASSED\n");
    return 0;
  }
  printf("Test FAILED\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x270f,%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0xffffffff,%eax
jne    115e <main+0x3e>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1171 <main+0x51>
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rsi
mov    $0x270f,%edi
call   1040 <clock_gettime@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
setne  %bl
lea    0xec9(%rip),%rax
lea    0xeb6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@.str = [13 x i8] c"Test PASSED\0A\00"
@.str.1 = [13 x i8] c"Test FAILED\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
store i32 0, i32* %1
%3 = call i32 @clock_gettime(i32 9999, %struct.timespec* %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@str = [12 x i8] c"Test FAILED\00"
@str.2 = [12 x i8] c"Test PASSED\00"
define i32 @main() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = call i32 @clock_gettime(i32 9999, %struct.timespec* %1)
%4 = icmp eq i32 %3, -1
%5 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0)
%6 = xor i1 %4, true
%7 = zext i1 %6 to i32
%8 = call i32 @puts(i8* dereferenceable(1) %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
void C67_LDDW_SP_A0(int r) { C67_asm("LDDW.D *+SP[A0]", r, 0, 0); }


x86 assembly (clang, -O0):
<C67_LDDW_SP_A0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_LDDW_SP_A0>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"LDDW.D *+SP[A0]\00"
define void @C67_LDDW_SP_A0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @C67_asm(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"LDDW.D *+SP[A0]\00"
define void @C67_LDDW_SP_A0(i32 %0) {
%2 = tail call i32 @C67_asm(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
double chebeval(int, double const *, int);
double initial(double x) {
  const double a[10] = {-2.5595939371497115e-04, +7.0686844943148523e-04,
                        -1.2561575232566727e-03, +1.8047998427177896e-03,
                        -1.5614528129381411e-03, +1.3075424887128736e-03,
                        -1.0205255490737759e-02, +5.6520272597365064e-02,
                        -1.9133303566591867e-01, +2.3504865573520661e-01};
  return chebeval(10, a, 2 * x - 1);
}


x86 assembly (clang, -O0):
<initial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x50,%edx
call   1030 <memcpy@plt>
lea    -0x60(%rbp),%rsi
movsd  -0x8(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xea9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edx
mov    $0xa,%edi
call   1040 <chebeval@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initial>:
sub    $0x58,%rsp
movaps 0xf35(%rip),%xmm1
movaps %xmm1,0x40(%rsp)
movaps 0xf19(%rip),%xmm1
movaps %xmm1,0x30(%rsp)
movaps 0xefd(%rip),%xmm1
movaps %xmm1,0x20(%rsp)
movaps 0xee1(%rip),%xmm1
movaps %xmm1,0x10(%rsp)
movaps 0xec5(%rip),%xmm1
movaps %xmm1,(%rsp)
addsd  %xmm0,%xmm0
addsd  0xea5(%rip),%xmm0
cvttsd2si %xmm0,%edx
mov    %rsp,%rsi
mov    $0xa,%edi
call   1030 <chebeval@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.initial.a = [10 x double] [double 0xBF30C64939A0CB8E, double 0x3F4729A46FBA9CC7, double 0xBF5494B4DEC8E596, double 0x3F5D91E1133818AB, double 0xBF5995353103234D, double 0x3F556C3B0E89A98E, double 0xBF84E67E34A3EDA4, double 0x3FACF039A4BBBE85, double 0xBFC87D99D56A2DC9, double 0x3FCE161308ACFD24]
define double @initial(double %0) {
%2 = alloca double
%3 = alloca [10 x double]
store double %0, double* %2
%4 = bitcast [10 x double]* %3 to i8*
%5 = getelementptr inbounds [10 x double], [10 x double]* %3, i64 0, i64 0
%6 = load double, double* %2
%7 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %6, double -1.000000e+00)
%8 = fptosi double %7 to i32
%9 = call double @chebeval(i32 10, double* %5, i32 %8)
ret double %9
}

LLVM IR (-O2):
@__const.initial.a = [10 x double] [double 0xBF30C64939A0CB8E, double 0x3F4729A46FBA9CC7, double 0xBF5494B4DEC8E596, double 0x3F5D91E1133818AB, double 0xBF5995353103234D, double 0x3F556C3B0E89A98E, double 0xBF84E67E34A3EDA4, double 0x3FACF039A4BBBE85, double 0xBFC87D99D56A2DC9, double 0x3FCE161308ACFD24]
define double @initial(double %0) {
%2 = alloca [10 x double]
%3 = bitcast [10 x double]* %2 to i8*
%4 = getelementptr inbounds [10 x double], [10 x double]* %2, i64 0, i64 0
%5 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double -1.000000e+00)
%6 = fptosi double %5 to i32
%7 = call double @chebeval(i32 10, double* %4, i32 %6)
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void Sys_BeginStreamedFile(FILE *f, int readAhead) {}


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

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

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

LLVM IR (-O2):
define void @Sys_BeginStreamedFile(i32* nocapture %0, i32 %1) {
ret void
}
double dabs(double x) { return (x < 0.0) ? -x : x; }


x86 assembly (clang, -O0):
<dabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <dabs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <dabs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @dabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @dabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ plainstring_add(struct plainstring *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void plainstring_add_int(struct plainstring *this_string, int value) {
  char buffer[0xFF];
  sprintf(buffer, "%i", value);
  plainstring_add(this_string, buffer);
}


x86 assembly (clang, -O0):
<plainstring_add_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xebd(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1040 <plainstring_add@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plainstring_add_int>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xeca(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <plainstring_add@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.plainstring = type { i32 }
@.str = [3 x i8] c"%i\00"
define void @plainstring_add_int(%struct.plainstring* %0, i32 %1) {
%3 = alloca %struct.plainstring*
%4 = alloca i32
%5 = alloca [255 x i8]
store %struct.plainstring* %0, %struct.plainstring** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load %struct.plainstring*, %struct.plainstring** %3
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i32 @plainstring_add(%struct.plainstring* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
@.str = [3 x i8] c"%i\00"
define void @plainstring_add_int(%struct.plainstring* %0, i32 %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @plainstring_add(%struct.plainstring* %0, i8* %4)
ret void
}
void event_active(struct event *ev, int res, short ncalls) {
  (void)ev;
  (void)res;
  (void)ncalls;
}


x86 assembly (clang, -O0):
<event_active>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.event = type opaque
define void @event_active(%struct.event* %0, i32 %1, i16 signext %2) {
%4 = alloca %struct.event*
%5 = alloca i32
%6 = alloca i16
store %struct.event* %0, %struct.event** %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%7 = load %struct.event*, %struct.event** %4
%8 = load i32, i32* %5
%9 = load i16, i16* %6
ret void
}

LLVM IR (-O2):
%struct.event = type opaque
define void @event_active(%struct.event* nocapture %0, i32 %1, i16 signext %2) {
ret void
}