xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void __attribute__((destructor)) fini(void) { putchar('4'); }


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

x86 assembly (clang, -O2):
<fini>:
mov    $0x34,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = call i32 @putchar(i8 signext 52)
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fini, i8* null }]
define void @fini() {
%1 = tail call i32 @putchar(i8 signext 52)
ret void
}
/* Variables and functions */
char *getStatusText(int const);
int openFile(char *);
int /*<<< orphan*/ printf(char *, ...);
int openFile_log(char filename[]) {
  const int status = openFile(filename);
  printf("OPEN FILE \"%s\": %s\n", filename, getStatusText(status));
  if (status >= 0)
    printf("OFT INDEX: %d\n", status);
  return status;
}


x86 assembly (clang, -O0):
<openFile_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <openFile@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <getStatusText@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jl     1188 <openFile_log+0x58>
mov    -0xc(%rbp),%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openFile_log>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <openFile@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <getStatusText@plt>
lea    0xeb4(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
js     116d <openFile_log+0x3d>
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"OPEN FILE \22%s\22: %s\0A\00"
@.str.1 = [15 x i8] c"OFT INDEX: %d\0A\00"
define i32 @openFile_log(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @openFile(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i8* @getStatusText(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8)
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32, i32* %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [20 x i8] c"OPEN FILE \22%s\22: %s\0A\00"
@.str.1 = [15 x i8] c"OFT INDEX: %d\0A\00"
define i32 @openFile_log(i8* %0) {
%2 = tail call i32 @openFile(i8* %0)
%3 = tail call i8* @getStatusText(i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%5 = icmp sgt i32 %2, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %2)
br label %8
8: ; preds = %6, %1
ret i32 %2
}
/* Variables and functions */
int max(int *, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a[] = {1, 2, 3, 4, 5, 9, 7};
  printf("%d", max(a, 7));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1040 <max@plt>
mov    %eax,%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1040 <max@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 9, i32 7]
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @max(i32* %3, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@__const.main.a = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 9, i32 7]
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @max(i32* %3, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int getgrgid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getgrgid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void isaac_free(void *mem) {
  if (mem)
    free(mem);
  mem = NULL;
}


x86 assembly (clang, -O0):
<isaac_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <isaac_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @isaac_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ nrf_802154_swi_notify_transmitted(int /*<<< orphan*/ const *,
                                                     int /*<<< orphan*/ *,
                                                     int /*<<< orphan*/,
                                                     int /*<<< orphan*/);
void nrf_802154_notify_transmitted(const uint8_t *p_frame, uint8_t *p_ack,
                                   int8_t power, int8_t lqi) {
  nrf_802154_swi_notify_transmitted(p_frame, p_ack, power, lqi);
}


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

x86 assembly (clang, -O2):
<nrf_802154_notify_transmitted>:
jmp    1030 <nrf_802154_swi_notify_transmitted@plt>

LLVM IR (-O0):
define void @nrf_802154_notify_transmitted(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** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @nrf_802154_swi_notify_transmitted(i32* %9, i32* %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @nrf_802154_notify_transmitted(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @nrf_802154_swi_notify_transmitted(i32* %0, i32* %1, i32 %2, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_and_ps(int /*<<< orphan*/ const,
                              int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_andnot_ps(int /*<<< orphan*/ const,
                                 int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_or_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 applyMask_ps(const __m128 i_mask, const __m128 i_then,
                    const __m128 i_else) {
  return _mm_or_ps(_mm_and_ps(i_mask, i_then), _mm_andnot_ps(i_mask, i_else));
}


x86 assembly (clang, -O0):
<applyMask_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <_mm_and_ps@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <_mm_andnot_ps@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_or_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<applyMask_ps>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %edi,%ebp
call   1050 <_mm_and_ps@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <_mm_andnot_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <_mm_or_ps@plt>

LLVM IR (-O0):
define i32 @applyMask_ps(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @_mm_and_ps(i32 %7, i32 %8)
%10 = load i32, i32* %4
%11 = load i32, i32* %6
%12 = call i32 @_mm_andnot_ps(i32 %10, i32 %11)
%13 = call i32 @_mm_or_ps(i32 %9, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @applyMask_ps(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_mm_and_ps(i32 %0, i32 %1)
%5 = tail call i32 @_mm_andnot_ps(i32 %0, i32 %2)
%6 = tail call i32 @_mm_or_ps(i32 %4, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ confirm_array_is_sorted(int *, int);
int *copy_array(int *, int);
int /*<<< orphan*/ finish();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ selection_sort(int *, int);
int /*<<< orphan*/ start();
void test_selection_sort(int *original, int size) {
  int *array = copy_array(original, size);
  puts("---------- selection sort");
  start();
  selection_sort(array, size);
  finish();
  confirm_array_is_sorted(array, size);
}


x86 assembly (clang, -O0):
<test_selection_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <copy_array@plt>
mov    %rax,-0x18(%rbp)
lea    0xe7a(%rip),%rdi
call   1050 <puts@plt>
mov    $0x0,%al
call   1060 <start@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <selection_sort@plt>
mov    $0x0,%al
call   1040 <finish@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <confirm_array_is_sorted@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_selection_sort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
call   1070 <copy_array@plt>
mov    %rax,%r14
lea    0xe8b(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1060 <start@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <selection_sort@plt>
xor    %eax,%eax
call   1040 <finish@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1080 <confirm_array_is_sorted@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"---------- selection sort\00"
define void @test_selection_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32* @copy_array(i32* %6, i32 %7)
store i32* %8, i32** %5
%9 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @start()
%11 = load i32*, i32** %5
%12 = load i32, i32* %4
%13 = call i32 @selection_sort(i32* %11, i32 %12)
%14 = call i32 (...) @finish()
%15 = load i32*, i32** %5
%16 = load i32, i32* %4
%17 = call i32 @confirm_array_is_sorted(i32* %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"---------- selection sort\00"
define void @test_selection_sort(i32* %0, i32 %1) {
%3 = tail call i32* @copy_array(i32* %0, i32 %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @start()
%6 = tail call i32 @selection_sort(i32* %3, i32 %1)
%7 = tail call i32 (...) @finish()
%8 = tail call i32 @confirm_array_is_sorted(i32* %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int val;
  scanf("%d", &val);
  printf("%d\n", val / 2);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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)
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 = sdiv i32 %4, 2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t FlashCheckFsmForReady(void) {
  if ((*((volatile unsigned long *)(0x40030000 + 0x0000001C))) & 0x00000002) {
    return (0x00000001);
  } else {
    return (0x00000002);
  }
}


x86 assembly (clang, -O0):
<FlashCheckFsmForReady>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4003001c,%eax
mov    (%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
je     1126 <FlashCheckFsmForReady+0x26>
movl   $0x1,-0x4(%rbp)
jmp    112d <FlashCheckFsmForReady+0x2d>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashCheckFsmForReady>:
mov    0x4003001c,%rax
40
and    $0x2,%eax
cmp    $0x1,%rax
mov    $0x1,%eax
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @FlashCheckFsmForReady() {
%1 = alloca i32
%2 = load volatile i64, i64* inttoptr (i64 1073938460 to i64*)
%3 = and i64 %2, 2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 2, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @FlashCheckFsmForReady() {
%1 = load volatile i64, i64* inttoptr (i64 1073938460 to i64*)
%2 = and i64 %1, 2
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 2, i32 1
ret i32 %4
}
unsigned long rdpmc(unsigned n) {
  unsigned a, d, c;
  c = n;
  __asm__ volatile("rdpmc" : "=a"(a), "=d"(d) : "c"(c));
  return ((unsigned long)a) | (((unsigned long)d) << 32);
  ;
}


x86 assembly (clang, -O0):
<rdpmc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
rdpmc
mov    %eax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x20,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdpmc>:
mov    %edi,%ecx
rdpmc
mov    %eax,%eax
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdpmc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = call { i32, i32 } asm sideeffect "rdpmc", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %7)
%9 = extractvalue { i32, i32 } %8, 0
%10 = extractvalue { i32, i32 } %8, 1
store i32 %9, i32* %3
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
%13 = load i32, i32* %4
%14 = zext i32 %13 to i64
%15 = shl i64 %14, 32
%16 = or i64 %12, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @rdpmc(i32 %0) {
%2 = tail call { i32, i32 } asm sideeffect "rdpmc", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32 } %2, 0
%4 = extractvalue { i32, i32 } %2, 1
%5 = zext i32 %3 to i64
%6 = zext i32 %4 to i64
%7 = shl nuw i64 %6, 32
%8 = or i64 %7, %5
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void hexerr() {
  fprintf(stderr, "Illegal character in hex number\n");
  exit(1);
}


x86 assembly (clang, -O0):
<hexerr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<hexerr>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Illegal character in hex number\0A\00"
define void @hexerr() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Illegal character in hex number\0A\00"
define void @hexerr() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t FlashCheckFsmForError(void) {
  if ((*((volatile unsigned long *)(0x40030000 + 0x00002054))) & 0x00000010) {
    return (0x00000004);
  } else {
    return (0x00000000);
  }
}


x86 assembly (clang, -O0):
<FlashCheckFsmForError>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40032054,%eax
mov    (%rax),%rax
and    $0x10,%rax
cmp    $0x0,%rax
je     1126 <FlashCheckFsmForError+0x26>
movl   $0x4,-0x4(%rbp)
jmp    112d <FlashCheckFsmForError+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashCheckFsmForError>:
mov    0x40032054,%rax
40
shr    $0x2,%eax
and    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @FlashCheckFsmForError() {
%1 = alloca i32
%2 = load volatile i64, i64* inttoptr (i64 1073946708 to i64*)
%3 = and i64 %2, 16
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 4, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @FlashCheckFsmForError() {
%1 = load volatile i64, i64* inttoptr (i64 1073946708 to i64*)
%2 = trunc i64 %1 to i32
%3 = lshr i32 %2, 2
%4 = and i32 %3, 4
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int leap;
  scanf("%d", &leap);
  if (leap == 366) {
    printf("yes\n");
  } else if (leap == 365) {
    printf("no\n");
  } else {
    printf("Invalid param\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x16e,-0x8(%rbp)
jne    115d <main+0x3d>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
jmp    118c <main+0x6c>
cmpl   $0x16d,-0x8(%rbp)
jne    117b <main+0x5b>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    1187 <main+0x67>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    118c <main+0x6c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x16d,%eax
lea    0xecf(%rip),%rcx
lea    0xeba(%rip),%rdx
cmove  %rcx,%rdx
cmp    $0x16e,%eax
lea    0xebb(%rip),%rdi
cmovne %rdx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"yes\0A\00"
@.str.2 = [4 x i8] c"no\0A\00"
@.str.3 = [15 x i8] c"Invalid param\0A\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)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 366
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %16
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 365
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %15
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
br label %16
16: ; preds = %15, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [14 x i8] c"Invalid param\00"
@str.4 = [3 x i8] c"no\00"
@str.5 = [4 x i8] c"yes\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 = icmp eq i32 %4, 365
%6 = select i1 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0)
%7 = icmp eq i32 %4, 366
%8 = select i1 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.5, i64 0, i64 0), i8* %6
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("\n\tmygrep: A simple example to show how regular\texpressions are "
         "used in the Gnu C library.\tSee the Gnu documentation for "
         "information about\tregular expressions: http://www.gnu.org\n\tUsage: "
         "./mygrep -f <filename> -p <pattern>\n\n");
}


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

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

LLVM IR (-O0):
@.str = [224 x i8] c"\0A\09mygrep: A simple example to show how regular\09expressions are used in the Gnu C library.\09See the Gnu documentation for information about\09regular expressions: http://www.gnu.org\0A\09Usage: ./mygrep -f <filename> -p <pattern>\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([224 x i8], [224 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [223 x i8] c"\0A\09mygrep: A simple example to show how regular\09expressions are used in the Gnu C library.\09See the Gnu documentation for information about\09regular expressions: http://www.gnu.org\0A\09Usage: ./mygrep -f <filename> -p <pattern>\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([223 x i8], [223 x i8]* @str, i64 0, i64 0))
ret void
}
int pr(char elem) {
  switch (elem) {
  case '#':
    return 0;
  case ')':
    return 1;
  case '+':
  case '-':
    return 2;
  case '*':
  case '/':
    return 3;
  }
}


x86 assembly (clang, -O0):
<pr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffdd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xc,%eax
ja     115f <pr+0x5f>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    115f <pr+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    115f <pr+0x5f>
movl   $0x2,-0x4(%rbp)
jmp    115f <pr+0x5f>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr>:
add    $0xffffffd7,%edi
xor    %eax,%eax
cmp    $0x6,%edi
ja     1117 <pr+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @pr(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 35, label %6
i32 41, label %7
i32 43, label %8
i32 45, label %8
i32 42, label %9
i32 47, label %9
]
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
store i32 1, i32* %2
br label %10
8: ; preds = %1, %1
store i32 2, i32* %2
br label %10
9: ; preds = %1, %1
store i32 3, i32* %2
br label %10
10: ; preds = %6, %7, %8, %9, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.pr = [7 x i32] [i32 1, i32 3, i32 2, i32 0, i32 2, i32 0, i32 3]
define i32 @pr(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -41
%4 = icmp ult i32 %3, 7
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.pr, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %10
}
unsigned int startProc(unsigned char *path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @startProc(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void GlobalFunc(void) {
  static unsigned int FuncScopeStatic = 0xCAFEC0DE;
  printf("I'm a global Func %8X", FuncScopeStatic);
}


x86 assembly (clang, -O0):
<GlobalFunc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0e(%rip),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GlobalFunc>:
lea    0xee9(%rip),%rdi
mov    $0xcafec0de,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@GlobalFunc.FuncScopeStatic = internal global i32 -889274146
@.str = [22 x i8] c"I'm a global Func %8X\00"
define void @GlobalFunc() {
%1 = load i32, i32* @GlobalFunc.FuncScopeStatic
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"I'm a global Func %8X\00"
define void @GlobalFunc() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 -889274146)
ret void
}
/* Variables and functions */
double log(double);
double rand_val();
double exponDistriValue(double x) {
  double z;
  double exp_value;
  do {
    z = rand_val();
  } while ((z == 0) || (z == 1));
  exp_value = -x * log(z);
  return exp_value;
}


x86 assembly (clang, -O0):
<exponDistriValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand_val@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jne    115b <exponDistriValue+0x3b>
jp     115b <exponDistriValue+0x3b>
jmp    1177 <exponDistriValue+0x57>
movsd  -0x10(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    112d <exponDistriValue+0xd>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponDistriValue>:
sub    $0x18,%rsp
movapd %xmm0,(%rsp)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand_val@plt>
ucomisd 0xec9(%rip),%xmm0
jne    1143 <exponDistriValue+0x23>
jnp    1130 <exponDistriValue+0x10>
ucomisd 0xeb5(%rip),%xmm0
jne    114f <exponDistriValue+0x2f>
jnp    1130 <exponDistriValue+0x10>
movaps (%rsp),%xmm1
xorps  0xeb6(%rip),%xmm1
movaps %xmm1,(%rsp)
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @exponDistriValue(double %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call double (...) @rand_val()
%4 = fcmp oeq double %3, 0.000000e+00
%5 = fcmp oeq double %3, 1.000000e+00
%6 = or i1 %4, %5
br i1 %6, label %2, label %7
7: ; preds = %2
%8 = fneg double %0
%9 = tail call double @log(double %3)
%10 = fmul double %9, %8
ret double %10
}
/* Variables and functions */
int _write_sysfs_string(char *, char *, char *, int);
int write_sysfs_string_and_verify(char *filename, char *basedir, char *val) {
  return _write_sysfs_string(filename, basedir, val, 1);
}


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

x86 assembly (clang, -O2):
<write_sysfs_string_and_verify>:
mov    $0x1,%ecx
jmp    1030 <_write_sysfs_string@plt>

LLVM IR (-O0):
define i32 @write_sysfs_string_and_verify(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 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @_write_sysfs_string(i8* %7, i8* %8, i8* %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @write_sysfs_string_and_verify(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @_write_sysfs_string(i8* %0, i8* %1, i8* %2, i32 1)
ret i32 %4
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
double dot(float *x1, float *x2) {
  int64_t i;
  double s = 0;
  for (i = 0; i < 3; i++)
    s += x1[i] * x2[i];
  return s;
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    115b <dot+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <dot+0x1b>
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
mulss  (%rsi),%xmm0
cvtss2sd %xmm0,%xmm0
xorpd  %xmm2,%xmm2
mulss  0x4(%rsi),%xmm1
addsd  %xmm0,%xmm2
cvtss2sd %xmm1,%xmm1
addsd  %xmm2,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dot(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i32
%6 = alloca double
store float* %0, float** %3
store float* %1, float** %4
store double 0.000000e+00, double* %6
store i32 0, i32* %5
br label %7
7: ; preds = %25, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %28
10: ; preds = %7
%11 = load float*, float** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds float, float* %11, i64 %13
%15 = load float, float* %14
%16 = load float*, float** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds float, float* %16, i64 %18
%20 = load float, float* %19
%21 = fmul float %15, %20
%22 = fpext float %21 to double
%23 = load double, double* %6
%24 = fadd double %23, %22
store double %24, double* %6
br label %25
25: ; preds = %10
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %7
28: ; preds = %7
%29 = load double, double* %6
ret double %29
}

LLVM IR (-O2):
define double @dot(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = fadd double %6, 0.000000e+00
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = getelementptr inbounds float, float* %1, i64 1
%11 = load float, float* %10
%12 = fmul float %9, %11
%13 = fpext float %12 to double
%14 = fadd double %7, %13
%15 = getelementptr inbounds float, float* %0, i64 2
%16 = load float, float* %15
%17 = getelementptr inbounds float, float* %1, i64 2
%18 = load float, float* %17
%19 = fmul float %16, %18
%20 = fpext float %19 to double
%21 = fadd double %14, %20
ret double %21
}
/* Variables and functions */
int echo(int);
int neqtest(int a, int b) {
  int retval;
  if (a != b)
    retval = echo(1);
  else
    retval = echo(2);
  return retval;
}


x86 assembly (clang, -O0):
<neqtest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     113c <neqtest+0x2c>
mov    $0x1,%edi
call   1030 <echo@plt>
mov    %eax,-0xc(%rbp)
jmp    1149 <neqtest+0x39>
mov    $0x2,%edi
call   1030 <echo@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<neqtest>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
add    $0x1,%eax
mov    %eax,%edi
jmp    1030 <echo@plt>

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

LLVM IR (-O2):
define i32 @neqtest(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = select i1 %3, i32 2, i32 1
%5 = tail call i32 @echo(i32 %4)
ret i32 %5
}
f(int *x) { *x = 0; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @f(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret i32 undef
}
void adis16240_uninitialize_ring(struct iio_ring_buffer *ring) {}


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

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

LLVM IR (-O0):
%struct.iio_ring_buffer = type opaque
define void @adis16240_uninitialize_ring(%struct.iio_ring_buffer* %0) {
%2 = alloca %struct.iio_ring_buffer*
store %struct.iio_ring_buffer* %0, %struct.iio_ring_buffer** %2
ret void
}

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define void @adis16240_uninitialize_ring(%struct.iio_ring_buffer* nocapture %0) {
ret void
}
void fc201(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      goto a;
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
a:;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc201(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
br label %20
17: ; No predecessors!
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %20
20: ; preds = %17, %1
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc201(i32 %0) {
ret void
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *,
                                          int /*<<< orphan*/, char const *);
void wl_data_offer_send_offer(struct wl_resource *resource_,
                              const char *mime_type) {
  wl_resource_post_event(resource_, 0, mime_type);
}


x86 assembly (clang, -O0):
<wl_data_offer_send_offer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <wl_resource_post_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_data_offer_send_offer>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_data_offer_send_offer(%struct.wl_resource* %0, i8* %1) {
%3 = alloca %struct.wl_resource*
%4 = alloca i8*
store %struct.wl_resource* %0, %struct.wl_resource** %3
store i8* %1, i8** %4
%5 = load %struct.wl_resource*, %struct.wl_resource** %3
%6 = load i8*, i8** %4
%7 = call i32 @wl_resource_post_event(%struct.wl_resource* %5, i32 0, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_data_offer_send_offer(%struct.wl_resource* %0, i8* %1) {
%3 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InfoNES_ReleaseRom();
void InfoNES_Fin() { InfoNES_ReleaseRom(); }


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

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

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

LLVM IR (-O2):
define void @InfoNES_Fin() {
%1 = tail call i32 (...) @InfoNES_ReleaseRom()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printUsage(char *progname) {
  printf("Usage: %s note [tag1 tag2 ... tagN]\n", progname);
  printf("If note is `-' all of note text (including tags) will be read from "
         "stdin.\n");
  printf("create note utility\n");
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [37 x i8] c"Usage: %s note [tag1 tag2 ... tagN]\0A\00"
@.str.1 = [75 x i8] c"If note is `-' all of note text (including tags) will be read from stdin.\0A\00"
@.str.2 = [21 x i8] c"create note utility\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Usage: %s note [tag1 tag2 ... tagN]\0A\00"
@str = [74 x i8] c"If note is `-' all of note text (including tags) will be read from stdin.\00"
@str.3 = [20 x i8] c"create note utility\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0))
ret void
}
int main() {
  printf("This is printed by function %s\n", __func__);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"This is printed by function %s\0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"This is printed by function %s\0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ isdigit(char);
int cgi_isxdigit(char c) {
  if (isdigit(c))
    return 1;
  if ('A' >= c && c <= 'F')
    return 1;
  if ('a' >= c && c <= 'f')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cgi_isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     113d <cgi_isxdigit+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1198 <cgi_isxdigit+0x88>
movsbl -0x5(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jl     1167 <cgi_isxdigit+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     1167 <cgi_isxdigit+0x57>
movl   $0x1,-0x4(%rbp)
jmp    1198 <cgi_isxdigit+0x88>
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jl     1191 <cgi_isxdigit+0x81>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     1191 <cgi_isxdigit+0x81>
movl   $0x1,-0x4(%rbp)
jmp    1198 <cgi_isxdigit+0x88>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgi_isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
cmp    $0x62,%bl
setl   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cgi_isxdigit(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp slt i8 %0, 98
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_rwlock_trywrlock(pthread_rwlock_t *a) { assert(0); }


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

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

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

LLVM IR (-O2):
define i32 @pthread_rwlock_trywrlock(i32* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 undef
}