xunge/DecIR huggingface dataset:
int channels_multi(int flags) {
  if (flags & 16)
    return 6;
  else if (flags & 1)
    return 5;
  else if ((flags & 15) == 6)
    return 4;
  else
    return 2;
}


x86 assembly (clang, -O0):
<channels_multi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1122 <channels_multi+0x22>
movl   $0x6,-0x4(%rbp)
jmp    115f <channels_multi+0x5f>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113d <channels_multi+0x3d>
movl   $0x5,-0x4(%rbp)
jmp    115f <channels_multi+0x5f>
mov    -0x8(%rbp),%eax
and    $0xf,%eax
cmp    $0x6,%eax
jne    1158 <channels_multi+0x58>
movl   $0x4,-0x4(%rbp)
jmp    115f <channels_multi+0x5f>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<channels_multi>:
mov    $0x6,%eax
test   $0x10,%dil
jne    1126 <channels_multi+0x26>
mov    $0x5,%eax
test   $0x1,%dil
jne    1126 <channels_multi+0x26>
and    $0xf,%edi
xor    %eax,%eax
cmp    $0x6,%edi
sete   %al
add    %eax,%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @channels_multi(i32 %0) {
%2 = and i32 %0, 16
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = and i32 %0, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = and i32 %0, 15
%9 = icmp eq i32 %8, 6
%10 = select i1 %9, i32 4, i32 2
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 6, %1 ], [ 5, %4 ], [ %10, %7 ]
ret i32 %12
}
float H(float *d, float *s) { return d[0] * s[0] + d[1] * s[1] + d[2] * s[2]; }


x86 assembly (clang, -O0):
<H>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<H>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @H(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @H(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
void UART5_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<UART5_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UART5_Handler+0x9>
jmp    1109 <UART5_Handler+0x9>

x86 assembly (clang, -O2):
<UART5_Handler>:
jmp    1100 <UART5_Handler>

LLVM IR (-O0):
define void @UART5_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @UART5_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ avg_422_downsample_ag_rb_vectors_n_save_previous_sse2(
    int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
extern void avg_422_downsample_ag_rb_vectors_n_save_previous_sse2_ssse3(
    __m128i *in_4_v16i_current_ag_rb_vectors,
    __m128i *in_2_v16i_previous_ag_rb_vectors,
    __m128i *out_2_v16i_avg_422_ag_rb_vectors) {
  avg_422_downsample_ag_rb_vectors_n_save_previous_sse2(
      in_4_v16i_current_ag_rb_vectors, in_2_v16i_previous_ag_rb_vectors,
      out_2_v16i_avg_422_ag_rb_vectors);
}


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

x86 assembly (clang, -O2):
<avg_422_downsample_ag_rb_vectors_n_save_previous_sse2_ssse3>:
jmp    1030 <avg_422_downsample_ag_rb_vectors_n_save_previous_sse2@plt>

LLVM IR (-O0):
define void @avg_422_downsample_ag_rb_vectors_n_save_previous_sse2_ssse3(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 = load i32*, i32** %6
%10 = call i32 @avg_422_downsample_ag_rb_vectors_n_save_previous_sse2(i32* %7, i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @avg_422_downsample_ag_rb_vectors_n_save_previous_sse2_ssse3(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @avg_422_downsample_ag_rb_vectors_n_save_previous_sse2(i32* %0, i32* %1, i32* %2)
ret void
}
/* Variables and functions */
char *_strtok_r(char *, char const *, char **, int);
char *strtok_r(char *s, const char *delim, char **lasts) {
  return _strtok_r(s, delim, lasts, 1);
}


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

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

LLVM IR (-O0):
define i8* @strtok_r(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 i8* @_strtok_r(i8* %7, i8* %8, i8** %9, i32 1)
ret i8* %10
}

LLVM IR (-O2):
define i8* @strtok_r(i8* %0, i8* %1, i8** %2) {
%4 = tail call i8* @_strtok_r(i8* %0, i8* %1, i8** %2, i32 1)
ret i8* %4
}
void foo257(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo257(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int EAST_CD_8(int in) {
  FILE *fin = fopen("func_header.h.ecov", "a");
  if (fin) {
    fprintf(fin, "CD8:%d\n", in);
  }
  fclose(fin);
  return in;
}


x86 assembly (clang, -O0):
<EAST_CD_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1170 <EAST_CD_8+0x40>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EAST_CD_8>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xec4(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <EAST_CD_8+0x31>
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"func_header.h.ecov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [8 x i8] c"CD8:%d\0A\00"
define i32 @EAST_CD_8(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = load i32, i32* %2
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [19 x i8] c"func_header.h.ecov\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [8 x i8] c"CD8:%d\0A\00"
define i32 @EAST_CD_8(i32 returned %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @fclose(i32* %2)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *, ...);
int /*<<< orphan*/ stderr;
void option_error(const char *s) {
  fprintf(stderr, s, NULL);
  fprintf(stderr, "\nTry `"
                  "netmon"
                  " --help' for more information.\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<option_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<option_error>:
push   %rbx
mov    %rdi,%rsi
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0ATry `netmon --help' for more information.\0A\00"
@EXIT_FAILURE = global i32 0
define void @option_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* %4, i8* null)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0ATry `netmon --help' for more information.\0A\00"
@EXIT_FAILURE = global i32 0
define void @option_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* %0, i8* null)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
unsigned short int cast_long_ushort_fast(long int x) {
  return (unsigned short int)x;
}


x86 assembly (clang, -O0):
<cast_long_ushort_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @cast_long_ushort_fast(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @cast_long_ushort_fast(i64 %0) {
%2 = trunc i64 %0 to i16
ret i16 %2
}
unsigned foo() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XQueryPointer(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int *, int *, int *, int *, unsigned int *);
Window Find_Child_At_Pointer(Display *dpy, Window win) {
  Window root_return, child_return;
  int dummyi;
  unsigned int dummyu;
  XQueryPointer(dpy, win, &root_return, &child_return, &dummyi, &dummyi,
                &dummyi, &dummyi, &dummyu);
  return child_return;
}


x86 assembly (clang, -O0):
<Find_Child_At_Pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r10
lea    -0x1c(%rbp),%rax
mov    %r10,%r8
mov    %r10,%r9
mov    %r10,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <XQueryPointer@plt>
mov    -0x14(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Find_Child_At_Pointer>:
sub    $0x20,%rsp
lea    0x14(%rsp),%rax
lea    0x18(%rsp),%r8
lea    0x1c(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %r8,%r9
push   %rax
push   %r8
push   %r8
call   1030 <XQueryPointer@plt>
add    $0x20,%rsp
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @Find_Child_At_Pointer(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = call i32 @XQueryPointer(i32* %0, i32 %1, i32* %3, i32* %4, i32* %5, i32* %5, i32* %5, i32* %5, i32* %6)
%12 = load i32, i32* %4
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ comm_printer_write(unsigned char *, int);
void comm_printer_writeFFFx(char x) {
  unsigned char string[4];
  string[0] = string[1] = string[2] = 0xFF;
  string[3] = x;
  comm_printer_write(string, 4);
}


x86 assembly (clang, -O0):
<comm_printer_writeFFFx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0xff,-0x3(%rbp)
movb   $0xff,-0x4(%rbp)
movb   $0xff,-0x5(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
lea    -0x5(%rbp),%rdi
mov    $0x4,%esi
call   1030 <comm_printer_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comm_printer_writeFFFx>:
push   %rax
movb   $0xff,0x6(%rsp)
movw   $0xffff,0x4(%rsp)
mov    %dil,0x7(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <comm_printer_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @comm_printer_writeFFFx(i8 signext %0) {
%2 = alloca i8
%3 = alloca [4 x i8]
store i8 %0, i8* %2
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 -1, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 -1, i8* %5
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 -1, i8* %6
%7 = load i8, i8* %2
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %7, i8* %8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%10 = call i32 @comm_printer_write(i8* %9, i32 4)
ret void
}

LLVM IR (-O2):
define void @comm_printer_writeFFFx(i8 signext %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
store i8 -1, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
store i8 -1, i8* %5
store i8 -1, i8* %3
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
store i8 %0, i8* %6
%7 = call i32 @comm_printer_write(i8* %3, i32 4)
ret void
}
const char *plat_dll_ext() { return "so"; }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"so\00"
define i8* @plat_dll_ext() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
char *calloc(n)
int n;
{}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @calloc(i32 %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long f6(unsigned long x,
                                              unsigned long y) {
  unsigned long r = x + y;
  if (r < x)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1141 <f6+0x31>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
push   %rbx
mov    %rdi,%rbx
add    %rsi,%rbx
jae    1120 <f6+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @f6(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = icmp ult i64 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
void led_flip(int led) {
  int current_value;
  current_value = *(unsigned int *)0xf0000028;
  *(unsigned int *)0xf0000028 = current_value ^ (1 << led);
}


x86 assembly (clang, -O0):
<led_flip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xf0000028,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0xc(%rbp),%ecx
xor    %eax,%ecx
mov    $0xf0000028,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_flip>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    $0xf0000028,%ecx
xor    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @led_flip(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* inttoptr (i64 4026531880 to i32*)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = shl i32 1, %6
%8 = xor i32 %5, %7
store i32 %8, i32* inttoptr (i64 4026531880 to i32*)
ret void
}

LLVM IR (-O2):
define void @led_flip(i32 %0) {
%2 = load i32, i32* inttoptr (i64 4026531880 to i32*)
%3 = shl nuw i32 1, %0
%4 = xor i32 %2, %3
store i32 %4, i32* inttoptr (i64 4026531880 to i32*)
ret void
}
/* Variables and functions */
scalar_t__ toupper(char);
char *my_strupper(char *Str) {
  char *ChPtr;
  for (ChPtr = Str; *ChPtr; ChPtr++)
    *ChPtr = (char)toupper(*ChPtr);
  return (Str);
}


x86 assembly (clang, -O0):
<my_strupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <my_strupper+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <my_strupper+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strupper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <my_strupper+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <my_strupper+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @my_strupper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i64 @toupper(i8 signext %5)
%8 = trunc i64 %7 to i8
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ sleep(int);
void child_process() {
  printf("PID: %d, Parent PID: %d\n", getpid(), getppid());
  sleep(4);
  printf("PID: %d, Parent PID: %d. I've been adopted\n", getpid(), getppid());
  exit(0);
}


x86 assembly (clang, -O0):
<child_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getppid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
call   1070 <sleep@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getppid@plt>
mov    -0x4(%rbp),%esi
mov    %eax,%edx
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<child_process>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xe98(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    $0x4,%edi
call   1070 <sleep@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xe87(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"PID: %d, Parent PID: %d\0A\00"
@.str.1 = [44 x i8] c"PID: %d, Parent PID: %d. I've been adopted\0A\00"
define void @child_process() {
%1 = call i32 (...) @getpid()
%2 = call i32 (...) @getppid()
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = call i32 @sleep(i32 4)
%5 = call i32 (...) @getpid()
%6 = call i32 (...) @getppid()
%7 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"PID: %d, Parent PID: %d\0A\00"
@.str.1 = [44 x i8] c"PID: %d, Parent PID: %d. I've been adopted\0A\00"
define void @child_process() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (...) @getppid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = tail call i32 @sleep(i32 4)
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 (...) @getppid()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
bool GetBit(size_t word, size_t b) { return (word >> b) & 1; }


x86 assembly (clang, -O0):
<GetBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBit>:
mov    %rsi,%rcx
mov    %rdi,%rax
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @GetBit(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = lshr i64 %5, %6
%8 = and i64 %7, 1
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @GetBit(i64 %0, i64 %1) {
%3 = lshr i64 %0, %1
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
long long parse_long_long(char const *, long);
long parse_long(const char *value, long default_value) {
  long long long_long_value = parse_long_long(value, default_value);
  if ((long long)(long)long_long_value != long_long_value)
    return default_value;
  return (long)long_long_value;
}


x86 assembly (clang, -O0):
<parse_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <parse_long_long@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     114c <parse_long+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <parse_long+0x44>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_long>:
jmp    1030 <parse_long_long@plt>

LLVM IR (-O0):
define i64 @parse_long(i8* %0, i64 %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i64 @parse_long_long(i8* %7, i64 %8)
store i64 %9, i64* %6
%10 = load i64, i64* %6
%11 = load i64, i64* %6
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i64, i64* %5
store i64 %14, i64* %3
br label %17
15: ; preds = %2
%16 = load i64, i64* %6
store i64 %16, i64* %3
br label %17
17: ; preds = %15, %13
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @parse_long(i8* %0, i64 %1) {
%3 = tail call i64 @parse_long_long(i8* %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_lvector(unsigned long *v, long nl, long nh) {
  free((char *)(v + nl - 0));
}


x86 assembly (clang, -O0):
<free_lvector>:
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),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_lvector>:
lea    (%rdi,%rsi,8),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_lvector(i64* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i64, i64* %0, i64 %1
%5 = bitcast i64* %4 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
void STEAM_TrackProgress(int enable) {}


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

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

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

LLVM IR (-O2):
define void @STEAM_TrackProgress(i32 %0) {
ret void
}
/* Variables and functions */
int isupper(char c) { return (c >= 'A') && (c <= 'Z'); }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isupper+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isupper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lprintf(int, char *, char *);
int /*<<< orphan*/ strncpy(char *, unsigned char *, int);
int decode_displayname(unsigned char *element, int element_len) {
  char displayname[31];
  strncpy(displayname, element, element_len);
  displayname[element_len] = 0;
  lprintf(14, "Display Name: %s\r\n", displayname);
  return 0;
}


x86 assembly (clang, -O0):
<decode_displayname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
movslq -0xc(%rbp),%rax
movb   $0x0,-0x30(%rbp,%rax,1)
lea    -0x30(%rbp),%rdx
mov    $0xe,%edi
lea    0xea8(%rip),%rsi
call   1040 <lprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_displayname>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ebx
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1030 <strncpy@plt>
movslq %ebx,%rax
movb   $0x0,(%rsp,%rax,1)
lea    0xeb9(%rip),%rsi
mov    $0xe,%edi
mov    %r14,%rdx
call   1040 <lprintf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Display Name: %s\0D\0A\00"
define i32 @decode_displayname(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [31 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [31 x i8], [31 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @strncpy(i8* %6, i8* %7, i32 %8)
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [31 x i8], [31 x i8]* %5, i64 0, i64 %11
store i8 0, i8* %12
%13 = getelementptr inbounds [31 x i8], [31 x i8]* %5, i64 0, i64 0
%14 = call i32 @lprintf(i32 14, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Display Name: %s\0D\0A\00"
define i32 @decode_displayname(i8* %0, i32 %1) {
%3 = alloca [31 x i8]
%4 = getelementptr inbounds [31 x i8], [31 x i8]* %3, i64 0, i64 0
%5 = call i32 @strncpy(i8* %4, i8* %0, i32 %1)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds [31 x i8], [31 x i8]* %3, i64 0, i64 %6
store i8 0, i8* %7
%8 = call i32 @lprintf(i32 14, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
void __bid_is754R(int *retval) { *retval = 1; }


x86 assembly (clang, -O0):
<__bid_is754R>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__bid_is754R(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int calc(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int result = calc(3, 6);
  printf("Result: %d\n", result);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3,%edi
mov    $0x6,%esi
call   1040 <calc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x6,%esi
call   1040 <calc@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"Result: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @calc(i32 3, i32 6)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
bool nrf52_errata_33(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_33() {
ret i32 0
}
int test_imm_72uint32_reg(unsigned int val) {
  return ((val) & (0x72 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_72uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x72,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_72uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 114
%5 = icmp ne i32 %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_72uint32_reg(i32 %0) {
%2 = and i32 %0, 114
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int /*<<< orphan*/ AT_REMOVEDIR;
int unlinkat(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int rmdir(const char *pathname) {
  return unlinkat(AT_FDCWD, pathname, AT_REMOVEDIR);
}


x86 assembly (clang, -O0):
<rmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
call   1030 <unlinkat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmdir>:
mov    %rdi,%rsi
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
jmp    1030 <unlinkat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
@AT_REMOVEDIR = global i32 0
define i32 @rmdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @AT_FDCWD
%4 = load i8*, i8** %2
%5 = load i32, i32* @AT_REMOVEDIR
%6 = call i32 @unlinkat(i32 %3, i8* %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
@AT_REMOVEDIR = global i32 0
define i32 @rmdir(i8* %0) {
%2 = load i32, i32* @AT_FDCWD
%3 = load i32, i32* @AT_REMOVEDIR
%4 = tail call i32 @unlinkat(i32 %2, i8* %0, i32 %3)
ret i32 %4
}
int test_imm_B9int16_mem(short *val) {
  return ((*val) & (-0xB9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B9int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff47,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B9int16_mem>:
movzwl (%rdi),%eax
test   $0xff47,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B9int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -185
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct dequeue_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct dequeue_node *);
void release_dequeue_node(struct dequeue_node *node) {
  if (node) {
    free(node);
  }
}


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

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

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

LLVM IR (-O2):
%struct.dequeue_node = type { i32 }
define void @release_dequeue_node(%struct.dequeue_node* %0) {
%2 = icmp eq %struct.dequeue_node* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.dequeue_node* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int evenBits(void) {
  int z;
  int f;
  z = 0x55;
  f = (z + (z << 8) + (z << 16) + (z << 24));
  return f;
}


x86 assembly (clang, -O0):
<evenBits>:
push   %rbp
mov    %rsp,%rbp
movl   $0x55,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @evenBits() {
%1 = alloca i32
%2 = alloca i32
store i32 85, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = shl i32 %4, 8
%6 = add nsw i32 %3, %5
%7 = load i32, i32* %1
%8 = shl i32 %7, 16
%9 = add nsw i32 %6, %8
%10 = load i32, i32* %1
%11 = shl i32 %10, 24
%12 = add nsw i32 %9, %11
store i32 %12, i32* %2
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @evenBits() {
ret i32 1431655765
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int FDSelect(int, int, struct timeval *);
int FDIsWritable(int fd) {
  struct timeval tv;
  tv.tv_sec = 0;
  tv.tv_usec = 0;
  if (FDSelect(fd, 2, &tv) & 2)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<FDIsWritable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
lea    -0x18(%rbp),%rdx
call   1030 <FDSelect@plt>
and    $0x2,%eax
cmp    $0x0,%eax
je     1154 <FDIsWritable+0x44>
movl   $0x1,-0x4(%rbp)
jmp    115b <FDIsWritable+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FDIsWritable>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdx
mov    $0x2,%esi
call   1030 <FDSelect@plt>
shr    %eax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @FDIsWritable(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timeval
store i32 %0, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
store i64 0, i64* %6
%7 = load i32, i32* %3
%8 = call i32 @FDSelect(i32 %7, i32 2, %struct.timeval* %4)
%9 = and i32 %8, 2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @FDIsWritable(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = bitcast %struct.timeval* %2 to i8*
%5 = call i32 @FDSelect(i32 %0, i32 2, %struct.timeval* %2)
%6 = lshr i32 %5, 1
%7 = and i32 %6, 1
ret i32 %7
}
/* Variables and functions */
int ebbrt_newlib_read(int, char *, int);
int read(int file, char *ptr, int len) {
  return ebbrt_newlib_read(file, ptr, len);
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ebbrt_newlib_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
jmp    1030 <ebbrt_newlib_read@plt>

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

LLVM IR (-O2):
define i32 @read(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @ebbrt_newlib_read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SCOTCHFVERSION(int *const, int *const, int *const);
void scotchfversion__(int *const versptr, int *const relaptr,
                      int *const patcptr) {
  SCOTCHFVERSION(versptr, relaptr, patcptr);
}


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

x86 assembly (clang, -O2):
<scotchfversion__>:
jmp    1030 <SCOTCHFVERSION@plt>

LLVM IR (-O0):
define void @scotchfversion__(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 = load i32*, i32** %6
%10 = call i32 @SCOTCHFVERSION(i32* %7, i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @scotchfversion__(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @SCOTCHFVERSION(i32* %0, i32* %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ read_perms(int);
int set_permissoins(int);
int /*<<< orphan*/ stderr;
void set_perm_wrapper(int perms) {
  int ret = set_permissoins(perms);
  if (ret) {
    fprintf(stderr, "[!!] Failed to set permissions!!!");
    read_perms(0);
    exit(1);
  }
  read_perms(perms);
}


x86 assembly (clang, -O0):
<set_perm_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <set_permissoins@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1186 <set_perm_wrapper+0x46>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1050 <read_perms@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x4(%rbp),%edi
call   1050 <read_perms@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_perm_wrapper>:
push   %rbx
mov    %edi,%ebx
call   1030 <set_permissoins@plt>
test   %eax,%eax
jne    1154 <set_perm_wrapper+0x14>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <read_perms@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1050 <read_perms@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"[!!] Failed to set permissions!!!\00"
define void @set_perm_wrapper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @set_permissoins(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @read_perms(i32 0)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i32, i32* %2
%15 = call i32 @read_perms(i32 %14)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"[!!] Failed to set permissions!!!\00"
define void @set_perm_wrapper(i32 %0) {
%2 = tail call i32 @set_permissoins(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @read_perms(i32 0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = tail call i32 @read_perms(i32 %0)
ret void
}