xunge/DecIR huggingface dataset:
int nan_eq_assign(double x) {
  volatile double y = x;
  volatile double z = y;
  int rc;
  rc = (y == z);
  return rc;
}


x86 assembly (clang, -O0):
<nan_eq_assign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nan_eq_assign>:
movsd  %xmm0,-0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
movsd  %xmm0,-0x8(%rsp)
movsd  -0x10(%rsp),%xmm0
cmpeqsd -0x8(%rsp),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @nan_eq_assign(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %2
%6 = load double, double* %2
store volatile double %6, double* %3
%7 = load volatile double, double* %3
store volatile double %7, double* %4
%8 = load volatile double, double* %3
%9 = load volatile double, double* %4
%10 = fcmp oeq double %8, %9
%11 = zext i1 %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @nan_eq_assign(double %0) {
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %2 to i8*
store volatile double %0, double* %2
%5 = bitcast double* %3 to i8*
%6 = load volatile double, double* %2
store volatile double %6, double* %3
%7 = load volatile double, double* %2
%8 = load volatile double, double* %3
%9 = fcmp oeq double %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
int PLY_which_endian(void) {
  union {
    unsigned short int s;
    char c[2];
  } un;
  un.s = 0x0102;
  if ((un.c[0] == 1) && (un.c[1] == 2))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<PLY_which_endian>:
push   %rbp
mov    %rsp,%rbp
movw   $0x102,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
jne    1130 <PLY_which_endian+0x30>
movsbl -0x7(%rbp),%eax
cmp    $0x2,%eax
jne    1130 <PLY_which_endian+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1137 <PLY_which_endian+0x37>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i16 }
define i32 @PLY_which_endian() {
%1 = alloca i32
%2 = alloca %union.anon
%3 = bitcast %union.anon* %2 to i16*
store i16 258, i16* %3
%4 = bitcast %union.anon* %2 to [2 x i8]*
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %16
9: ; preds = %0
%10 = bitcast %union.anon* %2 to [2 x i8]*
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %10, i64 0, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %16
15: ; preds = %9
store i32 0, i32* %1
br label %17
16: ; preds = %9, %0
store i32 1, i32* %1
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %1
ret i32 %18
}

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

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ errno;
int /*<<< orphan*/ perror(char *);
int getcontext(ucontext_t *ucp) {
  errno = ENOSYS;
  perror("getcontext");
  abort();
}


x86 assembly (clang, -O0):
<getcontext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9c(%rip),%rax
mov    %ecx,(%rax)
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<getcontext>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    0x2ea7(%rip),%rcx
mov    %eax,(%rcx)
lea    0xec6(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
@.str = [11 x i8] c"getcontext\00"
define i32 @getcontext(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
%4 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
@.str = [11 x i8] c"getcontext\00"
define i32 @getcontext(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
%3 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @abort()
unreachable
}
void val_delete_dur_stats(void *v) { (void)v; }


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

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

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

LLVM IR (-O2):
define void @val_delete_dur_stats(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close_s(int);
void closeArduino(int *arduino, int nb) {
  int i;
  for (i = 0; i < nb; i++) {
    close_s(arduino[i]);
  }
}


x86 assembly (clang, -O0):
<closeArduino>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <closeArduino+0x40>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <close_s@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <closeArduino+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeArduino>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <closeArduino+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <close_s@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <closeArduino+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @closeArduino(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @close_s(i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
double cephes_tandg(x)
double x;
{ return (tancot(x, 0)); }


x86 assembly (clang, -O0):
<cephes_tandg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
mov    $0x1,%al
call   1030 <tancot@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cephes_tandg>:
push   %rax
xor    %edi,%edi
mov    $0x1,%al
call   1030 <tancot@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cephes_tandg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 (double, i32, ...) bitcast (i32 (...)* @tancot to i32 (double, i32, ...)*)(double %3, i32 0)
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @cephes_tandg(double %0) {
%2 = tail call i32 (double, i32, ...) bitcast (i32 (...)* @tancot to i32 (double, i32, ...)*)(double %0, i32 0)
%3 = sitofp i32 %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_conditions() {
  puts("For redistribution conditions:");
  puts("Read at least sections 2-6 in the LICENSE or");
  puts("download the GPL v3.0 license from:");
  puts("http://www.gnu.org/licenses/gpl-3.0.txt");
}


x86 assembly (clang, -O0):
<print_conditions>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xf31(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_conditions>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf34(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"For redistribution conditions:\00"
@.str.1 = [45 x i8] c"Read at least sections 2-6 in the LICENSE or\00"
@.str.2 = [36 x i8] c"download the GPL v3.0 license from:\00"
@.str.3 = [40 x i8] c"http://www.gnu.org/licenses/gpl-3.0.txt\00"
define void @print_conditions() {
%1 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"For redistribution conditions:\00"
@.str.1 = [45 x i8] c"Read at least sections 2-6 in the LICENSE or\00"
@.str.2 = [36 x i8] c"download the GPL v3.0 license from:\00"
@.str.3 = [40 x i8] c"http://www.gnu.org/licenses/gpl-3.0.txt\00"
define void @print_conditions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_arbre();
int main(int argc, char *argv[]) {
  test_arbre();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_arbre@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_arbre@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 = call i32 (...) @test_arbre()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_arbre()
ret i32 0
}
unsigned char sdtools_dec2bcd(unsigned char num) {
  if (num > 99)
    num = 99;
  return ((num / 10) << 4) | (num % 10);
}


x86 assembly (clang, -O0):
<sdtools_dec2bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x63,%eax
jle    111b <sdtools_dec2bcd+0x1b>
movb   $0x63,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
or     %edx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdtools_dec2bcd>:
cmp    $0x63,%dil
mov    $0x63,%eax
cmovb  %edi,%eax
imul   $0xcd,%eax,%ecx
shr    $0xb,%ecx
mov    %ecx,%edx
shl    $0x4,%dl
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %cl,%al
or     %dl,%al
ret

LLVM IR (-O0):
define zeroext i8 @sdtools_dec2bcd(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sgt i32 %4, 99
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 99, i8* %2
br label %7
7: ; preds = %6, %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = sdiv i32 %9, 10
%11 = shl i32 %10, 4
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = srem i32 %13, 10
%15 = or i32 %11, %14
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @sdtools_dec2bcd(i8 zeroext %0) {
%2 = icmp ult i8 %0, 99
%3 = select i1 %2, i8 %0, i8 99
%4 = udiv i8 %3, 10
%5 = shl nuw i8 %4, 4
%6 = urem i8 %3, 10
%7 = or i8 %5, %6
ret i8 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ XErrorEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int True;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int _XlibErrorHandler(Display *display, XErrorEvent *event) {
  fprintf(stderr, "An error occured detecting the mouse position\n");
  return True;
}


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

x86 assembly (clang, -O2):
<_XlibErrorHandler>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"An error occured detecting the mouse position\0A\00"
@True = global i32 0
define i32 @_XlibErrorHandler(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @True
ret i32 %7
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"An error occured detecting the mouse position\0A\00"
@True = global i32 0
define i32 @_XlibErrorHandler(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @True
ret i32 %5
}
void handle_42(sig) int sig;
{}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_and_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_andnot_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cmpgt_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_or_si128(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) __m128i mm_max_epi32(__m128i xmm0, __m128i xmm1) {
  __m128i mask = _mm_cmpgt_epi32(xmm0, xmm1);
  return _mm_or_si128(_mm_and_si128(mask, xmm0), _mm_andnot_si128(mask, xmm1));
}


x86 assembly (clang, -O0):
<mm_max_epi32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_cmpgt_epi32@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1060 <_mm_and_si128@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <_mm_andnot_si128@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <_mm_or_si128@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_max_epi32>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1030 <_mm_cmpgt_epi32@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    %ebp,%esi
call   1060 <_mm_and_si128@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %r14d,%esi
call   1050 <_mm_andnot_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <_mm_or_si128@plt>

LLVM IR (-O0):
define i32 @mm_max_epi32(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* %3
%7 = load i32, i32* %4
%8 = call i32 @_mm_cmpgt_epi32(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = call i32 @_mm_and_si128(i32 %9, i32 %10)
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = call i32 @_mm_andnot_si128(i32 %12, i32 %13)
%15 = call i32 @_mm_or_si128(i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @mm_max_epi32(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpgt_epi32(i32 %0, i32 %1)
%4 = tail call i32 @_mm_and_si128(i32 %3, i32 %0)
%5 = tail call i32 @_mm_andnot_si128(i32 %3, i32 %1)
%6 = tail call i32 @_mm_or_si128(i32 %4, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_livecode_empty_comments() {
  test_parser_verify_parse(test_parser_sourcefile("livecode", " --\n"),
                           "livecode", "", "--\n", 0);
}


x86 assembly (clang, -O0):
<test_livecode_empty_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec6(%rip),%rdx
lea    0xebc(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_livecode_empty_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xecf(%rip),%rdx
lea    0xec5(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"livecode\00"
@.str.1 = [5 x i8] c" --\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"--\0A\00"
define void @test_livecode_empty_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"livecode\00"
@.str.1 = [5 x i8] c" --\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"--\0A\00"
define void @test_livecode_empty_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int napatech_cmd(void *opt, char *cmd) {
  printf("/opt/napatech3/bin/ntpl -e '%s'\n", cmd);
  return (0);
}


x86 assembly (clang, -O0):
<napatech_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<napatech_cmd>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"/opt/napatech3/bin/ntpl -e '%s'\0A\00"
define i32 @napatech_cmd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"/opt/napatech3/bin/ntpl -e '%s'\0A\00"
define i32 @napatech_cmd(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int main() {
  print("Hello dynamic lib");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Hello dynamic lib\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Hello dynamic lib\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Exit(int /*<<< orphan*/);
int /*<<< orphan*/ Log(char *);
int isatty(int fd) {
  Log("'"
      "isatty"
      "' is not implemented");
  Exit(0);
  ;
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xece(%rip),%rdi
call   1040 <Log@plt>
xor    %edi,%edi
call   1030 <Exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Log@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <Exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"'isatty' is not implemented\00"
define i32 @isatty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @Log(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @Exit(i32 0)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [28 x i8] c"'isatty' is not implemented\00"
define i32 @isatty(i32 %0) {
%2 = tail call i32 @Log(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @Exit(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, short);
int /*<<< orphan*/ stdout;
void cutils_cout_short_print(short number) { fprintf(stdout, "%hd\n", number); }


x86 assembly (clang, -O0):
<cutils_cout_short_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
movswl -0x2(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cout_short_print>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"%hd\0A\00"
define void @cutils_cout_short_print(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i32, i32* @stdout
%4 = load i16, i16* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i16 signext %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"%hd\0A\00"
define void @cutils_cout_short_print(i16 signext %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i16 signext %0)
ret void
}
void drive_set_head(int head) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ print_error(char const *, char const *);
FILE *fopen_verbose(const char *name, const char *tag) {
  FILE *f = fopen(name, "r");
  if (!f) {
    print_error(name, tag);
  }
  return f;
}


x86 assembly (clang, -O0):
<fopen_verbose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115c <fopen_verbose+0x3c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <print_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen_verbose>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xece(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <fopen_verbose+0x2a>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <print_error@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32* @fopen_verbose(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @print_error(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %2
%15 = load i32*, i32** %5
ret i32* %15
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i32* @fopen_verbose(i8* %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @print_error(i8* %0, i8* %1)
br label %7
7: ; preds = %5, %2
ret i32* %3
}
int session_info_get_fd(struct session_info *si) { return -1; }


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

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

LLVM IR (-O0):
%struct.session_info = type opaque
define i32 @session_info_get_fd(%struct.session_info* %0) {
%2 = alloca %struct.session_info*
store %struct.session_info* %0, %struct.session_info** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.session_info = type opaque
define i32 @session_info_get_fd(%struct.session_info* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *strdup(char *);
char *merged_subtitle(char *begin_date, char *end_date) {
  char sub_title[128];
  sprintf(sub_title, "Merged from %s to %s", begin_date, end_date);
  return strdup(sub_title);
}


x86 assembly (clang, -O0):
<merged_subtitle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb7(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merged_subtitle>:
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Merged from %s to %s\00"
define i8* @merged_subtitle(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%11 = call i8* @strdup(i8* %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [21 x i8] c"Merged from %s to %s\00"
define noalias i8* @merged_subtitle(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i8* @strdup(i8* %4)
ret i8* %6
}
int main() {
  int a[12];
  int t1;
  int t2;
  t1 = t2;
  t2 = a[t1];
  a[t2] = t1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x44(%rbp)
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%ecx
movslq -0x48(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct ss7 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mtp3_noalarm(struct ss7 *, int);
void ss7_link_noalarm(struct ss7 *ss7, int fd) { mtp3_noalarm(ss7, fd); }


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

x86 assembly (clang, -O2):
<ss7_link_noalarm>:
jmp    1030 <mtp3_noalarm@plt>

LLVM IR (-O0):
%struct.ss7 = type { i32 }
define void @ss7_link_noalarm(%struct.ss7* %0, i32 %1) {
%3 = alloca %struct.ss7*
%4 = alloca i32
store %struct.ss7* %0, %struct.ss7** %3
store i32 %1, i32* %4
%5 = load %struct.ss7*, %struct.ss7** %3
%6 = load i32, i32* %4
%7 = call i32 @mtp3_noalarm(%struct.ss7* %5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.ss7 = type { i32 }
define void @ss7_link_noalarm(%struct.ss7* %0, i32 %1) {
%3 = tail call i32 @mtp3_noalarm(%struct.ss7* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int print_usage(FILE *output, int retval) {
  fprintf(output, "usage: pm-reset-swap <device node>\n");
  return retval;
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rcx
lea    0xee3(%rip),%rdi
mov    $0x23,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"usage: pm-reset-swap <device node>\0A\00"
define i32 @print_usage(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
@.str = [36 x i8] c"usage: pm-reset-swap <device node>\0A\00"
define i32 @print_usage(i32* nocapture %0, i32 returned %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 35, i64 1, i32* %0)
ret i32 %1
}
void *ts_realloc(void *mem, int old_size, int new_size) {
  char *new_mem;
  new_mem = malloc(new_size);
  ts_memcpy(mem, new_mem, old_size);
  free(mem);
  return (new_mem);
}


x86 assembly (clang, -O0):
<ts_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movslq -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1040 <ts_memcpy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_realloc>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
movslq %edx,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <ts_memcpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @ts_realloc(i8* %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @ts_memcpy to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %5, i32 %1)
tail call void @free(i8* %0)
ret i8* %5
}
void byte_to_hex(const char byte, char *out) {
  int i = 0U;
  static const char binHex[] = "0123456789ABCDEF";
  out[2 * i] = binHex[(byte >> 4) & 0x0F];
  out[2 * i + 1] = binHex[byte & 0x0F];
}


x86 assembly (clang, -O0):
<byte_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xed7(%rip),%rax
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xeb3(%rip),%rax
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_to_hex>:
movzbl %dil,%eax
shr    $0x4,%rax
lea    0xef1(%rip),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,(%rsi)
and    $0xf,%edi
mov    (%rdi,%rcx,1),%al
mov    %al,0x1(%rsi)
ret

LLVM IR (-O0):
@byte_to_hex.binHex = internal constant [17 x i8] c"0123456789ABCDEF\00"
define void @byte_to_hex(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
store i8 %0, i8* %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = ashr i32 %7, 4
%9 = and i32 %8, 15
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [17 x i8], [17 x i8]* @byte_to_hex.binHex, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = mul nsw i32 2, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 %12, i8* %17
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = and i32 %19, 15
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [17 x i8], [17 x i8]* @byte_to_hex.binHex, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = load i8*, i8** %4
%25 = load i32, i32* %5
%26 = mul nsw i32 2, %25
%27 = add nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %24, i64 %28
store i8 %23, i8* %29
ret void
}

LLVM IR (-O2):
@byte_to_hex.binHex = internal unnamed_addr constant [17 x i8] c"0123456789ABCDEF\00"
define void @byte_to_hex(i8 signext %0, i8* nocapture writeonly %1) {
%3 = zext i8 %0 to i32
%4 = lshr i32 %3, 4
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [17 x i8], [17 x i8]* @byte_to_hex.binHex, i64 0, i64 %5
%7 = load i8, i8* %6
store i8 %7, i8* %1
%8 = and i32 %3, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @byte_to_hex.binHex, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_close(int /*<<< orphan*/);
void PIC18F46J50_stop(void) {
  serial_close(0);
  ;
}


x86 assembly (clang, -O0):
<PIC18F46J50_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <serial_close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC18F46J50_stop>:
xor    %edi,%edi
jmp    1030 <serial_close@plt>

LLVM IR (-O0):
define void @PIC18F46J50_stop() {
%1 = call i32 @serial_close(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC18F46J50_stop() {
%1 = tail call i32 @serial_close(i32 0)
ret void
}
int abs(int a) { return (a < 0 ? -a : a); }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  DIR *dir;
  dir = opendir("./");
  if (dir == NULL) {
    puts("error");
    return 1;
  }
  puts("success");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1162 <main+0x42>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1175 <main+0x55>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <opendir@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
lea    0xec7(%rip),%rax
lea    0xec6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"./\00"
@.str.1 = [6 x i8] c"error\00"
@.str.2 = [8 x i8] c"success\00"
define i32 @main() {
%1 = tail call i32* @opendir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = zext i1 %2 to i32
%5 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 %4
}
/* Variables and functions */
int sdeco_d_get_int32();
unsigned int sdeco_d_get_uint32(void) {
  int ir32;
  ir32 = sdeco_d_get_int32();
  return (unsigned int)ir32;
}


x86 assembly (clang, -O0):
<sdeco_d_get_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <sdeco_d_get_int32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sdeco_d_get_uint32() {
%1 = alloca i32
%2 = call i32 (...) @sdeco_d_get_int32()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @sdeco_d_get_uint32() {
%1 = tail call i32 (...) @sdeco_d_get_int32()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ hash(int);
void test() {
  int c0, c1;
  int i, j;
  for (c0 = 0; c0 <= 9; c0++) {
    {
      hash(1);
      hash(c0);
      hash(1);
    };
    {
      hash(3);
      hash(c0);
      hash(1);
    };
    {
      hash(2);
      hash(c0);
      hash(1);
    };
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jg     118b <test+0x7b>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x3,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x3,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
add    $0x1,%ebx
cmp    $0xa,%ebx
jne    1120 <test+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @test() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %12, %1 ]
%3 = tail call i32 @hash(i32 1)
%4 = tail call i32 @hash(i32 %2)
%5 = tail call i32 @hash(i32 1)
%6 = tail call i32 @hash(i32 3)
%7 = tail call i32 @hash(i32 %2)
%8 = tail call i32 @hash(i32 1)
%9 = tail call i32 @hash(i32 2)
%10 = tail call i32 @hash(i32 %2)
%11 = tail call i32 @hash(i32 1)
%12 = add nuw nsw i32 %2, 1
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %1
14: ; preds = %1
ret void
}
void getori_(ox, oy) int *ox, *oy;
{ getorigin(ox, oy); }


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

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

LLVM IR (-O0):
define void @getori_(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @getorigin to i32 (i32*, i32*, ...)*)(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @getori_(i32* %0, i32* %1) {
%3 = tail call i32 (i32*, i32*, ...) bitcast (i32 (...)* @getorigin to i32 (i32*, i32*, ...)*)(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
scalar_t__ COND_CC();
int /*<<< orphan*/ EA_A7_PI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_scc_8_pi7(void) {
  m68ki_write_8(EA_A7_PI_8(), COND_CC() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_scc_8_pi7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_A7_PI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_CC@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_scc_8_pi7>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_A7_PI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_CC@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_scc_8_pi7() {
%1 = call i32 (...) @EA_A7_PI_8()
%2 = call i64 (...) @COND_CC()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_scc_8_pi7() {
%1 = tail call i32 (...) @EA_A7_PI_8()
%2 = tail call i64 (...) @COND_CC()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FCEUMOV_AddCommand(int);
int /*<<< orphan*/ FCEUMOV_IsPlaying();
int /*<<< orphan*/ FCEU_DoSimpleCommand(int);
void FCEU_QSimpleCommand(int cmd) {
  {
    if (!FCEUMOV_IsPlaying())
      FCEU_DoSimpleCommand(cmd);
    else
      FCEUMOV_AddCommand(cmd);
  }
}


x86 assembly (clang, -O0):
<FCEU_QSimpleCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <FCEUMOV_IsPlaying@plt>
cmp    $0x0,%eax
jne    1158 <FCEU_QSimpleCommand+0x28>
mov    -0x4(%rbp),%edi
call   1030 <FCEU_DoSimpleCommand@plt>
jmp    1160 <FCEU_QSimpleCommand+0x30>
mov    -0x4(%rbp),%edi
call   1050 <FCEUMOV_AddCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FCEU_QSimpleCommand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <FCEUMOV_IsPlaying@plt>
mov    %ebx,%edi
test   %eax,%eax
je     1146 <FCEU_QSimpleCommand+0x16>
pop    %rbx
jmp    1050 <FCEUMOV_AddCommand@plt>
pop    %rbx
jmp    1030 <FCEU_DoSimpleCommand@plt>

LLVM IR (-O0):
define void @FCEU_QSimpleCommand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @FCEUMOV_IsPlaying()
%4 = icmp ne i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @FCEU_DoSimpleCommand(i32 %6)
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @FCEUMOV_AddCommand(i32 %9)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @FCEU_QSimpleCommand(i32 %0) {
%2 = tail call i32 (...) @FCEUMOV_IsPlaying()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @FCEU_DoSimpleCommand(i32 %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @FCEUMOV_AddCommand(i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}