xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glRectf(double, double, double, double);
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(0.0, 0.0, 1.0);
  glRectf(-0.5, -0.5, 0.5, 0.5);
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
xorps  %xmm1,%xmm1
movsd  0xeb3(%rip),%xmm2
movaps %xmm1,%xmm0
call   1050 <glColor3f@plt>
movsd  0xe93(%rip),%xmm1
movsd  0xe93(%rip),%xmm3
movaps %xmm1,%xmm0
movaps %xmm3,%xmm2
call   1040 <glRectf@plt>
mov    $0x0,%al
call   1060 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
movsd  0xea9(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
call   1050 <glColor3f@plt>
movsd  0xe9e(%rip),%xmm0
movsd  0xe9e(%rip),%xmm2
movaps %xmm0,%xmm1
movaps %xmm2,%xmm3
call   1040 <glRectf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 @glColor3f(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%4 = call i32 @glRectf(double -5.000000e-01, double -5.000000e-01, double 5.000000e-01, double 5.000000e-01)
%5 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 @glColor3f(double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%4 = tail call i32 @glRectf(double -5.000000e-01, double -5.000000e-01, double 5.000000e-01, double 5.000000e-01)
%5 = tail call i32 (...) @glFlush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ start_server(int /*<<< orphan*/);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    usage(argv[0]);
    return 0;
  }
  start_server(atoi(argv[1]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1168 <main+0x38>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    1183 <main+0x53>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1050 <start_server@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1148 <main+0x18>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1050 <start_server@plt>
jmp    1150 <main+0x20>
mov    (%rsi),%rdi
call   1030 <usage@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
br label %12
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = tail call i32 @start_server(i32 %10)
br label %12
12: ; preds = %7, %4
ret i32 0
}
char *calloc(num, size)
unsigned num, size;
{
  register char *mp;
  if ((mp = malloc(num *= size)) != 0)
    (void)memset(mp, 0, num);
  return (mp);
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    %eax,%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     115f <calloc+0x3f>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%eax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
imul   %esi,%ebx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1146 <calloc+0x26>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @calloc(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = zext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
tail call void @llvm.memset.p0i8.i64(i8* align 1 %5, i8 0, i64 %4, i1 false)
br label %8
8: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_img(void **pt) {
  free((void *)pt[0]);
  free((void *)pt);
}


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

x86 assembly (clang, -O2):
<free_img>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_img(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
%4 = bitcast i8** %0 to i8*
%5 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_pre_order_traverse(int, void (*)(int));
void pre_order_traverse(void (*callback)(int value)) {
  do_pre_order_traverse(1, callback);
}


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

x86 assembly (clang, -O2):
<pre_order_traverse>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <do_pre_order_traverse@plt>

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

LLVM IR (-O2):
define void @pre_order_traverse(void (i32)* %0) {
%2 = tail call i32 @do_pre_order_traverse(i32 1, void (i32)* %0)
ret void
}
/* Variables and functions */
int dialog_textbox(char const *, char *, int /*<<< orphan*/,
                   int /*<<< orphan*/);
int /*<<< orphan*/ numeric_arg(char **, int);
int call_textbox(const char *t, char *av[], int *offset_add) {
  *offset_add = 4;
  return dialog_textbox(t, av[1], numeric_arg(av, 2), numeric_arg(av, 3));
}


x86 assembly (clang, -O0):
<call_textbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1030 <numeric_arg@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1030 <numeric_arg@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
call   1040 <dialog_textbox@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_textbox>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movl   $0x4,(%rdx)
mov    0x8(%rsi),%r15
mov    %rsi,%rdi
mov    $0x2,%esi
call   1030 <numeric_arg@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <numeric_arg@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <dialog_textbox@plt>

LLVM IR (-O0):
define i32 @call_textbox(i8* %0, i8** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
store i32 4, i32* %7
%8 = load i8*, i8** %4
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = call i32 @numeric_arg(i8** %12, i32 2)
%14 = load i8**, i8*** %5
%15 = call i32 @numeric_arg(i8** %14, i32 3)
%16 = call i32 @dialog_textbox(i8* %8, i8* %11, i32 %13, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @call_textbox(i8* %0, i8** %1, i32* nocapture writeonly %2) {
store i32 4, i32* %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @numeric_arg(i8** %1, i32 2)
%7 = tail call i32 @numeric_arg(i8** %1, i32 3)
%8 = tail call i32 @dialog_textbox(i8* %0, i8* %5, i32 %6, i32 %7)
ret i32 %8
}
void rop3_251_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = T | stk3;
  stk1 = *D | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_251_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_251_0_1>:
mov    %esi,%eax
not    %eax
mov    %eax,%ecx
or     %edx,%ecx
movzbl (%rdi),%r8d
or     %r8d,%ecx
and    %ecx,%esi
and    %edx,%eax
not    %edx
and    %ecx,%edx
and    %r8d,%eax
or     %esi,%eax
or     %edx,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_251_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = and i32 %28, %30
%32 = load i8, i8* %7
%33 = zext i8 %32 to i32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = or i32 %31, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = xor i32 %42, -1
%44 = and i32 %40, %43
%45 = load i8*, i8** %4
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = and i32 %44, %47
%49 = or i32 %38, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_251_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %1 to i32
%5 = xor i32 %4, -1
%6 = zext i8 %2 to i32
%7 = trunc i32 %5 to i8
%8 = or i8 %7, %2
%9 = load i8, i8* %0
%10 = zext i8 %9 to i32
%11 = or i8 %8, %9
%12 = zext i8 %11 to i32
%13 = and i8 %11, %1
%14 = zext i8 %13 to i32
%15 = xor i32 %6, -1
%16 = and i32 %12, %15
%17 = and i32 %6, %5
%18 = and i32 %17, %10
%19 = or i32 %18, %14
%20 = or i32 %19, %16
%21 = trunc i32 %20 to i8
store i8 %21, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max_heapify(int *, int, int);
void build_max_heap(int *num, int num_length) {
  int count;
  for (count = (num_length - 1) / 2; count >= 0; count--) {
    max_heapify(num, count, num_length);
  }
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1157 <build_max_heap+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <max_heapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <build_max_heap+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
js     1141 <build_max_heap+0x31>
mov    %esi,%ebx
mov    %rdi,%r14
lea    -0x1(%rbx),%eax
shr    $0x1f,%eax
lea    (%rbx,%rax,1),%ebp
add    $0xffffffff,%ebp
sar    %ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <max_heapify@plt>
add    $0xffffffff,%ebp
jb     1130 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @build_max_heap(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 = sub nsw i32 %6, 1
%8 = sdiv i32 %7, 2
store i32 %8, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = call i32 @max_heapify(i32* %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = sdiv i32 %5, 2
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ %6, %4 ]
%9 = tail call i32 @max_heapify(i32* %0, i32 %8, i32 %1)
%10 = add nsw i32 %8, -1
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret void
}
/* Variables and functions */
double exp(double);
double xpect(double a, double b, double beta) {
  return 1.0 / (1.0 + exp((b - a) * beta));
}


x86 assembly (clang, -O0):
<xpect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
movsd  0xebd(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xpect>:
push   %rax
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
movsd  0xed6(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @xpect(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* %5
%8 = load double, double* %4
%9 = fsub double %7, %8
%10 = load double, double* %6
%11 = fmul double %9, %10
%12 = call double @exp(double %11)
%13 = fadd double 1.000000e+00, %12
%14 = fdiv double 1.000000e+00, %13
ret double %14
}

LLVM IR (-O2):
define double @xpect(double %0, double %1, double %2) {
%4 = fsub double %1, %0
%5 = fmul double %4, %2
%6 = tail call double @exp(double %5)
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double 1.000000e+00, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ glutCreateWindow(char *);
void s2winCreateWindow(char *title) { glutCreateWindow(title); }


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

x86 assembly (clang, -O2):
<s2winCreateWindow>:
jmp    1030 <glutCreateWindow@plt>

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

LLVM IR (-O2):
define void @s2winCreateWindow(i8* %0) {
%2 = tail call i32 @glutCreateWindow(i8* %0)
ret void
}
int feof2(long pos, long size) { return (pos > size); }


x86 assembly (clang, -O0):
<feof2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<feof2>:
xor    %eax,%eax
cmp    %rsi,%rdi
setg   %al
ret

LLVM IR (-O0):
define i32 @feof2(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 = icmp sgt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @feof2(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puthd(char *, char *, char *);
void clrhd(char *header) {
  static char temp[] = "{ HEADER_BYTES";
  header[0] = '}';
  temp[1] = 10;
  puthd(temp, "    0", header);
}


x86 assembly (clang, -O0):
<clrhd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x7d,(%rax)
movb   $0xa,0x2eff(%rip)
mov    -0x8(%rbp),%rdx
lea    0x2ef3(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1030 <puthd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrhd>:
mov    %rdi,%rdx
movb   $0x7d,(%rdi)
movb   $0xa,0x2f0c(%rip)
lea    0x2f04(%rip),%rdi
lea    0xed5(%rip),%rsi
jmp    1030 <puthd@plt>

LLVM IR (-O0):
@clrhd.temp = internal global [15 x i8] c"{ HEADER_BYTES\00"
@.str = [6 x i8] c" 0\00"
define void @clrhd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 125, i8* %4
store i8 10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @clrhd.temp, i64 0, i64 1)
%5 = load i8*, i8** %2
%6 = call i32 @puthd(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @clrhd.temp, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@clrhd.temp = internal global [15 x i8] c"{ HEADER_BYTES\00"
@.str = [6 x i8] c" 0\00"
define void @clrhd(i8* %0) {
store i8 125, i8* %0
store i8 10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @clrhd.temp, i64 0, i64 1)
%2 = tail call i32 @puthd(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @clrhd.temp, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void invlpg(void *addr) { asm volatile("invlpg (%0)" ::"r"(addr)); }


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

x86 assembly (clang, -O2):
<invlpg>:
invlpg (%rdi)
ret

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

LLVM IR (-O2):
define void @invlpg(i8* %0) {
tail call void asm sideeffect "invlpg ($0)", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int shmget(int, int, int);
int shm_del() {
  int shmid = shmget(1234, 512, IPC_CREAT | 0600);
  if (shmctl(shmid, IPC_RMID, 0) == -1) {
    printf("delete shm error\n");
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<shm_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
or     $0x180,%edx
mov    $0x4d2,%edi
mov    $0x200,%esi
call   1050 <shmget@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e6d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <shmctl@plt>
cmp    $0xffffffff,%eax
jne    1198 <shm_del+0x58>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shm_del>:
push   %rax
mov    0x2e90(%rip),%rax
mov    $0x180,%edx
or     (%rax),%edx
mov    $0x4d2,%edi
mov    $0x200,%esi
call   1050 <shmget@plt>
mov    0x2e7b(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
xor    %edx,%edx
call   1040 <shmctl@plt>
cmp    $0xffffffff,%eax
je     1179 <shm_del+0x39>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@IPC_RMID = global i32 0
@.str = [18 x i8] c"delete shm error\0A\00"
define i32 @shm_del() {
%1 = alloca i32
%2 = load i32, i32* @IPC_CREAT
%3 = or i32 %2, 384
%4 = call i32 @shmget(i32 1234, i32 512, i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = load i32, i32* @IPC_RMID
%7 = call i32 @shmctl(i32 %5, i32 %6, i32 0)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@IPC_RMID = global i32 0
@str = [17 x i8] c"delete shm error\00"
define i32 @shm_del() {
%1 = load i32, i32* @IPC_CREAT
%2 = or i32 %1, 384
%3 = tail call i32 @shmget(i32 1234, i32 512, i32 %2)
%4 = load i32, i32* @IPC_RMID
%5 = tail call i32 @shmctl(i32 %3, i32 %4, i32 0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Type 'echo $?' and verify that return code is 42.ls\n");
  return 42;
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"Type 'echo $?' and verify that return code is 42.ls\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i32 42
}

LLVM IR (-O2):
@str = [52 x i8] c"Type 'echo $?' and verify that return code is 42.ls\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret i32 42
}
void gtk_combo_box_entry_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_combo_box_entry_new() {
ret void
}
char char3min(char x, char y, char z) {
  char minchar;
  if (x < y) {
    if (x < z) {
      minchar = x;
    } else {
      minchar = z;
    }
  } else {
    if (y < z) {
      minchar = y;
    } else {
      minchar = z;
    }
  }
  return minchar;
}


x86 assembly (clang, -O0):
<char3min>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    114b <char3min+0x4b>
movsbl -0x1(%rbp),%eax
movsbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
jge    1140 <char3min+0x40>
mov    -0x1(%rbp),%al
mov    %al,-0x4(%rbp)
jmp    1146 <char3min+0x46>
mov    -0x3(%rbp),%al
mov    %al,-0x4(%rbp)
jmp    1171 <char3min+0x71>
movsbl -0x2(%rbp),%eax
movsbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
jge    1166 <char3min+0x66>
mov    -0x2(%rbp),%al
mov    %al,-0x4(%rbp)
jmp    116c <char3min+0x6c>
mov    -0x3(%rbp),%al
mov    %al,-0x4(%rbp)
jmp    1171 <char3min+0x71>
movsbl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char3min>:
mov    %edx,%eax
cmp    %al,%dil
cmovl  %edi,%eax
cmp    %sil,%al
cmovge %esi,%eax
ret

LLVM IR (-O0):
define signext i8 @char3min(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = icmp slt i32 %9, %11
br i1 %12, label %13, label %24
13: ; preds = %3
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = load i8, i8* %6
%17 = sext i8 %16 to i32
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = load i8, i8* %4
store i8 %20, i8* %7
br label %23
21: ; preds = %13
%22 = load i8, i8* %6
store i8 %22, i8* %7
br label %23
23: ; preds = %21, %19
br label %35
24: ; preds = %3
%25 = load i8, i8* %5
%26 = sext i8 %25 to i32
%27 = load i8, i8* %6
%28 = sext i8 %27 to i32
%29 = icmp slt i32 %26, %28
br i1 %29, label %30, label %32
30: ; preds = %24
%31 = load i8, i8* %5
store i8 %31, i8* %7
br label %34
32: ; preds = %24
%33 = load i8, i8* %6
store i8 %33, i8* %7
br label %34
34: ; preds = %32, %30
br label %35
35: ; preds = %34, %23
%36 = load i8, i8* %7
ret i8 %36
}

LLVM IR (-O2):
define signext i8 @char3min(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = icmp slt i8 %0, %2
%5 = select i1 %4, i8 %0, i8 %2
%6 = icmp slt i8 %5, %1
%7 = select i1 %6, i8 %5, i8 %1
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ readWriteSector(char *, int, int);
void writeSector(char *toWrite, int sectorNum) {
  readWriteSector(toWrite, sectorNum, 3);
  return;
}


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

x86 assembly (clang, -O2):
<writeSector>:
mov    $0x3,%edx
jmp    1030 <readWriteSector@plt>

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

LLVM IR (-O2):
define void @writeSector(i8* %0, i32 %1) {
%3 = tail call i32 @readWriteSector(i8* %0, i32 %1, i32 3)
ret void
}
/* Variables and functions */
int isVowel(char);
scalar_t__ strlen(char *);
int countVowels(char *STR) {
  if (strlen(STR) == 0)
    return 0;
  return isVowel(STR[0]) + countVowels(STR + 1);
}


x86 assembly (clang, -O0):
<countVowels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    115b <countVowels+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1181 <countVowels+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isVowel@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <countVowels@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countVowels>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1147 <countVowels+0x37>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isVowel@plt>
add    %eax,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <countVowels+0x20>
jmp    1149 <countVowels+0x39>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @countVowels(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i32 @isVowel(i8 signext %5)
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = add nsw i32 %8, %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %14
}
/* Type definitions */
struct em8051 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
int disasm_rr_a(struct em8051 *aCPU, int aPosition, char *aBuffer) {
  sprintf(aBuffer, "RR    A");
  return 1;
}


x86 assembly (clang, -O0):
<disasm_rr_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_rr_a>:
movabs $0x41202020205252,%rax
mov    %rax,(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.em8051 = type { i32 }
@.str = [8 x i8] c"RR A\00"
define i32 @disasm_rr_a(%struct.em8051* %0, i32 %1, i8* %2) {
%4 = alloca %struct.em8051*
%5 = alloca i32
%6 = alloca i8*
store %struct.em8051* %0, %struct.em8051** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.em8051 = type { i32 }
define i32 @disasm_rr_a(%struct.em8051* nocapture readnone %0, i32 %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %2 to i64*
store i64 18331195836224082, i64* %4
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M7_f(char *s) {
  debug("M7_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M7_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M7_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf04(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"M7_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M7_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [45 x i8] c"M7_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M7_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int test_imm_7Cint64_midword_reg(long long val) {
  return ((val >> 16) & (0x7C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Cint64_midword_reg>:
test   $0x7c0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Cint64_midword_reg(i64 %0) {
%2 = and i64 %0, 8126464
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t AONRTCModeCh1Get(void) {
  return ((
      *((volatile unsigned long
             *)(((unsigned long)(0x40092000 + 0x00000014) & 0xF0000000) |
                0x02000000 |
                (((unsigned long)(0x40092000 + 0x00000014) & 0x000FFFFF) << 5) |
                ((9) << 2)))));
}


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

x86 assembly (clang, -O2):
<AONRTCModeCh1Get>:
mov    0x432402a4,%rax
43
ret

LLVM IR (-O0):
define i64 @AONRTCModeCh1Get() {
%1 = load volatile i64, i64* inttoptr (i64 1126433444 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @AONRTCModeCh1Get() {
%1 = load volatile i64, i64* inttoptr (i64 1126433444 to i64*)
ret i64 %1
}
/* Variables and functions */
unsigned long long __blci_u64(unsigned long long);
unsigned long long func_blci64(unsigned long long X) { return __blci_u64(X); }


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

x86 assembly (clang, -O2):
<func_blci64>:
jmp    1030 <__blci_u64@plt>

LLVM IR (-O0):
define i64 @func_blci64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @__blci_u64(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @func_blci64(i64 %0) {
%2 = tail call i64 @__blci_u64(i64 %0)
ret i64 %2
}
/* Variables and functions */
void g_rb_free(void *);
void rb_free(void *obj) { return g_rb_free(obj); }


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

x86 assembly (clang, -O2):
<rb_free>:
jmp    1030 <g_rb_free@plt>

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

LLVM IR (-O2):
define void @rb_free(i8* %0) {
tail call void @g_rb_free(i8* %0)
ret void
}
void gdk_display_set_double_click_time() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_set_double_click_time() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("hciattach - HCI UART driver initialization utility\n");
  printf("Usage:\n");
  printf("\thciattach [-n] [-p] [-b] [-r] [-t timeout] [-s initial_speed] "
         "<tty> <type | id> [speed] [flow|noflow] [bdaddr]\n");
  printf("\thciattach -l\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"hciattach - HCI UART driver initialization utility\0A\00"
@.str.1 = [8 x i8] c"Usage:\0A\00"
@.str.2 = [113 x i8] c"\09hciattach [-n] [-p] [-b] [-r] [-t timeout] [-s initial_speed] <tty> <type | id> [speed] [flow|noflow] [bdaddr]\0A\00"
@.str.3 = [15 x i8] c"\09hciattach -l\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"hciattach - HCI UART driver initialization utility\00"
@str.4 = [7 x i8] c"Usage:\00"
@str.5 = [112 x i8] c"\09hciattach [-n] [-p] [-b] [-r] [-t timeout] [-s initial_speed] <tty> <type | id> [speed] [flow|noflow] [bdaddr]\00"
@str.6 = [14 x i8] c"\09hciattach -l\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([112 x i8], [112 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int mem_peek(int);
int /*<<< orphan*/ mem_poke(int, int);
void vdrive_set_attention() { mem_poke(0xDD00, mem_peek(0xDD00) | 0x08); }


x86 assembly (clang, -O0):
<vdrive_set_attention>:
push   %rbp
mov    %rsp,%rbp
mov    $0xdd00,%edi
call   1030 <mem_peek@plt>
mov    %eax,%esi
or     $0x8,%esi
mov    $0xdd00,%edi
call   1040 <mem_poke@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdrive_set_attention>:
push   %rax
mov    $0xdd00,%edi
call   1030 <mem_peek@plt>
or     $0x8,%eax
mov    $0xdd00,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <mem_poke@plt>

LLVM IR (-O0):
define void @vdrive_set_attention() {
%1 = call i32 @mem_peek(i32 56576)
%2 = or i32 %1, 8
%3 = call i32 @mem_poke(i32 56576, i32 %2)
ret void
}

LLVM IR (-O2):
define void @vdrive_set_attention() {
%1 = tail call i32 @mem_peek(i32 56576)
%2 = or i32 %1, 8
%3 = tail call i32 @mem_poke(i32 56576, i32 %2)
ret void
}
/* Variables and functions */
int ec_wait_resume_status_long(long *, int /*<<< orphan*/);
int ec_resume_status_long(long int *to_c) {
  return ec_wait_resume_status_long(to_c, 0);
}


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

x86 assembly (clang, -O2):
<ec_resume_status_long>:
xor    %esi,%esi
jmp    1030 <ec_wait_resume_status_long@plt>

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

LLVM IR (-O2):
define i32 @ec_resume_status_long(i64* %0) {
%2 = tail call i32 @ec_wait_resume_status_long(i64* %0, i32 0)
ret i32 %2
}
/* Type definitions */
struct sigstack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int sigstack(struct sigstack *ss, struct sigstack *oss) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<sigstack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigstack>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sigstack = type { i32 }
@ENOSYS = global i32 0
define i32 @sigstack(%struct.sigstack* %0, %struct.sigstack* %1) {
%3 = alloca %struct.sigstack*
%4 = alloca %struct.sigstack*
store %struct.sigstack* %0, %struct.sigstack** %3
store %struct.sigstack* %1, %struct.sigstack** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
%struct.sigstack = type { i32 }
@ENOSYS = global i32 0
define i32 @sigstack(%struct.sigstack* nocapture readnone %0, %struct.sigstack* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((unused)) uint32_t lexeme_ring_buffer_mask(uint32_t value) {
  return value & ((4) - 1);
}


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

x86 assembly (clang, -O2):
<lexeme_ring_buffer_mask>:
mov    %edi,%eax
and    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @lexeme_ring_buffer_mask(i32 %0) {
%2 = and i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ handle_args(int, char **);
int /*<<< orphan*/ init_net();
int /*<<< orphan*/ open_chatdat();
int /*<<< orphan*/ print_version();
int /*<<< orphan*/ serve();
int main(int argc, char *argv[]) {
  handle_args(argc, argv);
  print_version();
  open_chatdat();
  init_net();
  serve();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <handle_args@plt>
mov    $0x0,%al
call   1050 <print_version@plt>
mov    $0x0,%al
call   1070 <open_chatdat@plt>
mov    $0x0,%al
call   1040 <init_net@plt>
mov    $0x0,%al
call   1060 <serve@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <handle_args@plt>
xor    %eax,%eax
call   1050 <print_version@plt>
xor    %eax,%eax
call   1070 <open_chatdat@plt>
xor    %eax,%eax
call   1040 <init_net@plt>
xor    %eax,%eax
call   1060 <serve@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @handle_args(i32 %5, i8** %6)
%8 = call i32 (...) @print_version()
%9 = call i32 (...) @open_chatdat()
%10 = call i32 (...) @init_net()
%11 = call i32 (...) @serve()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @handle_args(i32 %0, i8** %1)
%4 = tail call i32 (...) @print_version()
%5 = tail call i32 (...) @open_chatdat()
%6 = tail call i32 (...) @init_net()
%7 = tail call i32 (...) @serve()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  printf("Hello, world!");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1120 <main+0x10>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
void set_XConfigureRequestEvent_type(void *_p, int _v) {
  ((XConfigureRequestEvent *)_p)->type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XConfigureRequestEvent_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XConfigureRequestEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XConfigureRequestEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void achor() {}


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

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

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

LLVM IR (-O2):
define void @achor() {
ret void
}
unsigned char BCD2LowerCh(unsigned char bcd) { return ((bcd & 0x0F) + '0'); }


x86 assembly (clang, -O0):
<BCD2LowerCh>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
add    $0x30,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BCD2LowerCh>:
and    $0xf,%dil
lea    0x30(%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i8 @BCD2LowerCh(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 15
%6 = add nsw i32 %5, 48
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @BCD2LowerCh(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = or i8 %2, 48
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_work() { printf("do work\n"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"do work\0A\00"
define void @do_work() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"do work\00"
define void @do_work() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}