xunge/DecIR huggingface dataset:
void XtIsSensitive() {}


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

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

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

LLVM IR (-O2):
define void @XtIsSensitive() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *prog) {
  fprintf(stderr, "Usage %s ip_address:port\n", prog);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Usage %s ip_address:port\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void f(char *x) { x[4] = 42; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2a,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movb   $0x2a,0x4(%rdi)
ret

LLVM IR (-O0):
define void @f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 4
store i8 42, i8* %4
ret void
}

LLVM IR (-O2):
define void @f(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
store i8 42, i8* %2
ret void
}
void _ZN9__gnu_cxx13new_allocatorIPiE7destroyEPS1_(
    struct l_class_OC_DummyStream *llvm_cbe_this, unsigned int **llvm_cbe___p) {
  struct l_class_OC_DummyStream *llvm_cbe_this_2e_addr;
  unsigned int **llvm_cbe___p_2e_addr;
  struct l_class_OC_DummyStream *llvm_cbe_this1;
  unsigned int **llvm_cbe_tmp;
  *(&llvm_cbe_this_2e_addr) = llvm_cbe_this;
  *(&llvm_cbe___p_2e_addr) = llvm_cbe___p;
  llvm_cbe_this1 = *(&llvm_cbe_this_2e_addr);
  llvm_cbe_tmp = *(&llvm_cbe___p_2e_addr);
  return;
}


x86 assembly (clang, -O0):
<_ZN9__gnu_cxx13new_allocatorIPiE7destroyEPS1_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.l_class_OC_DummyStream = type opaque
define void @_ZN9__gnu_cxx13new_allocatorIPiE7destroyEPS1_(%struct.l_class_OC_DummyStream* %0, i32** %1) {
%3 = alloca %struct.l_class_OC_DummyStream*
%4 = alloca i32**
%5 = alloca %struct.l_class_OC_DummyStream*
%6 = alloca i32**
%7 = alloca %struct.l_class_OC_DummyStream*
%8 = alloca i32**
store %struct.l_class_OC_DummyStream* %0, %struct.l_class_OC_DummyStream** %3
store i32** %1, i32*** %4
%9 = load %struct.l_class_OC_DummyStream*, %struct.l_class_OC_DummyStream** %3
store %struct.l_class_OC_DummyStream* %9, %struct.l_class_OC_DummyStream** %5
%10 = load i32**, i32*** %4
store i32** %10, i32*** %6
%11 = load %struct.l_class_OC_DummyStream*, %struct.l_class_OC_DummyStream** %5
store %struct.l_class_OC_DummyStream* %11, %struct.l_class_OC_DummyStream** %7
%12 = load i32**, i32*** %6
store i32** %12, i32*** %8
ret void
}

LLVM IR (-O2):
%struct.l_class_OC_DummyStream = type opaque
define void @_ZN9__gnu_cxx13new_allocatorIPiE7destroyEPS1_(%struct.l_class_OC_DummyStream* nocapture %0, i32** nocapture %1) {
ret void
}
/* Variables and functions */
void *sqlite3Realloc(void *, int);
void *printf_realloc(void *old, int size) { return sqlite3Realloc(old, size); }


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

x86 assembly (clang, -O2):
<printf_realloc>:
jmp    1030 <sqlite3Realloc@plt>

LLVM IR (-O0):
define i8* @printf_realloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i8* @sqlite3Realloc(i8* %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @printf_realloc(i8* %0, i32 %1) {
%3 = tail call i8* @sqlite3Realloc(i8* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ gmx_density(int, char **);
int main(int argc, char *argv[]) {
  gmx_density(argc, argv);
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_density@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gmx_density(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_density(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ config_WITH_CARDREADER();
int config_CARDREADER_INTERNAL_SCI(void) {
  return config_WITH_CARDREADER() ? 1 : 0;
}


x86 assembly (clang, -O0):
<config_CARDREADER_INTERNAL_SCI>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <config_WITH_CARDREADER@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_CARDREADER_INTERNAL_SCI>:
push   %rax
xor    %eax,%eax
call   1030 <config_WITH_CARDREADER@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @config_CARDREADER_INTERNAL_SCI() {
%1 = call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 0
ret i32 %4
}

LLVM IR (-O2):
define i32 @config_CARDREADER_INTERNAL_SCI() {
%1 = tail call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int GetReturnValue(const unsigned char *offset, const unsigned char *end,
                   const char *multibyte_start, int *return_value) {
  if ((offset) >= end)
    return 0;
  if (!multibyte_start && (*offset & 0xE0) == 0x80) {
    *return_value = *offset & 0x0F;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<GetReturnValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     112e <GetReturnValue+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1173 <GetReturnValue+0x73>
cmpq   $0x0,-0x20(%rbp)
jne    116c <GetReturnValue+0x6c>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
and    $0xe0,%eax
cmp    $0x80,%eax
jne    116c <GetReturnValue+0x6c>
mov    -0x10(%rbp),%rax
movzbl (%rax),%ecx
and    $0xf,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1173 <GetReturnValue+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetReturnValue>:
xor    %eax,%eax
cmp    %rsi,%rdi
jae    1126 <GetReturnValue+0x26>
test   %rdx,%rdx
jne    1126 <GetReturnValue+0x26>
movzbl (%rdi),%edx
mov    %edx,%esi
and    $0xffffffe0,%esi
cmp    $0x80,%esi
jne    1126 <GetReturnValue+0x26>
and    $0xf,%edx
mov    %edx,(%rcx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @GetReturnValue(i8* %0, i8* readnone %1, i8* readnone %2, i32* nocapture writeonly %3) {
%5 = icmp ult i8* %0, %1
%6 = icmp eq i8* %2, null
%7 = and i1 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i8, i8* %0
%10 = zext i8 %9 to i32
%11 = and i32 %10, 224
%12 = icmp eq i32 %11, 128
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = and i32 %10, 15
store i32 %14, i32* %3
br label %15
15: ; preds = %8, %4, %13
%16 = phi i32 [ 1, %13 ], [ 0, %4 ], [ 0, %8 ]
ret i32 %16
}
int max(int a, int b) {
  if (a < b)
    return b;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void omap44xx_prm_reconfigure_io_chain(void) {}


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

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

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

LLVM IR (-O2):
define void @omap44xx_prm_reconfigure_io_chain() {
ret void
}
void cpuidle_unregister_device(struct cpuidle_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.cpuidle_device = type opaque
define void @cpuidle_unregister_device(%struct.cpuidle_device* nocapture %0) {
ret void
}
void f1() {
  int i;
  for (i = 0; i < 10; i++) {
    ;
  }
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1128 <f1+0x28>
jmp    111a <f1+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <f1+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f1() {
ret void
}
int __test() {
  int x = 3;
  x++;
  return x++;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__test() {
ret i32 4
}
void TMR3TimerLoad(void) {}


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

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

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

LLVM IR (-O2):
define void @TMR3TimerLoad() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printNewline(int i) { printf("\n"); }


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

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

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

LLVM IR (-O2):
define void @printNewline(i32 %0) {
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
unsigned int roi_get_stream_response_size(char *);
int roi_set_stream_response_data(char *buff, unsigned int no, char data) {
  if (no >= roi_get_stream_response_size(buff)) {
    return -1;
  }
  buff[2 + no] = data;
  return 0;
}


x86 assembly (clang, -O0):
<roi_set_stream_response_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <roi_get_stream_response_size@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jb     114c <roi_set_stream_response_data+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <roi_set_stream_response_data+0x55>
mov    -0x15(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x2,%ecx
mov    %ecx,%ecx
mov    %dl,(%rax,%rcx,1)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roi_set_stream_response_data>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%rbp
call   1030 <roi_get_stream_response_size@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ebx,%ecx
jbe    1136 <roi_set_stream_response_data+0x26>
add    $0x2,%ebx
mov    %r14b,0x0(%rbp,%rbx,1)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @roi_set_stream_response_data(i8* %0, i32 %1, i8 signext %2) {
%4 = tail call i32 @roi_get_stream_response_size(i8* %0)
%5 = icmp ugt i32 %4, %1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = add i32 %1, 2
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %2, i8* %9
br label %10
10: ; preds = %3, %6
%11 = phi i32 [ 0, %6 ], [ -1, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ spi_emit_buf(char *, int);
void spi_emit_nop(int n) {
  int i;
  for (i = 0; i < n; n++) {
    spi_emit_buf("\x0", 1);
  }
}


x86 assembly (clang, -O0):
<spi_emit_nop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114d <spi_emit_nop+0x3d>
lea    0xecb(%rip),%rdi
mov    $0x1,%esi
call   1030 <spi_emit_buf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <spi_emit_nop+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_emit_nop>:
push   %rbx
test   %edi,%edi
jle    112f <spi_emit_nop+0x1f>
lea    0xee4(%rip),%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <spi_emit_buf@plt>
jmp    1120 <spi_emit_nop+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] zeroinitializer
define void @spi_emit_nop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @spi_emit_buf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %10
10: ; preds = %8
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] zeroinitializer
define void @spi_emit_nop(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %3
%4 = tail call i32 @spi_emit_buf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %3
5: ; preds = %1
ret void
}
const char *monotonic_method() { return "time"; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"time\00"
define i8* @monotonic_method() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
int hxd_version(void) { return 0x20130412; }


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

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

LLVM IR (-O0):
define i32 @hxd_version() {
ret i32 538117138
}

LLVM IR (-O2):
define i32 @hxd_version() {
ret i32 538117138
}
/* Variables and functions */
int f(int, int *);
int g(int, int *);
int h(int t, int *a) { return f(t, a) + g(t, a); }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <f@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <g@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <f@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <g@plt>
add    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @h(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 = call i32 @f(i32 %5, i32* %6)
%8 = load i32, i32* %3
%9 = load i32*, i32** %4
%10 = call i32 @g(i32 %8, i32* %9)
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @h(i32 %0, i32* %1) {
%3 = tail call i32 @f(i32 %0, i32* %1)
%4 = tail call i32 @g(i32 %0, i32* %1)
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
scalar_t__ path_absolute(char const *);
int /*<<< orphan*/ path_translateInPlace(char *, char *);
const char *vs_list_refpaths(const char *name) {
  char *path = (char *)path_absolute(name);
  path_translateInPlace(path, "windows");
  return path;
}


x86 assembly (clang, -O0):
<vs_list_refpaths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <path_absolute@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1040 <path_translateInPlace@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vs_list_refpaths>:
push   %rbx
call   1030 <path_absolute@plt>
mov    %rax,%rbx
lea    0xed0(%rip),%rsi
mov    %rax,%rdi
call   1040 <path_translateInPlace@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"windows\00"
define i8* @vs_list_refpaths(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @path_absolute(i8* %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @path_translateInPlace(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"windows\00"
define i8* @vs_list_refpaths(i8* %0) {
%2 = tail call i64 @path_absolute(i8* %0)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @path_translateInPlace(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
porcentagem_aprovados(float numrepro, float numapro, float *papro,
                      float *prepro) {
  *papro = (numapro / (numapro + numrepro)) * 100.0;
  *prepro = (numrepro / (numapro + numrepro)) * 100.0;
  if (*papro > 50.0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<porcentagem_aprovados>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
addss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
addss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea4(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe78(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    119e <porcentagem_aprovados+0x9e>
movl   $0x1,-0x4(%rbp)
jmp    11a5 <porcentagem_aprovados+0xa5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<porcentagem_aprovados>:
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
divss  %xmm2,%xmm1
movss  0xeed(%rip),%xmm3
mulss  %xmm3,%xmm1
movss  %xmm1,(%rdi)
divss  %xmm2,%xmm0
mulss  %xmm3,%xmm0
movss  %xmm0,(%rsi)
movss  (%rdi),%xmm0
xor    %eax,%eax
ucomiss 0xed0(%rip),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @porcentagem_aprovados(float %0, float %1, float* %2, float* %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float*
%9 = alloca float*
store float %0, float* %6
store float %1, float* %7
store float* %2, float** %8
store float* %3, float** %9
%10 = load float, float* %7
%11 = load float, float* %7
%12 = load float, float* %6
%13 = fadd float %11, %12
%14 = fdiv float %10, %13
%15 = fpext float %14 to double
%16 = fmul double %15, 1.000000e+02
%17 = fptrunc double %16 to float
%18 = load float*, float** %8
store float %17, float* %18
%19 = load float, float* %6
%20 = load float, float* %7
%21 = load float, float* %6
%22 = fadd float %20, %21
%23 = fdiv float %19, %22
%24 = fpext float %23 to double
%25 = fmul double %24, 1.000000e+02
%26 = fptrunc double %25 to float
%27 = load float*, float** %9
store float %26, float* %27
%28 = load float*, float** %8
%29 = load float, float* %28
%30 = fpext float %29 to double
%31 = fcmp ogt double %30, 5.000000e+01
br i1 %31, label %32, label %33
32: ; preds = %4
store i32 1, i32* %5
br label %34
33: ; preds = %4
store i32 0, i32* %5
br label %34
34: ; preds = %33, %32
%35 = load i32, i32* %5
ret i32 %35
}

LLVM IR (-O2):
define i32 @porcentagem_aprovados(float %0, float %1, float* nocapture %2, float* nocapture writeonly %3) {
%5 = fadd float %0, %1
%6 = fdiv float %1, %5
%7 = fmul float %6, 1.000000e+02
store float %7, float* %2
%8 = fdiv float %0, %5
%9 = fmul float %8, 1.000000e+02
store float %9, float* %3
%10 = load float, float* %2
%11 = fcmp ogt float %10, 5.000000e+01
%12 = zext i1 %11 to i32
ret i32 %12
}
__attribute__((always_)) void __sti_mwait(unsigned long eax,
                                          unsigned long ecx) {
  do {
  } while (0);
  asm volatile("sti; .byte 0x0f, 0x01, 0xc9;" ::"a"(eax), "c"(ecx));
}


x86 assembly (clang, -O0):
<__sti_mwait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1111 <__sti_mwait+0x11>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sti
mwait  %eax,%ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sti_mwait>:
mov    %rsi,%rcx
mov    %rdi,%rax
sti
mwait  %eax,%ecx
ret

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

LLVM IR (-O2):
define void @__sti_mwait(i64 %0, i64 %1) {
tail call void asm sideeffect "sti; .byte 0x0f, 0x01, 0xc9;", "{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret void
}
void fail(int *x) {
  if (x == 0) {
    *x = 1;
  }
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111d <fail+0x1d>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @fail(i32* readnone %0) {
%2 = icmp ne i32* %0, null
tail call void @llvm.assume(i1 %2)
ret void
}
void fe_mdio_cleanup(struct fe_priv *priv) {}


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

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

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

LLVM IR (-O2):
%struct.fe_priv = type opaque
define void @fe_mdio_cleanup(%struct.fe_priv* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, size_t);
void __attribute__((weak))
__aeabi_memmove8_impl2(void *dest, const void *src, size_t n) {
  memmove(dest, src, n);
}


x86 assembly (clang, -O0):
<__aeabi_memmove8_impl2>:
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
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__aeabi_memmove8_impl2>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define weak void @__aeabi_memmove8_impl2(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memmove(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
double pow(double, double);
double LinearTosRGB(double value) {
  return (value <= 0.0031308) ? 12.92 * value
                              : 1.055 * pow(value, 1.0 / 2.4) - 0.055;
}


x86 assembly (clang, -O0):
<LinearTosRGB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     1147 <LinearTosRGB+0x37>
movsd  0xee8(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1176 <LinearTosRGB+0x66>
movsd  -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
call   1030 <pow@plt>
movsd  0xea7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LinearTosRGB>:
push   %rax
movsd  0xee7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    113e <LinearTosRGB+0x2e>
movsd  0xee9(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee4(%rip),%xmm0
addsd  0xee4(%rip),%xmm0
pop    %rax
ret
mulsd  0xec2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @LinearTosRGB(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double %3, 3.130800e-03
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fmul double 1.292000e+01, %6
br label %12
8: ; preds = %1
%9 = load double, double* %2
%10 = call double @pow(double %9, double 0x3FDAAAAAAAAAAAAB)
%11 = call double @llvm.fmuladd.f64(double 1.055000e+00, double %10, double -5.500000e-02)
br label %12
12: ; preds = %8, %5
%13 = phi double [ %7, %5 ], [ %11, %8 ]
ret double %13
}

LLVM IR (-O2):
define double @LinearTosRGB(double %0) {
%2 = fcmp ugt double %0, 3.130800e-03
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = fmul double %0, 1.292000e+01
br label %8
5: ; preds = %1
%6 = tail call double @pow(double %0, double 0x3FDAAAAAAAAAAAAB)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.055000e+00, double -5.500000e-02)
br label %8
8: ; preds = %5, %3
%9 = phi double [ %4, %3 ], [ %7, %5 ]
ret double %9
}
/* Variables and functions */
int printf(char *, unsigned int, unsigned int, unsigned int);
int float_to_uint(void) {
  float f1 = 1.5678e30f, f2 = (1ul << 63), f3 = (0xFFFFFFFFFFFFFFFFul);
  unsigned int a = f1, b = f2, c = f3;
  return printf("(float) unsigned int: %u, %u, %u\n", a, b, c);
}


x86 assembly (clang, -O0):
<float_to_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x719e4eae,-0x4(%rbp)
movl   $0x5f000000,-0x8(%rbp)
movl   $0x5f800000,-0xc(%rbp)
cvttss2si -0x4(%rbp),%rax
mov    %eax,-0x10(%rbp)
cvttss2si -0x8(%rbp),%rax
mov    %eax,-0x14(%rbp)
cvttss2si -0xc(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"(float) unsigned int: %u, %u, %u\0A\00"
define i32 @float_to_uint() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store float 0x4633C9D5C0000000, float* %1
store float 0x43E0000000000000, float* %2
store float 0x43F0000000000000, float* %3
%7 = load float, float* %1
%8 = fptoui float %7 to i32
store i32 %8, i32* %4
%9 = load float, float* %2
%10 = fptoui float %9 to i32
store i32 %10, i32* %5
%11 = load float, float* %3
%12 = fptoui float %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [34 x i8] c"(float) unsigned int: %u, %u, %u\0A\00"
define i32 @float_to_uint() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 poison, i32 poison, i32 poison)
ret i32 %1
}
int BlowFish_variableKeyLen(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @BlowFish_variableKeyLen() {
ret i32 1
}

LLVM IR (-O2):
define i32 @BlowFish_variableKeyLen() {
ret i32 1
}
int test_imm_47uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x47 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_47uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 71
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void init_timer(int timerId, int intrsrc) {}


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

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

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

LLVM IR (-O2):
define void @init_timer(i32 %0, i32 %1) {
ret void
}
int varfun(int a, ...) { return a; }


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

x86 assembly (clang, -O2):
<varfun>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @varfun(i32 returned %0, ...) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int dspd_strtou32(char const *, int /*<<< orphan*/ *, int);
int dspd_strtoul(const char *str, unsigned long *n, int base) {
  return dspd_strtou32(str, (uint32_t *)n, base);
}


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

x86 assembly (clang, -O2):
<dspd_strtoul>:
jmp    1030 <dspd_strtou32@plt>

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

LLVM IR (-O2):
define i32 @dspd_strtoul(i8* %0, i64* %1, i32 %2) {
%4 = bitcast i64* %1 to i32*
%5 = tail call i32 @dspd_strtou32(i8* %0, i32* %4, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void init_id(char *buf, int i) { (void)sprintf(buf, "n%04d", i); }


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

x86 assembly (clang, -O2):
<init_id>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"n%04d\00"
define void @init_id(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"n%04d\00"
define void @init_id(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int test2(int p[]) {
  printf("%p\n", p);
  printf("%d\n", *p);
  printf("%d\n", p[1]);
  return 0;
}


x86 assembly (clang, -O0):
<test2>:
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>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%esi
lea    0xed3(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @test2(i32* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = load i32, i32* %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(size_t);
int /*<<< orphan*/ merge_sort_natural_internal(int *, int *, size_t);
void merge_sort_natural(int array[], size_t length) {
  if (length == 0) {
    return;
  }
  int *temp = malloc(length * sizeof(int));
  merge_sort_natural_internal(array, temp, length);
  free(temp);
}


x86 assembly (clang, -O0):
<merge_sort_natural>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <merge_sort_natural+0x20>
jmp    117b <merge_sort_natural+0x4b>
mov    -0x10(%rbp),%rdi
shl    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <merge_sort_natural_internal@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort_natural>:
test   %rsi,%rsi
je     116b <merge_sort_natural+0x3b>
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x0(,%rsi,4),%rdi
call   1050 <malloc@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1040 <merge_sort_natural_internal@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @merge_sort_natural(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32*
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %19
9: ; preds = %2
%10 = load i64, i64* %4
%11 = mul i64 %10, 4
%12 = call i32* @malloc(i64 %11)
store i32* %12, i32** %5
%13 = load i32*, i32** %3
%14 = load i32*, i32** %5
%15 = load i64, i64* %4
%16 = call i32 @merge_sort_natural_internal(i32* %13, i32* %14, i64 %15)
%17 = load i32*, i32** %5
%18 = call i32 @free(i32* %17)
br label %19
19: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @merge_sort_natural(i32* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = shl i64 %1, 2
%6 = tail call i32* @malloc(i64 %5)
%7 = tail call i32 @merge_sort_natural_internal(i32* %0, i32* %6, i64 %1)
%8 = tail call i32 @free(i32* %6)
br label %9
9: ; preds = %2, %4
ret void
}
unsigned char SwapByteBits(unsigned char cInput) {
  unsigned char nResult = 0;
  for (int i = 0; i < 8; i++) {
    nResult = nResult << 1;
    nResult |= (cInput & 1);
    cInput = cInput >> 1;
  }
  return (nResult);
}


x86 assembly (clang, -O0):
<SwapByteBits>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1151 <SwapByteBits+0x51>
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0x1,%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <SwapByteBits+0x15>
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapByteBits>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @SwapByteBits(i8 zeroext %0) {
%2 = call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
/* Variables and functions */
float exp2f(float const);
void glmExp23f(float out[3], const float x[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = exp2f(x[i]);
}


x86 assembly (clang, -O0):
<glmExp23f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1163 <glmExp23f+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <exp2f@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <glmExp23f+0x18>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @glmExp23f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i64
store float* %0, float** %3
store float* %1, float** %4
store i64 0, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load float*, float** %4
%11 = load i64, i64* %5
%12 = getelementptr inbounds float, float* %10, i64 %11
%13 = load float, float* %12
%14 = call float @exp2f(float %13)
%15 = load float*, float** %3
%16 = load i64, i64* %5
%17 = getelementptr inbounds float, float* %15, i64 %16
store float %14, float* %17
br label %18
18: ; preds = %9
%19 = load i64, i64* %5
%20 = add i64 %19, 1
store i64 %20, i64* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @glmExp23f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @exp2f(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @exp2f(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = tail call float @exp2f(float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("./a.out <addr>\n");
  return;
}


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 = [16 x i8] c"./a.out <addr>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"./a.out <addr>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
void glCopyTexSubImage2D(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glCopyTexSubImage2D() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sys_write(char *);
void test_task_a() {
  while (1) {
    sys_write("foo\n");
  }
}


x86 assembly (clang, -O0):
<test_task_a>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <test_task_a+0x9>
lea    0xee0(%rip),%rdi
call   1030 <sys_write@plt>
jmp    1119 <test_task_a+0x9>

x86 assembly (clang, -O2):
<test_task_a>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <sys_write@plt>
jmp    1120 <test_task_a+0x10>

LLVM IR (-O0):
@.str = [5 x i8] c"foo\0A\00"
define void @test_task_a() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @sys_write(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %1
}

LLVM IR (-O2):
@.str = [5 x i8] c"foo\0A\00"
define void @test_task_a() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @sys_write(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
fn() { print("whoa"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"whoa\00"
define i32 @fn() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}