xunge/DecIR huggingface dataset:
void test_three(int x, int y) {
#pragma omp target
#pragma omp teams distribute collapse(1)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_three>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_three+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_three+0x43>
jmp    1135 <test_three+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_three+0x24>
jmp    1148 <test_three+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_three+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_three(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int set_process_group(int /*<<< orphan*/, int /*<<< orphan*/);
int new_process_group(void) { return set_process_group(0, getpid()); }


x86 assembly (clang, -O0):
<new_process_group>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <set_process_group@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_process_group>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <set_process_group@plt>

LLVM IR (-O0):
define i32 @new_process_group() {
%1 = call i32 (...) @getpid()
%2 = call i32 @set_process_group(i32 0, i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @new_process_group() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @set_process_group(i32 0, i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int cmd_encrypt(int argc, const char **argv) { printf("%s\n", argv[1]); }


x86 assembly (clang, -O0):
<cmd_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_encrypt>:
mov    0x8(%rsi),%rsi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @cmd_encrypt(i32 %0, i8** %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 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @cmd_encrypt(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 undef
}
/* Variables and functions */
int gpio_get_value(int);
int smart_gpio_get_value(int gpio_num) {
  if (gpio_num == -1) {
    return 0x10;
  }
  return gpio_get_value(gpio_num);
}


x86 assembly (clang, -O0):
<smart_gpio_get_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1131 <smart_gpio_get_value+0x21>
movl   $0x10,-0x4(%rbp)
jmp    113c <smart_gpio_get_value+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <gpio_get_value@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smart_gpio_get_value>:
cmp    $0xffffffff,%edi
je     111a <smart_gpio_get_value+0xa>
jmp    1030 <gpio_get_value@plt>
mov    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @smart_gpio_get_value(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 16, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @gpio_get_value(i32 %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @smart_gpio_get_value(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @gpio_get_value(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 16, %1 ]
ret i32 %6
}
/* Type definitions */
struct vec3i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec3i_negative(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
__attribute__((always_)) struct vec3i *psvec3i_negative(struct vec3i *result,
                                                        struct vec3i *a) {
  vec3i_negative((int32_t *)result, (int32_t *)a);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec3i_negative>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3i_negative@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_negative(%struct.vec3i* %0, %struct.vec3i* %1) {
%3 = alloca %struct.vec3i*
%4 = alloca %struct.vec3i*
store %struct.vec3i* %0, %struct.vec3i** %3
store %struct.vec3i* %1, %struct.vec3i** %4
%5 = load %struct.vec3i*, %struct.vec3i** %3
%6 = bitcast %struct.vec3i* %5 to i32*
%7 = load %struct.vec3i*, %struct.vec3i** %4
%8 = bitcast %struct.vec3i* %7 to i32*
%9 = call i32 @vec3i_negative(i32* %6, i32* %8)
%10 = load %struct.vec3i*, %struct.vec3i** %3
ret %struct.vec3i* %10
}

LLVM IR (-O2):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_negative(%struct.vec3i* returned %0, %struct.vec3i* %1) {
%3 = getelementptr %struct.vec3i, %struct.vec3i* %0, i64 0, i32 0
%4 = getelementptr %struct.vec3i, %struct.vec3i* %1, i64 0, i32 0
%5 = tail call i32 @vec3i_negative(i32* %3, i32* %4)
ret %struct.vec3i* %0
}
int test(int a, int b, int c, int g) {
  int d, e;
  if (a)
    d = b * c;
  else
    d = b - c;
  e = b * c + g;
  return d + e;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1129 <test+0x29>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <test+0x32>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %edx,%eax
imul   %esi,%eax
sub    %edx,%esi
test   %edi,%edi
cmovne %eax,%esi
add    %ecx,%eax
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, 0
%6 = mul nsw i32 %2, %1
%7 = sub nsw i32 %1, %2
%8 = select i1 %5, i32 %7, i32 %6
%9 = add nsw i32 %6, %3
%10 = add nsw i32 %9, %8
ret i32 %10
}
void av_format_get_audio_codec() {}


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

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

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

LLVM IR (-O2):
define void @av_format_get_audio_codec() {
ret void
}
void cpuid(long a, long *s) {}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @cpuid(i64 %0, i64* nocapture %1) {
ret void
}
unsigned char testFuncStatementbool2(unsigned char bool1, unsigned char bool2) {
  return (bool1 || bool2);
}


x86 assembly (clang, -O0):
<testFuncStatementbool2>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x3(%rbp)
jne    112f <testFuncStatementbool2+0x2f>
movzbl -0x2(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFuncStatementbool2>:
or     %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define zeroext i8 @testFuncStatementbool2(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8, i8* %4
%10 = zext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ true, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @testFuncStatementbool2(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = icmp ne i8 %3, 0
%5 = zext i1 %4 to i8
ret i8 %5
}
void nand_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @nand_init() {
ret void
}
int get_ce_offset() {
  if (0 == 0) {
    return 24;
  } else {
    return 21;
  }
}


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

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

LLVM IR (-O0):
define i32 @get_ce_offset() {
ret i32 24
}

LLVM IR (-O2):
define i32 @get_ce_offset() {
ret i32 24
}
void SleepMsTime(int millisecTime) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ munmap(void *, int);
void dma_page_free(void *buffer, const uint32_t size) {
  uint32_t pages = (size / (1 << 12)) + 1;
  munmap(buffer, pages * (1 << 12));
}


x86 assembly (clang, -O0):
<dma_page_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x1000,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
shl    $0xc,%esi
call   1030 <munmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dma_page_free>:
lea    0xfff(%rsi),%eax
test   %esi,%esi
cmovs  %eax,%esi
and    $0xfffff000,%esi
add    $0x1000,%esi
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define void @dma_page_free(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 4096
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 4096
%12 = call i32 @munmap(i8* %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @dma_page_free(i8* %0, i32 %1) {
%3 = sdiv i32 %1, 4096
%4 = shl nsw i32 %3, 12
%5 = add i32 %4, 4096
%6 = tail call i32 @munmap(i8* %0, i32 %5)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void print_int32_t(int32_t m) { fprintf(stderr, "%d", m); }


x86 assembly (clang, -O0):
<print_int32_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int32_t>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%d\00"
define void @print_int32_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%d\00"
define void @print_int32_t(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int fz_lighten_byte(int bd, int s) { return ((bd) > (s) ? (bd) : (s)); }


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

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

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

LLVM IR (-O2):
define i32 @fz_lighten_byte(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int is_prime(int n) {
  if (n < 2)
    return 0;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    111d <is_prime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    116a <is_prime+0x6a>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1163 <is_prime+0x63>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1150 <is_prime+0x50>
movl   $0x0,-0x4(%rbp)
jmp    116a <is_prime+0x6a>
jmp    1155 <is_prime+0x55>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <is_prime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     113c <is_prime+0x3c>
mov    $0x1,%eax
cmp    $0x4,%edi
jb     113c <is_prime+0x3c>
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1135 <is_prime+0x35>
add    $0x1,%ecx
mov    %ecx,%eax
imul   %ecx,%eax
cmp    %edi,%eax
jle    1120 <is_prime+0x20>
xor    %eax,%eax
test   %edx,%edx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 4
br i1 %4, label %16, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 2, %3 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
%10 = mul nsw i32 %9, %9
%11 = icmp sgt i32 %10, %0
%12 = select i1 %8, i1 true, i1 %11
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = xor i1 %8, true
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %3, %13, %1
%17 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %15, %13 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ sdsdotsub(int const *, float const *, float const *,
                             int const *, float const *, int const *, float *);
float c_sdsdot(const int N, const float scalar, const float *X,
               const int strideX, const float *Y, const int strideY) {
  float dot;
  sdsdotsub(&N, &scalar, X, &strideX, Y, &strideY, &dot);
  return dot;
}


x86 assembly (clang, -O0):
<c_sdsdot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
lea    -0x24(%rbp),%r9
lea    -0x28(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <sdsdotsub@plt>
movss  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_sdsdot>:
sub    $0x28,%rsp
mov    %rcx,%r10
mov    %rsi,%rax
mov    %edi,0x24(%rsp)
movss  %xmm0,0x20(%rsp)
mov    %edx,0x1c(%rsp)
mov    %r8d,0x18(%rsp)
lea    0x14(%rsp),%rcx
mov    %rcx,(%rsp)
lea    0x24(%rsp),%rdi
lea    0x20(%rsp),%rsi
lea    0x1c(%rsp),%rcx
lea    0x18(%rsp),%r9
mov    %rax,%rdx
mov    %r10,%r8
call   1030 <sdsdotsub@plt>
movss  0x14(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @c_sdsdot(i32 %0, float %1, float* %2, i32 %3, float* %4, i32 %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float*
%10 = alloca i32
%11 = alloca float*
%12 = alloca i32
%13 = alloca float
store i32 %0, i32* %7
store float %1, float* %8
store float* %2, float** %9
store i32 %3, i32* %10
store float* %4, float** %11
store i32 %5, i32* %12
%14 = load float*, float** %9
%15 = load float*, float** %11
%16 = call i32 @sdsdotsub(i32* %7, float* %8, float* %14, i32* %10, float* %15, i32* %12, float* %13)
%17 = load float, float* %13
ret float %17
}

LLVM IR (-O2):
define float @c_sdsdot(i32 %0, float %1, float* %2, i32 %3, float* %4, i32 %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
store i32 %0, i32* %7
store float %1, float* %8
store i32 %3, i32* %9
store i32 %5, i32* %10
%12 = bitcast float* %11 to i8*
%13 = call i32 @sdsdotsub(i32* %7, float* %8, float* %2, i32* %9, float* %4, i32* %10, float* %11)
%14 = load float, float* %11
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int idade;
  scanf("%d", &idade);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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)
ret i32 0
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int c;
  if ((c = getchar()) != EOF) {
    main();
    printf("%c", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     116c <main+0x3c>
call   1050 <main@plt>
mov    -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
mov    0x2ea7(%rip),%rax
cmp    (%rax),%ebx
je     1158 <main+0x28>
call   1050 <main@plt>
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %4, label %5
4: ; preds = %0, %5
ret i32 0
5: ; preds = %0
%6 = tail call i32 @main()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %4
}
__attribute__((no, noclone)) short foo9(short arg) {
  short ret = -1;
  if (arg + 1 < 1 || arg + 1 > ((!1) ? ((1L << (sizeof(char) * 8 - 1)) - 1)
                                     : ((1L << (sizeof(char) * 8)) - 1)) -
                                   1)
    return ret;
  arg = arg + -1;
  ret = (unsigned char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo9>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0xffff,-0x6(%rbp)
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x1,%eax
jl     1136 <foo9+0x36>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0xfe,%rax
jle    1143 <foo9+0x43>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1161 <foo9+0x61>
movswl -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movzbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo9>:
movzwl %di,%eax
lea    -0x1(%rdi),%ecx
cmp    $0xfe,%eax
mov    $0xffff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i16 @foo9(i16 signext %0) {
%2 = icmp ugt i16 %0, 253
%3 = add i16 %0, -1
%4 = select i1 %2, i16 -1, i16 %3
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ my_putstr(char *);
int main(int argc, char **argv) {
  my_putstr("We admit defeat\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"We admit defeat\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @my_putstr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"We admit defeat\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @my_putstr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ e1();
void f1() { e1(); }


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

x86 assembly (clang, -O2):
<f1>:
xor    %eax,%eax
jmp    1030 <e1@plt>

LLVM IR (-O0):
define void @f1() {
%1 = call i32 (...) @e1()
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = tail call i32 (...) @e1()
ret void
}
void *test_anti_range_111(short n) {
  extern void *alloc_anti_range_111(short) __attribute__((alloc_size(1)));
  if ((-0x7fff - 1) + 2 <= n && n <= -1)
    n = (-0x7fff - 1) + 2 - 1;
  return alloc_anti_range_111(n);
}


x86 assembly (clang, -O0):
<test_anti_range_111>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0xffff8002,%eax
cmp    %ecx,%eax
jg     1143 <test_anti_range_111+0x33>
movswl -0x2(%rbp),%eax
cmp    $0xffffffff,%eax
jg     1143 <test_anti_range_111+0x33>
movw   $0x8001,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_111@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_111>:
movzwl %di,%eax
cmp    $0x8001,%eax
mov    $0x8001,%eax
cmovb  %edi,%eax
movswl %ax,%edi
jmp    1030 <alloc_anti_range_111@plt>

LLVM IR (-O0):
define i8* @test_anti_range_111(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 -32766, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -32767, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_111(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_111(i16 signext %0) {
%2 = icmp ult i16 %0, -32767
%3 = select i1 %2, i16 %0, i16 -32767
%4 = tail call i8* @alloc_anti_range_111(i16 signext %3)
ret i8* %4
}
double max(double a, double b) { return (a >= b ? a : b); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     112d <max+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <max+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @max(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 = fcmp oge double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exp(double);
double log1p(int /*<<< orphan*/);
double log1p_exp(double a) {
  if (a > 0.0)
    return a + log1p(exp(-a));
  return log1p(exp(a));
}


x86 assembly (clang, -O0):
<log1p_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1187 <log1p_exp+0x67>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    %eax,%edi
call   1040 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119d <log1p_exp+0x7d>
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
mov    %eax,%edi
call   1040 <log1p@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log1p_exp>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jbe    1159 <log1p_exp+0x39>
movapd 0xec6(%rip),%xmm0
xorpd  %xmm1,%xmm0
movapd %xmm1,(%rsp)
call   1030 <exp@plt>
mov    %eax,%edi
call   1040 <log1p@plt>
addsd  (%rsp),%xmm0
add    $0x18,%rsp
ret
movapd %xmm1,%xmm0
call   1030 <exp@plt>
mov    %eax,%edi
add    $0x18,%rsp
jmp    1040 <log1p@plt>

LLVM IR (-O0):
define double @log1p_exp(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fneg double %8
%10 = call i32 @exp(double %9)
%11 = call double @log1p(i32 %10)
%12 = fadd double %7, %11
store double %12, double* %2
br label %17
13: ; preds = %1
%14 = load double, double* %3
%15 = call i32 @exp(double %14)
%16 = call double @log1p(i32 %15)
store double %16, double* %2
br label %17
17: ; preds = %13, %6
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @log1p_exp(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fneg double %0
%5 = tail call i32 @exp(double %4)
%6 = tail call double @log1p(i32 %5)
%7 = fadd double %6, %0
br label %11
8: ; preds = %1
%9 = tail call i32 @exp(double %0)
%10 = tail call double @log1p(i32 %9)
br label %11
11: ; preds = %8, %3
%12 = phi double [ %7, %3 ], [ %10, %8 ]
ret double %12
}
/* Variables and functions */
int strcmp(char *, char *);
int membcmp(const void *a, const void *b) {
  return strcmp(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<membcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @membcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @membcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void INT_Excep_IRQ3(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_IRQ3() {
ret void
}
void delay(unsigned long count) {
  while (count--)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     1126 <delay+0x26>
jmp    1108 <delay+0x8>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %7, %1
%4 = load i64, i64* %2
%5 = add i64 %4, -1
store i64 %5, i64* %2
%6 = icmp ne i64 %4, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay(i64 %0) {
ret void
}
int floppy_get_status(void) {
  unsigned char c = ({
    unsigned char _v;
    __asm__ __volatile__("inb %%dx,%%al" : "=a"(_v) : "d"(0x1F7));
    _v;
  });
  return c;
}


x86 assembly (clang, -O0):
<floppy_get_status>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f7,%edx
in     (%dx),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floppy_get_status>:
mov    $0x1f7,%edx
in     (%dx),%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @floppy_get_status() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = call i8 asm sideeffect "inb %dx,%al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 503)
store i8 %4, i8* %2
%5 = load i8, i8* %2
store i8 %5, i8* %3
%6 = load i8, i8* %3
store i8 %6, i8* %1
%7 = load i8, i8* %1
%8 = zext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @floppy_get_status() {
%1 = tail call i8 asm sideeffect "inb %dx,%al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 503)
%2 = zext i8 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_lrintl();
scalar_t__ lrintl(long double);
void test_lrintl(long double ld) {
  if (lrintl(ld) != lrintl(ld))
    link_failure_lrintl();
}


x86 assembly (clang, -O0):
<test_lrintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <lrintl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <lrintl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_lrintl+0x43>
mov    $0x0,%al
call   1040 <link_failure_lrintl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lrintl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <lrintl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <lrintl@plt>
cmp    %rax,%rbx
jne    1151 <test_lrintl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_lrintl@plt>

LLVM IR (-O0):
define void @test_lrintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @lrintl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @lrintl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_lrintl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_lrintl(x86_fp80 %0) {
%2 = tail call i64 @lrintl(x86_fp80 %0)
%3 = tail call i64 @lrintl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_lrintl()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
struct timeval dtotv(double d) {
  struct timeval tv;
  tv.tv_sec = (long)d;
  tv.tv_usec = (long)((d - (double)tv.tv_sec) * 1000000.0);
  return (tv);
}


x86 assembly (clang, -O0):
<dtotv>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtotv>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xeea(%rip),%xmm0
cvttsd2si %xmm0,%rdx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define { i64, i64 } @dtotv(double %0) {
%2 = alloca %struct.timeval
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fptosi double %4 to i64
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store i64 %5, i64* %6
%7 = load double, double* %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fsub double %7, %10
%12 = fmul double %11, 1.000000e+06
%13 = fptosi double %12 to i64
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store i64 %13, i64* %14
%15 = bitcast %struct.timeval* %2 to { i64, i64 }*
%16 = load { i64, i64 }, { i64, i64 }* %15
ret { i64, i64 } %16
}

LLVM IR (-O2):
define { i64, i64 } @dtotv(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fmul double %4, 1.000000e+06
%6 = fptosi double %5 to i64
%7 = insertvalue { i64, i64 } poison, i64 %2, 0
%8 = insertvalue { i64, i64 } %7, i64 %6, 1
ret { i64, i64 } %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void NEditFree(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<NEditFree>:
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):
<NEditFree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @NEditFree(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 @NEditFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int reallybad(int z) {
#pragma critTer : 10 : resources / functionName.c:
  return 1;
#pragma critTer : 11 : resources / functionName.c:
}


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

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

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

LLVM IR (-O2):
define i32 @reallybad(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef int volatile uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t UARTTxIntModeGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint16_t *)(ui32Base + 0xA))) & 0x0000001F);
}


x86 assembly (clang, -O0):
<UARTTxIntModeGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
cltq
mov    (%rax),%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTTxIntModeGet>:
mov    %edi,-0x4(%rsp)
movslq -0x4(%rsp),%rax
mov    0xa(%rax),%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @UARTTxIntModeGet(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = add nsw i32 %3, 10
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 31
ret i32 %8
}

LLVM IR (-O2):
define i32 @UARTTxIntModeGet(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = add nsw i32 %3, 10
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 31
ret i32 %8
}
/* Variables and functions */
float __cosf(float);
float __sinf(float);
void sincosf(float x, float *s, float *c) {
  *s = __sinf(x);
  *c = __cosf(x);
}


x86 assembly (clang, -O0):
<sincosf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__sinf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x4(%rbp),%xmm0
call   1040 <__cosf@plt>
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincosf>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movss  %xmm0,0x4(%rsp)
call   1030 <__sinf@plt>
movss  %xmm0,(%rbx)
movss  0x4(%rsp),%xmm0
call   1040 <__cosf@plt>
movss  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sincosf(float %0, float* %1, float* %2) {
%4 = alloca float
%5 = alloca float*
%6 = alloca float*
store float %0, float* %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = call float @__sinf(float %7)
%9 = load float*, float** %5
store float %8, float* %9
%10 = load float, float* %4
%11 = call float @__cosf(float %10)
%12 = load float*, float** %6
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @sincosf(float %0, float* nocapture writeonly %1, float* nocapture writeonly %2) {
%4 = tail call float @__sinf(float %0)
store float %4, float* %1
%5 = tail call float @__cosf(float %0)
store float %5, float* %2
ret void
}
/* Variables and functions */
int printf(char *, char const *, char const *, int);
int call(const char *a, const char *b) {
  int localvar = (int)(b - a);
  return printf("%s %s %d\n", a, b, localvar);
}


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

x86 assembly (clang, -O2):
<call>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %edx,%ecx
sub    %esi,%ecx
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s %s %d\0A\00"
define i32 @call(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s %s %d\0A\00"
define i32 @call(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %6)
ret i32 %7
}
void module_tr(char *modname) {
  char *ptr;
  for (ptr = modname; *ptr != '\0'; ptr++) {
    if (*ptr == '-')
      *ptr = '_';
  }
}


x86 assembly (clang, -O0):
<module_tr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <module_tr+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1137 <module_tr+0x37>
mov    -0x10(%rbp),%rax
movb   $0x5f,(%rax)
jmp    113c <module_tr+0x3c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <module_tr+0x10>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @module_tr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %18, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 45
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i8*, i8** %3
store i8 95, i8* %16
br label %17
17: ; preds = %15, %10
br label %18
18: ; preds = %17
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %5
21: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @module_tr(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 45, label %5
]
5: ; preds = %2
store i8 95, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int ENXIO;
__attribute__((deprecated)) int
snd_device_name_hint(int card, const char *iface, void ***hints) {
  return -ENXIO;
}


x86 assembly (clang, -O0):
<snd_device_name_hint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ec8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<snd_device_name_hint>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @snd_device_name_hint(i32 %0, i8* %1, i8*** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8***
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8*** %2, i8**** %6
%7 = load i32, i32* @ENXIO
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @snd_device_name_hint(i32 %0, i8* nocapture readnone %1, i8*** nocapture readnone %2) {
%4 = load i32, i32* @ENXIO
%5 = sub nsw i32 0, %4
ret i32 %5
}