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

/* Variables and functions */
uint64_t pixel64_get_a16(uint64_t pixel) {
  return (pixel & 0xFFFF000000000000) >> 48;
}


x86 assembly (clang, -O0):
<pixel64_get_a16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xffff000000000000,%rcx
and    %rcx,%rax
shr    $0x30,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel64_get_a16>:
movslq %edi,%rax
shr    $0x30,%rax
ret

LLVM IR (-O0):
define i32 @pixel64_get_a16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = and i64 %4, -281474976710656
%6 = lshr i64 %5, 48
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @pixel64_get_a16(i32 %0) {
%2 = sext i32 %0 to i64
%3 = lshr i64 %2, 48
%4 = trunc i64 %3 to i32
ret i32 %4
}
void main() {
  int i;
  int char_to_index[256];
  int index_to_char[257];
  for (i = 0; i < 256; i++) {
    char_to_index[i] = i + 1;
    index_to_char[i + 1] = i;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7a0,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1150 <main+0x50>
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x410(%rbp,%rax,4)
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
mov    %ecx,-0x820(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <main+0x12>
add    $0x7a0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca [256 x i32]
%3 = alloca [257 x i32]
store i32 0, i32* %1
br label %4
4: ; preds = %18, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 256
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 %11
store i32 %9, i32* %12
%13 = load i32, i32* %1
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [257 x i32], [257 x i32]* %3, i64 0, i64 %16
store i32 %13, i32* %17
br label %18
18: ; preds = %7
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Type definitions */
typedef unsigned long long uint8_t;

/* Variables and functions */
unsigned long long EXTRACT_BYTE_f(void *x, int n) { return ((uint8_t *)x)[n]; }


x86 assembly (clang, -O0):
<EXTRACT_BYTE_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EXTRACT_BYTE_f>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define i64 @EXTRACT_BYTE_f(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 = bitcast i8* %5 to i64*
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %6, i64 %8
%10 = load i64, i64* %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @EXTRACT_BYTE_f(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i64*
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i64, i64* %3, i64 %4
%6 = load i64, i64* %5
ret i64 %6
}
void gtk_color_selection_set_has_opacity_control() {}


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

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

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

LLVM IR (-O2):
define void @gtk_color_selection_set_has_opacity_control() {
ret void
}
/* Type definitions */
struct timespec {
  int member_1;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void udelay(int us) {
  struct timespec ts = {0, us * 1000};
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<udelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udelay>:
push   %rax
movl   $0x0,(%rsp)
imul   $0x3e8,%edi,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @udelay(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 0, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 1000
store i32 %7, i32* %5
%8 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @udelay(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%6 = mul nsw i32 %0, 1000
store i32 %6, i32* %5
%7 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Type definitions */
struct ln_date {
  int dummy;
};

/* Variables and functions */
double ln_get_julian_day(struct ln_date *);
unsigned int ln_get_day_of_week(struct ln_date *date) {
  unsigned int day;
  double JD;
  JD = ln_get_julian_day(date);
  JD += 1.5;
  day = (int)JD % 7;
  return day;
}


x86 assembly (clang, -O0):
<ln_get_day_of_week>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ln_get_julian_day@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xece(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_day_of_week>:
push   %rax
call   1030 <ln_get_julian_day@plt>
addsd  0xee2(%rip),%xmm0
cvttsd2si %xmm0,%eax
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x2,%eax
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ln_date = type { i32 }
define i32 @ln_get_day_of_week(%struct.ln_date* %0) {
%2 = alloca %struct.ln_date*
%3 = alloca i32
%4 = alloca double
store %struct.ln_date* %0, %struct.ln_date** %2
%5 = load %struct.ln_date*, %struct.ln_date** %2
%6 = call double @ln_get_julian_day(%struct.ln_date* %5)
store double %6, double* %4
%7 = load double, double* %4
%8 = fadd double %7, 1.500000e+00
store double %8, double* %4
%9 = load double, double* %4
%10 = fptosi double %9 to i32
%11 = srem i32 %10, 7
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
%struct.ln_date = type { i32 }
define i32 @ln_get_day_of_week(%struct.ln_date* %0) {
%2 = tail call double @ln_get_julian_day(%struct.ln_date* %0)
%3 = fadd double %2, 1.500000e+00
%4 = fptosi double %3 to i32
%5 = srem i32 %4, 7
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void STEST902(int v) {
  printf("C902:(%d):(3):Call by value from variable\n", v);
}


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

x86 assembly (clang, -O2):
<STEST902>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"C902:(%d):(3):Call by value from variable\0A\00"
define void @STEST902(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"C902:(%d):(3):Call by value from variable\0A\00"
define void @STEST902(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: random [-elrUuw] [-f filename] [denominator]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"usage: random [-elrUuw] [-f filename] [denominator]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"usage: random [-elrUuw] [-f filename] [denominator]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void WriteSGMLPostamble(FILE *f) {
  fputs("\n", f);
  fputs("</article>\n", f);
}


x86 assembly (clang, -O0):
<WriteSGMLPostamble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xee3(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteSGMLPostamble>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
lea    0xec8(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [12 x i8] c"</article>\0A\00"
define void @WriteSGMLPostamble(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"</article>\0A\00"
define void @WriteSGMLPostamble(i32* nocapture %0) {
%2 = tail call i32 @fputc(i32 10, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i64 11, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_BLEND;
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ GL_ONE_MINUS_SRC_ALPHA;
int /*<<< orphan*/ GL_SRC_ALPHA;
int /*<<< orphan*/ glBlendFunc(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void alpha_init(void) {
  glEnable(GL_BLEND);
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  glShadeModel(GL_FLAT);
  glClearColor(0.0, 0.0, 0.0, 0.0);
}


x86 assembly (clang, -O0):
<alpha_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
call   1030 <glBlendFunc@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1060 <glShadeModel@plt>
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha_init>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
call   1030 <glBlendFunc@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1060 <glShadeModel@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
pop    %rax
jmp    1050 <glClearColor@plt>

LLVM IR (-O0):
@GL_BLEND = global i32 0
@GL_SRC_ALPHA = global i32 0
@GL_ONE_MINUS_SRC_ALPHA = global i32 0
@GL_FLAT = global i32 0
define void @alpha_init() {
%1 = load i32, i32* @GL_BLEND
%2 = call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_SRC_ALPHA
%4 = load i32, i32* @GL_ONE_MINUS_SRC_ALPHA
%5 = call i32 @glBlendFunc(i32 %3, i32 %4)
%6 = load i32, i32* @GL_FLAT
%7 = call i32 @glShadeModel(i32 %6)
%8 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_BLEND = global i32 0
@GL_SRC_ALPHA = global i32 0
@GL_ONE_MINUS_SRC_ALPHA = global i32 0
@GL_FLAT = global i32 0
define void @alpha_init() {
%1 = load i32, i32* @GL_BLEND
%2 = tail call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_SRC_ALPHA
%4 = load i32, i32* @GL_ONE_MINUS_SRC_ALPHA
%5 = tail call i32 @glBlendFunc(i32 %3, i32 %4)
%6 = load i32, i32* @GL_FLAT
%7 = tail call i32 @glShadeModel(i32 %6)
%8 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}
void JmpE() {}


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

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

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

LLVM IR (-O2):
define void @JmpE() {
ret void
}
void XkbComputeEffectiveMap() {}


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

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

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

LLVM IR (-O2):
define void @XkbComputeEffectiveMap() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t get_resp_type(uint8_t type) { return (((uint8_t)0x01) << 7) | type; }


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

x86 assembly (clang, -O2):
<get_resp_type>:
mov    %edi,%eax
or     $0x80,%eax
ret

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

LLVM IR (-O2):
define i32 @get_resp_type(i32 %0) {
%2 = or i32 %0, 128
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ScreenFormat;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_ScreenFormat(void *_p) {
  if (_p == NULL)
    abort();
  free((ScreenFormat *)_p);
}


x86 assembly (clang, -O0):
<free_ScreenFormat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_ScreenFormat+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ScreenFormat>:
test   %rdi,%rdi
je     112a <free_ScreenFormat+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_ScreenFormat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_ScreenFormat(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
char lower(char ch) { return (ch >= 'A' && ch <= 'Z') ? (ch + 'a' - 'A') : ch; }


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <lower+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <lower+0x36>
movsbl -0x1(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <lower+0x3d>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @lower(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 %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 97
%14 = sub nsw i32 %13, 65
br label %18
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %15, %10
%19 = phi i32 [ %14, %10 ], [ %17, %15 ]
%20 = trunc i32 %19 to i8
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @lower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ srand48(long);
scalar_t__ time(int /*<<< orphan*/ *);
void randomize(void) { srand48((long int)time(NULL)); }


x86 assembly (clang, -O0):
<randomize>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,%rdi
call   1040 <srand48@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomize>:
push   %rax
xor    %edi,%edi
call   1030 <time@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <srand48@plt>

LLVM IR (-O0):
define void @randomize() {
%1 = call i64 @time(i32* null)
%2 = call i32 @srand48(i64 %1)
ret void
}

LLVM IR (-O2):
define void @randomize() {
%1 = tail call i64 @time(i32* null)
%2 = tail call i32 @srand48(i64 %1)
ret void
}
unsigned char *hmac224digest(bitstr, bitcnt, key, keylen)
unsigned char *bitstr;
unsigned long bitcnt;
unsigned char *key;
unsigned int keylen;
{ return ((unsigned char *)hmaccomp(224, 1, bitstr, bitcnt, key, keylen)); }


x86 assembly (clang, -O0):
<hmac224digest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    $0xe0,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <hmaccomp@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac224digest>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0xe0,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <hmaccomp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @hmac224digest(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 224, i32 1, i8* %9, i64 %10, i8* %11, i32 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @hmac224digest(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 (i32, i32, i8*, i64, i8*, i32, ...) bitcast (i32 (...)* @hmaccomp to i32 (i32, i32, i8*, i64, i8*, i32, ...)*)(i32 224, i32 1, i8* %0, i64 %1, i8* %2, i32 %3)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
void get_initial_data_value_(n) float *n;
{ *n = 0.; }


x86 assembly (clang, -O0):
<get_initial_data_value_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @get_initial_data_value_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
store float 0.000000e+00, float* %3
ret void
}

LLVM IR (-O2):
define void @get_initial_data_value_(float* nocapture writeonly %0) {
store float 0.000000e+00, float* %0
ret void
}
/* Variables and functions */
int partition(int *, int);
void quicksort(int a[], int n) {
  int pindex;
  if (n <= 1) {
    return;
  } else {
    pindex = partition(a, n);
    quicksort(a, pindex);
    quicksort(a + pindex + 1, n - pindex - 1);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     113e <quicksort+0x1e>
jmp    117a <quicksort+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <partition@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1040 <quicksort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     115f <quicksort+0x3f>
mov    %esi,%r14d
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <partition@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <quicksort@plt>
movslq %ebp,%rax
lea    (%rbx,%rax,4),%rbx
add    $0x4,%rbx
not    %eax
add    %r14d,%eax
mov    %eax,%r14d
cmp    $0x1,%eax
jg     1130 <quicksort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ %1, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = tail call i32 @partition(i32* %6, i32 %5)
tail call void @quicksort(i32* %6, i32 %7)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = getelementptr inbounds i32, i32* %9, i64 %8
%11 = xor i32 %7, -1
%12 = add i32 %5, %11
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %4
14: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
int /*<<< orphan*/ udpSend(int, char const *);
int wpStatus();
void send(const char *s) {
  printf("%4x SENDING: %s\n", wpStatus(), s);
  udpSend(13231, s);
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <wpStatus@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    $0x33af,%edi
call   1030 <udpSend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <wpStatus@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <printf@plt>
mov    $0x33af,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <udpSend@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%4x SENDING: %s\0A\00"
define void @send(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @wpStatus()
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @udpSend(i32 13231, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%4x SENDING: %s\0A\00"
define void @send(i8* %0) {
%2 = tail call i32 (...) @wpStatus()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %0)
%4 = tail call i32 @udpSend(i32 13231, i8* %0)
ret void
}
void DMA2_Channel1_IRQHandler(void) {}


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

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

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

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

/* Variables and functions */
uint32_t I(uint32_t B, uint32_t C, uint32_t D) { return C ^ (B | ~D); }


x86 assembly (clang, -O0):
<I>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I>:
mov    %edx,%eax
not    %eax
or     %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @I(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* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = xor i32 %9, -1
%11 = or i32 %8, %10
%12 = xor i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @I(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = or i32 %4, %0
%6 = xor i32 %5, %1
ret i32 %6
}
void add_swap(char **word1, char **word2) {
  char *ptr;
  ptr = *word1;
  *word1 = *word2;
  *word2 = ptr;
}


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

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

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

LLVM IR (-O2):
define void @add_swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
void le_uint8_write(void *ptr, unsigned v) {
  unsigned char *ptr8 = (unsigned char *)ptr;
  ptr8[0] = v;
}


x86 assembly (clang, -O0):
<le_uint8_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_uint8_write>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @le_uint8_write(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
ret void
}

LLVM IR (-O2):
define void @le_uint8_write(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
ret void
}
char complement(char c) {
  if (c == 'A')
    return 'U';
  else if (c == 'C')
    return 'G';
  else if (c == 'G')
    return 'C';
  else if (c == 'U')
    return 'A';
  else
    return 'A';
}


x86 assembly (clang, -O0):
<complement>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jne    1120 <complement+0x20>
movb   $0x55,-0x1(%rbp)
jmp    1166 <complement+0x66>
movsbl -0x2(%rbp),%eax
cmp    $0x43,%eax
jne    1136 <complement+0x36>
movb   $0x47,-0x1(%rbp)
jmp    1166 <complement+0x66>
movsbl -0x2(%rbp),%eax
cmp    $0x47,%eax
jne    114c <complement+0x4c>
movb   $0x43,-0x1(%rbp)
jmp    1166 <complement+0x66>
movsbl -0x2(%rbp),%eax
cmp    $0x55,%eax
jne    1162 <complement+0x62>
movb   $0x41,-0x1(%rbp)
jmp    1166 <complement+0x66>
movb   $0x41,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<complement>:
add    $0xbf,%dil
cmp    $0x14,%dil
ja     1120 <complement+0x20>
mov    $0x55,%al
movzbl %dil,%ecx
lea    0xee9(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x41,%al
ret
mov    $0x47,%al
ret
mov    $0x43,%al
ret

LLVM IR (-O0):
define signext i8 @complement(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 65
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 85, i8* %2
br label %24
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 67
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 71, i8* %2
br label %24
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 71
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 67, i8* %2
br label %24
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 85
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 65, i8* %2
br label %24
23: ; preds = %18
store i8 65, i8* %2
br label %24
24: ; preds = %23, %22, %17, %12, %7
%25 = load i8, i8* %2
ret i8 %25
}

LLVM IR (-O2):
define signext i8 @complement(i8 signext %0) {
switch i8 %0, label %5 [
i8 65, label %6
i8 67, label %2
i8 71, label %3
i8 85, label %4
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3, %2
%7 = phi i8 [ 71, %2 ], [ 67, %3 ], [ 65, %4 ], [ 65, %5 ], [ 85, %1 ]
ret i8 %7
}
int scheme_entry() {
  int v = 8;
  int c = v << 2;
  return c;
}


x86 assembly (clang, -O0):
<scheme_entry>:
push   %rbp
mov    %rsp,%rbp
movl   $0x8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @scheme_entry() {
ret i32 32
}
/* Variables and functions */
int /*<<< orphan*/ lgen2(char *, int, int);
void cgdecps(int a, int v) { lgen2("subq\t$%d,%c%d", v, a); }


x86 assembly (clang, -O0):
<cgdecps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <lgen2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdecps>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
jmp    1030 <lgen2@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"subq\09$%d,%c%d\00"
define void @cgdecps(i32 %0, i32 %1) {
%3 = tail call i32 @lgen2(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int MAP_HUGETLB;
int /*<<< orphan*/ mmap_chunks_higher(int, int);
int /*<<< orphan*/ mmap_chunks_lower(int, int);
int /*<<< orphan*/ printf(char *);
void alloc_16g() {
  printf("Allocating 16G chunks < 128TB \n");
  mmap_chunks_lower(1, (MAP_HUGETLB | (34 << 26)));
  printf("Allocating 16G chunks > 128TB \n");
  mmap_chunks_higher(1, (MAP_HUGETLB | (34 << 26)));
}


x86 assembly (clang, -O0):
<alloc_16g>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
or     $0x88000000,%esi
mov    $0x1,%edi
call   1050 <mmap_chunks_lower@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
or     $0x88000000,%esi
mov    $0x1,%edi
call   1040 <mmap_chunks_higher@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_16g>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea9(%rip),%r14
mov    $0x88000000,%ebx
mov    (%r14),%esi
or     %ebx,%esi
mov    $0x1,%edi
call   1050 <mmap_chunks_lower@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
or     (%r14),%ebx
mov    $0x1,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <mmap_chunks_higher@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Allocating 16G chunks < 128TB \0A\00"
@MAP_HUGETLB = global i32 0
@.str.1 = [32 x i8] c"Allocating 16G chunks > 128TB \0A\00"
define void @alloc_16g() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @MAP_HUGETLB
%3 = or i32 %2, -2013265920
%4 = call i32 @mmap_chunks_lower(i32 1, i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @MAP_HUGETLB
%7 = or i32 %6, -2013265920
%8 = call i32 @mmap_chunks_higher(i32 1, i32 %7)
ret void
}

LLVM IR (-O2):
@MAP_HUGETLB = global i32 0
@str = [31 x i8] c"Allocating 16G chunks < 128TB \00"
@str.2 = [31 x i8] c"Allocating 16G chunks > 128TB \00"
define void @alloc_16g() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @MAP_HUGETLB
%3 = or i32 %2, -2013265920
%4 = tail call i32 @mmap_chunks_lower(i32 1, i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
%6 = load i32, i32* @MAP_HUGETLB
%7 = or i32 %6, -2013265920
%8 = tail call i32 @mmap_chunks_higher(i32 1, i32 %7)
ret void
}
call(sname) char *sname;
{
  ot("CALL ");
  outstr(sname);
  nl();
}


x86 assembly (clang, -O0):
<call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outstr@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outstr@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"CALL \00"
define i32 @call(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %5)
%7 = call i32 (...) @nl()
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"CALL \00"
define i32 @call(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outstr to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (...) @nl()
ret i32 undef
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
double wy2u01(uint64_t r) {
  const double _wynorm = 1.0 / (1ull << 52);
  return (r & 0x000fffffffffffffull) * _wynorm;
}


x86 assembly (clang, -O0):
<wy2u01>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movabs $0x3cb0000000000000,%rax
mov    %rax,-0x10(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xfffffffffffff,%rcx
and    %rcx,%rax
cvtsi2sd %rax,%xmm0
movsd  0xecd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wy2u01>:
movslq %edi,%rax
movabs $0xfffffffffffff,%rcx
and    %rax,%rcx
cvtsi2sd %rcx,%xmm0
mulsd  0xee3(%rip),%xmm0
ret

LLVM IR (-O0):
define double @wy2u01(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
store double 0x3CB0000000000000, double* %3
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = and i64 %5, 4503599627370495
%7 = uitofp i64 %6 to double
%8 = fmul double %7, 0x3CB0000000000000
ret double %8
}

LLVM IR (-O2):
define double @wy2u01(i32 %0) {
%2 = sext i32 %0 to i64
%3 = and i64 %2, 4503599627370495
%4 = uitofp i64 %3 to double
%5 = fmul double %4, 0x3CB0000000000000
ret double %5
}
int foo(int i) {
  int index;
  int r = 0;
  for (index = i; index <= i + 4; index += 2)
    r++;
  return r;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x4,%ecx
cmp    %ecx,%eax
jg     113c <foo+0x3c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <foo+0x14>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x3(%rdi),%eax
cmp    %eax,%edi
cmovg  %edi,%eax
sub    %edi,%eax
add    $0x1,%eax
shr    %eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add i32 %0, 3
%3 = call i32 @llvm.smax.i32(i32 %0, i32 %2)
%4 = add i32 %3, 1
%5 = sub i32 %4, %0
%6 = lshr i32 %5, 1
%7 = add nuw i32 %6, 1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __cc_db_equal(double const *, double const *,
                                 double const *);
int __cc_db_smaller(const double *a, const double *b, const double *epsilon) {
  return ((*a - *b) < 0.0) && (!__cc_db_equal(a, b, epsilon));
}


x86 assembly (clang, -O0):
<__cc_db_smaller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm1
xor    %eax,%eax
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jbe    1162 <__cc_db_smaller+0x52>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__cc_db_equal@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cc_db_smaller>:
push   %rax
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
xor    %eax,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1133 <__cc_db_smaller+0x23>
call   1030 <__cc_db_equal@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__cc_db_smaller(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = load double*, double** %5
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %20
13: ; preds = %3
%14 = load double*, double** %4
%15 = load double*, double** %5
%16 = load double*, double** %6
%17 = call i32 @__cc_db_equal(double* %14, double* %15, double* %16)
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
br label %20
20: ; preds = %13, %3
%21 = phi i1 [ false, %3 ], [ %19, %13 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @__cc_db_smaller(double* %0, double* %1, double* %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fsub double %4, %5
%7 = fcmp olt double %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = tail call i32 @__cc_db_equal(double* %0, double* %1, double* %2)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %3
%13 = phi i32 [ 0, %3 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
unsigned int __get_cpsr();
int /*<<< orphan*/ __set_cpsr(unsigned int);
unsigned IRQ_restore(unsigned old_cpsr) {
  unsigned _cpsr_val;
  _cpsr_val = __get_cpsr();
  __set_cpsr((_cpsr_val & ~0x00000080) | (old_cpsr & 0x00000080));
  return _cpsr_val;
}


x86 assembly (clang, -O0):
<IRQ_restore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__get_cpsr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0xffffff7f,%edi
mov    -0x4(%rbp),%eax
and    $0x80,%eax
or     %eax,%edi
call   1030 <__set_cpsr@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IRQ_restore>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <__get_cpsr@plt>
mov    %eax,%ebp
and    $0xffffff7f,%eax
and    $0x80,%ebx
or     %eax,%ebx
mov    %ebx,%edi
call   1030 <__set_cpsr@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @IRQ_restore(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @__get_cpsr()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, -129
%7 = load i32, i32* %2
%8 = and i32 %7, 128
%9 = or i32 %6, %8
%10 = call i32 @__set_cpsr(i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @IRQ_restore(i32 %0) {
%2 = tail call i32 (...) @__get_cpsr()
%3 = and i32 %2, -129
%4 = and i32 %0, 128
%5 = or i32 %3, %4
%6 = tail call i32 @__set_cpsr(i32 %5)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ smsc911x_enable_broadcast_reception();
void enableBroadcastReception(void) { smsc911x_enable_broadcast_reception(); }


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

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

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

LLVM IR (-O2):
define void @enableBroadcastReception() {
%1 = tail call i32 (...) @smsc911x_enable_broadcast_reception()
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int timestamp_ns();
uint64_t timestamp_us() { return timestamp_ns() / 1000; }


x86 assembly (clang, -O0):
<timestamp_us>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <timestamp_ns@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp_us>:
push   %rax
xor    %eax,%eax
call   1030 <timestamp_ns@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @timestamp_us() {
%1 = call i32 (...) @timestamp_ns()
%2 = sdiv i32 %1, 1000
ret i32 %2
}

LLVM IR (-O2):
define i32 @timestamp_us() {
%1 = tail call i32 (...) @timestamp_ns()
%2 = sdiv i32 %1, 1000
ret i32 %2
}
void str2lower(char *str) {
  if (!str) {
    return;
  }
  while (*str) {
    if (*str >= 'A' && *str <= 'Z') {
      *str += 0x20;
    }
    ++str;
  }
}


x86 assembly (clang, -O0):
<str2lower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <str2lower+0x18>
jmp    1167 <str2lower+0x67>
jmp    111d <str2lower+0x1d>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1167 <str2lower+0x67>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1156 <str2lower+0x56>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1156 <str2lower+0x56>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111d <str2lower+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2lower>:
test   %rdi,%rdi
je     113a <str2lower+0x3a>
mov    (%rdi),%al
test   %al,%al
je     113a <str2lower+0x3a>
add    $0x1,%rdi
jmp    112b <str2lower+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     113a <str2lower+0x3a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1120 <str2lower+0x20>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1120 <str2lower+0x20>
ret

LLVM IR (-O0):
define void @str2lower(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %30
6: ; preds = %1
br label %7
7: ; preds = %27, %6
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %30
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %27
16: ; preds = %11
%17 = load i8*, i8** %2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 90
br i1 %20, label %21, label %27
21: ; preds = %16
%22 = load i8*, i8** %2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = add nsw i32 %24, 32
%26 = trunc i32 %25 to i8
store i8 %26, i8* %22
br label %27
27: ; preds = %21, %16, %11
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %2
br label %7
30: ; preds = %5, %7
ret void
}

LLVM IR (-O2):
define void @str2lower(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %13
%7 = phi i8 [ %15, %13 ], [ %4, %3 ]
%8 = phi i8* [ %14, %13 ], [ %0, %3 ]
%9 = add i8 %7, -65
%10 = icmp ult i8 %9, 26
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = add nuw nsw i8 %7, 32
store i8 %12, i8* %8
br label %13
13: ; preds = %11, %6
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %13, %3, %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t scsi_error_code(const uint8_t *requestsense) {
  return (requestsense[12] << 8) | requestsense[13];
}


x86 assembly (clang, -O0):
<scsi_error_code>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x34(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scsi_error_code>:
mov    0x30(%rdi),%eax
shl    $0x8,%eax
or     0x34(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @scsi_error_code(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 12
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 13
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @scsi_error_code(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 12
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 13
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}