xunge/DecIR huggingface dataset:
/* Variables and functions */
char *get_line_stdio(char *, int *);
int is_line_blank(char *);
char *interactive_text_stdio(char *prompt, char *initval, int *is_blank,
                             int *error) {
  char *line;
  int at_eof;
  *error = 0;
  line = get_line_stdio(prompt, &at_eof);
  *is_blank = line ? is_line_blank(line) : 0;
  return line;
}


x86 assembly (clang, -O0):
<interactive_text_stdio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
call   1030 <get_line_stdio@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     116f <interactive_text_stdio+0x4f>
mov    -0x28(%rbp),%rdi
call   1040 <is_line_blank@plt>
mov    %eax,-0x30(%rbp)
jmp    1179 <interactive_text_stdio+0x59>
xor    %eax,%eax
mov    %eax,-0x30(%rbp)
jmp    1179 <interactive_text_stdio+0x59>
mov    -0x30(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interactive_text_stdio>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
movl   $0x0,(%rcx)
lea    0x4(%rsp),%rsi
call   1030 <get_line_stdio@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <interactive_text_stdio+0x29>
mov    %rbx,%rdi
call   1040 <is_line_blank@plt>
jmp    114b <interactive_text_stdio+0x2b>
xor    %eax,%eax
mov    %eax,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @interactive_text_stdio(i8* %0, i8* %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%11 = load i32*, i32** %8
store i32 0, i32* %11
%12 = load i8*, i8** %5
%13 = call i8* @get_line_stdio(i8* %12, i32* %10)
store i8* %13, i8** %9
%14 = load i8*, i8** %9
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %19
16: ; preds = %4
%17 = load i8*, i8** %9
%18 = call i32 @is_line_blank(i8* %17)
br label %20
19: ; preds = %4
br label %20
20: ; preds = %19, %16
%21 = phi i32 [ %18, %16 ], [ 0, %19 ]
%22 = load i32*, i32** %7
store i32 %21, i32* %22
%23 = load i8*, i8** %9
ret i8* %23
}

LLVM IR (-O2):
define i8* @interactive_text_stdio(i8* %0, i8* nocapture readnone %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
store i32 0, i32* %3
%7 = call i8* @get_line_stdio(i8* %0, i32* %5)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = call i32 @is_line_blank(i8* %7)
br label %11
11: ; preds = %4, %9
%12 = phi i32 [ %10, %9 ], [ 0, %4 ]
store i32 %12, i32* %2
ret i8* %7
}
/* Variables and functions */
size_t get_pd_index(uintptr_t virt_address) {
  return (virt_address >> 21) & 0x1FF;
}


x86 assembly (clang, -O0):
<get_pd_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x15,%rax
and    $0x1ff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pd_index>:
mov    %rdi,%rax
shr    $0x15,%eax
and    $0x1ff,%eax
ret

LLVM IR (-O0):
define i64 @get_pd_index(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 21
%5 = and i64 %4, 511
ret i64 %5
}

LLVM IR (-O2):
define i64 @get_pd_index(i64 %0) {
%2 = lshr i64 %0, 21
%3 = and i64 %2, 511
ret i64 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int new;
};
struct TYPE_4__ {
  TYPE_1__ xcolormap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcolormap_new(void *_p, int _v) {
  ((XEvent *)_p)->xcolormap.new = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xcolormap_new>:
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_XEvent_xcolormap_new>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xcolormap_new(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_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcolormap_new(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_string_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_string(struct Cyc_Lexing_lexbuf *lexbuf) {
  return ({ Cyc_string_rec(lexbuf, 4); });
}


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

x86 assembly (clang, -O2):
<Cyc_string>:
mov    $0x4,%esi
jmp    1030 <Cyc_string_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_string(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_string_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_string(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_string_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 4)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void EPINonBlockingReadStop(uint32_t ui32Base, uint32_t ui32Channel) {
  uint32_t ui32Offset;
  ;
  ;
  ui32Offset = ui32Channel * (0x00000038 - 0x00000028);
  (*((volatile uint32_t *)(ui32Base + 0x00000028 + ui32Offset))) = 0;
}


x86 assembly (clang, -O0):
<EPINonBlockingReadStop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x28,%eax
add    -0xc(%rbp),%eax
cltq
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPINonBlockingReadStop>:
movslq %esi,%rax
shl    $0x4,%rax
movslq %edi,%rcx
movl   $0x0,0x28(%rcx,%rax,1)
ret

LLVM IR (-O0):
define void @EPINonBlockingReadStop(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 = mul nsw i32 %6, 16
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 40
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 0, i32* %13
ret void
}

LLVM IR (-O2):
define void @EPINonBlockingReadStop(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 4
%4 = add nsw i32 %0, 40
%5 = add nsw i32 %4, %3
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store volatile i32 0, i32* %7
ret void
}
int Ack(int m, int n) {
  if (m == 0)
    return n + 1;
  else if (n == 0)
    return Ack(m - 1, 1);
  else
    return Ack(m - 1, Ack(m, n - 1));
}


x86 assembly (clang, -O0):
<Ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <Ack+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <Ack+0x6c>
cmpl   $0x0,-0xc(%rbp)
jne    1158 <Ack+0x48>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <Ack@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <Ack+0x6c>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <Ack@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <Ack@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ack>:
push   %rbx
mov    %esi,%eax
test   %edi,%edi
je     113f <Ack+0x2f>
mov    %edi,%ebx
jmp    112a <Ack+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
add    $0xffffffff,%ebx
je     113f <Ack+0x2f>
test   %eax,%eax
je     1120 <Ack+0x10>
add    $0xffffffff,%eax
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <Ack@plt>
add    $0xffffffff,%ebx
jne    112a <Ack+0x1a>
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Ack(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %26
11: ; preds = %2
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = call i32 @Ack(i32 %16, i32 1)
store i32 %17, i32* %3
br label %26
18: ; preds = %11
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = sub nsw i32 %22, 1
%24 = call i32 @Ack(i32 %21, i32 %23)
%25 = call i32 @Ack(i32 %20, i32 %24)
store i32 %25, i32* %3
br label %26
26: ; preds = %18, %14, %8
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @Ack(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = add nsw i32 %5, 1
ret i32 %6
7: ; preds = %2, %11
%8 = phi i32 [ %12, %11 ], [ %1, %2 ]
%9 = phi i32 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i32 [ %17, %15 ], [ 1, %7 ]
%13 = add nsw i32 %9, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add nsw i32 %8, -1
%17 = tail call i32 @Ack(i32 %9, i32 %16)
br label %11
}
double mjd2epj(dj)
double dj;
{ return (2000.0 + (dj - 51544.5) / 365.25); }


x86 assembly (clang, -O0):
<mjd2epj>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xefa(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mjd2epj>:
addsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @mjd2epj(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 5.154450e+04
%5 = fdiv double %4, 3.652500e+02
%6 = fadd double 2.000000e+03, %5
ret double %6
}

LLVM IR (-O2):
define double @mjd2epj(double %0) {
%2 = fadd double %0, -5.154450e+04
%3 = fdiv double %2, 3.652500e+02
%4 = fadd double %3, 2.000000e+03
ret double %4
}
/* Variables and functions */
int wycc_type_flags(int);
int wycc_type_is_recurs(int id) {
  int flgs = wycc_type_flags(id);
  if (flgs & 16384) {
    return 1;
  };
  return 0;
}


x86 assembly (clang, -O0):
<wycc_type_is_recurs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <wycc_type_flags@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x4000,%eax
cmp    $0x0,%eax
je     1143 <wycc_type_is_recurs+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <wycc_type_is_recurs+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wycc_type_is_recurs>:
push   %rax
call   1030 <wycc_type_flags@plt>
shr    $0xe,%eax
and    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @wycc_type_is_recurs(i32 %0) {
%2 = tail call i32 @wycc_type_flags(i32 %0)
%3 = lshr i32 %2, 14
%4 = and i32 %3, 1
ret i32 %4
}
char *xrealloc(p, n)
char *p;
unsigned n;
{
  p = realloc(p, n);
  if (p == 0) {
    error(0, 0, "virtual memory exhausted");
    cleanup();
  }
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1175 <xrealloc+0x45>
xor    %esi,%esi
lea    0xe9b(%rip),%rdx
mov    %esi,%edi
mov    $0x0,%al
call   1040 <error@plt>
mov    $0x0,%al
call   1050 <cleanup@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
mov    %esi,%esi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1159 <xrealloc+0x29>
lea    0xeb9(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <error@plt>
xor    %eax,%eax
call   1050 <cleanup@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xrealloc(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 = zext i32 %6 to i64
%8 = call i8* @realloc(i8* %5, i64 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i32, i32, i8*, ...)*)(i32 0, i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @cleanup()
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xrealloc(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = tail call i8* @realloc(i8* %0, i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i32, i32, i8*, ...)*)(i32 0, i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (...) @cleanup()
br label %9
9: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
int main(int argc, char **argv) {
  char ch;
  while ((ch = getchar()) != EOF) {
    putchar(ch);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
mov    0x2e9e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1163 <main+0x43>
movsbl -0x11(%rbp),%edi
call   1030 <putchar@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%al
je     1153 <main+0x33>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %13, %2
%8 = call signext i8 (...) @getchar()
store i8 %8, i8* %6
%9 = sext i8 %8 to i32
%10 = load i8, i8* @EOF
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %9, %11
br i1 %12, label %13, label %16
13: ; preds = %7
%14 = load i8, i8* %6
%15 = call i32 @putchar(i8 signext %14)
br label %7
16: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call signext i8 (...) @getchar()
%4 = load i8, i8* @EOF
%5 = icmp eq i8 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @putchar(i8 signext %7)
%9 = tail call signext i8 (...) @getchar()
%10 = load i8, i8* @EOF
%11 = icmp eq i8 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ vfork();
int main() {
  int i;
  for (i = 0; i < 2; ++i) {
    vfork();
    printf("-");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115f <main+0x3f>
call   1040 <vfork@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1040 <vfork@plt>
mov    $0x2d,%ebx
mov    %ebx,%edi
call   1030 <putchar@plt>
call   1040 <vfork@plt>
mov    %ebx,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = call i32 @vfork()
%2 = call i32 @putchar(i32 45)
%3 = call i32 @vfork()
%4 = call i32 @putchar(i32 45)
ret i32 0
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = (input[0UL] + 914778474UL) * (unsigned char)22;
    local1 = 0UL;
    while (local1 < (unsigned char)0) {
      state[local1] = state[0UL] + state[0UL];
      local1++;
    }
    output[0UL] = state[0UL] + (unsigned char)231;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x3686696a,%rax
imul   $0x16,%rax,%rax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x0,%eax
jge    1152 <RandomFunc+0x52>
movzbl -0x11(%rbp),%eax
movzbl -0x11(%rbp),%ecx
add    %ecx,%eax
mov    %al,%cl
movzbl -0x12(%rbp),%eax
mov    %cl,-0x11(%rbp,%rax,1)
mov    -0x12(%rbp),%al
add    $0x1,%al
mov    %al,-0x12(%rbp)
jmp    1124 <RandomFunc+0x24>
movzbl -0x11(%rbp),%eax
add    $0xe7,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzbl (%rdi),%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,4),%ecx
add    %eax,%ecx
add    $0x3,%cl
mov    %cl,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = add i64 %10, 914778474
%12 = mul i64 %11, 22
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %13, i8* %14
store i8 0, i8* %6
br label %15
15: ; preds = %19, %2
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %33
19: ; preds = %15
%20 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = add nsw i32 %22, %25
%27 = trunc i32 %26 to i8
%28 = load i8, i8* %6
%29 = zext i8 %28 to i64
%30 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %29
store i8 %27, i8* %30
%31 = load i8, i8* %6
%32 = add i8 %31, 1
store i8 %32, i8* %6
br label %15
33: ; preds = %15
%34 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = add nsw i32 %36, 231
%38 = trunc i32 %37 to i8
%39 = load i8*, i8** %4
%40 = getelementptr inbounds i8, i8* %39, i64 0
store i8 %38, i8* %40
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = mul i8 %3, 22
%5 = add i8 %4, 3
store i8 %5, i8* %1
ret void
}
int roadmap_nmea_pgrmz(int argc, char *argv[]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @roadmap_nmea_pgrmz(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int test4(void) {
  int i, sum = 0;
  int *tab4;
  tab4 = malloc(20 * sizeof(int));
  for (i = 0; i < 20; i++) {
    sum += tab4[i];
  }
  free(tab4);
  return sum;
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0x50,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    116d <test4+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <test4+0x24>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %rbx
mov    $0x50,%edi
call   1040 <malloc@plt>
movdqu 0x40(%rax),%xmm0
movdqu (%rax),%xmm1
movdqu 0x10(%rax),%xmm2
movdqu 0x20(%rax),%xmm3
paddd  %xmm0,%xmm3
movdqu 0x30(%rax),%xmm0
paddd  %xmm2,%xmm0
paddd  %xmm3,%xmm0
pshufd $0xee,%xmm0,%xmm2
paddd  %xmm0,%xmm2
pshufd $0x55,%xmm2,%xmm0
paddd  %xmm2,%xmm0
movd   %xmm0,%ecx
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%ebx
add    %ecx,%ebx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @test4() {
%1 = tail call i32* @malloc(i32 80)
%2 = bitcast i32* %1 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = getelementptr inbounds i32, i32* %1, i64 4
%5 = bitcast i32* %4 to <16 x i32>*
%6 = load <16 x i32>, <16 x i32>* %5
%7 = call i32 @llvm.vector.reduce.add.v16i32(<16 x i32> %6)
%8 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %3)
%9 = add nsw i32 %7, %8
%10 = tail call i32 @free(i32* %1)
ret i32 %9
}
/* Variables and functions */
int getPartitionIndex(int *, int, int);
void Qsort(int *arr, int start, int end) {
  int pIndex = 0;
  if (start < end) {
    pIndex = getPartitionIndex(arr, start, end);
    Qsort(arr, start, pIndex - 1);
    Qsort(arr, pIndex + 1, end);
  }
}


x86 assembly (clang, -O0):
<Qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117b <Qsort+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <getPartitionIndex@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <Qsort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <Qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Qsort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <Qsort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <getPartitionIndex@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <Qsort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <Qsort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Qsort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @getPartitionIndex(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @Qsort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void io_wait() {
  asm volatile("jmp 1f\n\t"
               "1:jmp 2f\n\t"
               "2:");
}


x86 assembly (clang, -O0):
<io_wait>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <io_wait+0x9>
jmp    110e <io_wait+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_wait>:
jmp    1102 <io_wait+0x2>
jmp    1104 <io_wait+0x4>
ret

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

LLVM IR (-O2):
define void @io_wait() {
tail call void asm sideeffect "jmp 1f\0A\091:jmp 2f\0A\092:", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get_unaligned_be32(const uint8_t *buf) {
  return (uint32_t)(buf[0] << 24) | ((uint32_t)buf[1] << 16) |
         ((uint32_t)buf[2] << 8) | (uint32_t)buf[3];
}


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

x86 assembly (clang, -O2):
<get_unaligned_be32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_unaligned_be32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @get_unaligned_be32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ __iar_program_start();
void __main(void) { __iar_program_start(); }


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

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

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

LLVM IR (-O2):
define void @__main() {
%1 = tail call i32 (...) @__iar_program_start()
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
void weak_update_malloc_Good_FP() {
  int a[10];
  int *x = (int *)malloc(sizeof(int) * 2);
  x[0] = 0;
  x[1] = 10;
  a[x[0]] = 0;
}


x86 assembly (clang, -O0):
<weak_update_malloc_Good_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x38(%rbp),%rax
movl   $0xa,0x4(%rax)
mov    -0x38(%rbp),%rax
movslq (%rax),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<weak_update_malloc_Good_FP>:
push   %rax
mov    $0x8,%edi
call   1030 <malloc@plt>
movabs $0xa00000000,%rcx
mov    %rcx,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @weak_update_malloc_Good_FP() {
%1 = alloca [10 x i32]
%2 = alloca i32*
%3 = call i64 @malloc(i32 8)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 0, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 10, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %12
store i32 0, i32* %13
ret void
}

LLVM IR (-O2):
define void @weak_update_malloc_Good_FP() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to i32*
store i32 0, i32* %2
%3 = getelementptr inbounds i32, i32* %2, i64 1
store i32 10, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void you_hacked_me() { fprintf(stdout, "You hacked me!\n"); }


x86 assembly (clang, -O0):
<you_hacked_me>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<you_hacked_me>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [16 x i8] c"You hacked me!\0A\00"
define void @you_hacked_me() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [16 x i8] c"You hacked me!\0A\00"
define void @you_hacked_me() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sdeco_get();
int sdeco_get_int16(void) {
  int h, val;
  h = sdeco_get();
  if (h < 0)
    return 0;
  val = (h << 8);
  h = sdeco_get();
  if (h < 0)
    return 0;
  return val + h;
}


x86 assembly (clang, -O0):
<sdeco_get_int16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <sdeco_get@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1138 <sdeco_get_int16+0x28>
movl   $0x0,-0x4(%rbp)
jmp    116a <sdeco_get_int16+0x5a>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <sdeco_get@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1161 <sdeco_get_int16+0x51>
movl   $0x0,-0x4(%rbp)
jmp    116a <sdeco_get_int16+0x5a>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdeco_get_int16>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <sdeco_get@plt>
test   %eax,%eax
js     1136 <sdeco_get_int16+0x26>
mov    %eax,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <sdeco_get@plt>
test   %eax,%eax
js     1136 <sdeco_get_int16+0x26>
shl    $0x8,%ebp
add    %ebp,%eax
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @sdeco_get_int16() {
%1 = tail call i32 (...) @sdeco_get()
%2 = icmp slt i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i32 (...) @sdeco_get()
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = shl i32 %1, 8
%8 = add nsw i32 %4, %7
br label %9
9: ; preds = %3, %0, %6
%10 = phi i32 [ %8, %6 ], [ 0, %0 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
void strcat(char *s1, char *s2) {
  while (*s1++)
    ;
  s1--;
  while (*s1++ = *s2++)
    ;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1129 <strcat+0x29>
jmp    110c <strcat+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1164 <strcat+0x64>
jmp    1135 <strcat+0x35>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcat>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcat+0x10>
ret

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

LLVM IR (-O2):
define void @strcat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
int HelpItem161(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem161() {
ret i32 0
}
int main() {
  struct S2 {
    char a;
    int b;
  };
  static struct S2 s2 = {'a', 2};
}


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

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

LLVM IR (-O0):
%struct.S2 = type { i8, i32 }
@main.s2 = internal global %struct.S2 { i8 97, i32 2 }
define i32 @main() {
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_E6int8_reg(signed char val) {
  return ((val) & (0xE6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E6int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xe6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_E6int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 230
%6 = icmp ne i32 %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_E6int8_reg(i8 signext %0) {
%2 = and i8 %0, -26
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ print_array(int *, int, int);
int /*<<< orphan*/ zsort(int *, int);
int main(void) {
  int array[] = {3, 16, 15, 11, 14, 0, 6, 7, 9, 12, 10, 5, 13, 4, 1, 2};
  int len = sizeof(array) / sizeof(int);
  zsort(array, len);
  print_array(array, len, -2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
movl   $0x10,-0x54(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
call   1040 <zsort@plt>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    $0xfffffffe,%edx
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movaps 0xf04(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <zsort@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
mov    $0xfffffffe,%edx
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [16 x i32] [i32 3, i32 16, i32 15, i32 11, i32 14, i32 0, i32 6, i32 7, i32 9, i32 12, i32 10, i32 5, i32 13, i32 4, i32 1, i32 2]
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [16 x i32]* %2 to i8*
store i32 16, i32* %3
%5 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @zsort(i32* %5, i32 %6)
%8 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @print_array(i32* %8, i32 %9, i32 -2)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [16 x i32] [i32 3, i32 16, i32 15, i32 11, i32 14, i32 0, i32 6, i32 7, i32 9, i32 12, i32 10, i32 5, i32 13, i32 4, i32 1, i32 2]
define i32 @main() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%4 = call i32 @zsort(i32* %3, i32 16)
%5 = call i32 @print_array(i32* %3, i32 16, i32 -2)
ret i32 0
}
float rndreal(lo, hi)
float lo, hi;
{ return ((randomperc() * (hi - lo)) + lo); }


x86 assembly (clang, -O0):
<rndreal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm1,-0x10(%rbp)
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <randomperc@plt>
cvtsi2ss %eax,%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rndreal>:
push   %rax
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <randomperc@plt>
cvtsi2ss %eax,%xmm2
movss  0x4(%rsp),%xmm1
movss  (%rsp),%xmm0
subss  %xmm1,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rndreal(double %0, double %1) {
%3 = alloca float
%4 = alloca float
%5 = fptrunc double %0 to float
%6 = fptrunc double %1 to float
store float %5, float* %3
store float %6, float* %4
%7 = call i32 (...) @randomperc()
%8 = sitofp i32 %7 to float
%9 = load float, float* %4
%10 = load float, float* %3
%11 = fsub float %9, %10
%12 = load float, float* %3
%13 = call float @llvm.fmuladd.f32(float %8, float %11, float %12)
ret float %13
}

LLVM IR (-O2):
define float @rndreal(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fptrunc double %1 to float
%5 = tail call i32 (...) @randomperc()
%6 = sitofp i32 %5 to float
%7 = fsub float %4, %3
%8 = tail call float @llvm.fmuladd.f32(float %6, float %7, float %3)
ret float %8
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int ssize_t;

/* Variables and functions */
long ntohl(long);
int recv(int, long *, int, int /*<<< orphan*/);
int rxsize(int sock, size_t *sz) {
  long val;
  ssize_t ret;
  ret = recv(sock, &val, sizeof(val), 0);
  if (ret == sizeof(val)) {
    val = ntohl(val);
    *sz = val;
    return 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<rxsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x8,%rax
jne    1177 <rxsize+0x57>
mov    -0x18(%rbp),%rdi
call   1040 <ntohl@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    117d <rxsize+0x5d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rxsize>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0x8,%eax
jne    114d <rxsize+0x2d>
mov    0x8(%rsp),%rdi
call   1040 <ntohl@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @rxsize(i32 %0, i64* nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @recv(i32 %0, i64* %3, i32 8, i32 0)
%6 = icmp eq i32 %5, 8
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %3
%9 = call i64 @ntohl(i64 %8)
store i64 %9, i64* %1
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ %5, %2 ]
ret i32 %11
}
int es_par(int n) { return n % 2 == 0; }


x86 assembly (clang, -O0):
<es_par>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_par>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @es_par(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @es_par(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void min_caml_print_float(void *fv, double f) { printf("%lf", f); }


x86 assembly (clang, -O0):
<min_caml_print_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define void @min_caml_print_float(i8* nocapture readnone %0, double %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
ret void
}