xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ soar_ecExplainChunkTrace(char *);
void explain_trace_named_chunk(char *name) { soar_ecExplainChunkTrace(name); }


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

x86 assembly (clang, -O2):
<explain_trace_named_chunk>:
jmp    1030 <soar_ecExplainChunkTrace@plt>

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

LLVM IR (-O2):
define void @explain_trace_named_chunk(i8* %0) {
%2 = tail call i32 @soar_ecExplainChunkTrace(i8* %0)
ret void
}
int getInput() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @getInput() {
ret i32 1
}
extern int _write(int file, char *ptr, int len) {
  int iIndex;
  for (iIndex = 0; iIndex < len; iIndex++, ptr++) {
  }
  return iIndex;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1140 <_write+0x40>
jmp    1126 <_write+0x26>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1115 <_write+0x15>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
xor    %eax,%eax
test   %edx,%edx
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = call i32 @llvm.smax.i32(i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int maxof(int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void f(void) {
  int i = 5;
  int j[256];
  j[42] = 24;
  printf("%d\n", maxof(3, i, j[42], 0));
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x18,-0x368(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x368(%rbp),%edx
mov    $0x3,%edi
xor    %ecx,%ecx
call   1040 <maxof@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0x3,%edi
mov    $0x5,%esi
mov    $0x18,%edx
xor    %ecx,%ecx
call   1040 <maxof@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @f() {
%1 = alloca i32
%2 = alloca [256 x i32]
store i32 5, i32* %1
%3 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 42
store i32 24, i32* %3
%4 = load i32, i32* %1
%5 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 42
%6 = load i32, i32* %5
%7 = call i32 @maxof(i32 3, i32 %4, i32 %6, i32 0)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @f() {
%1 = tail call i32 @maxof(i32 3, i32 5, i32 24, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void signed_char_and_signed_char_signed_int(signed char *LHS, signed int RHS) {
  (*LHS) &= RHS;
}


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

x86 assembly (clang, -O2):
<signed_char_and_signed_char_signed_int>:
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_and_signed_char_signed_int(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 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = and i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @signed_char_and_signed_char_signed_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = trunc i32 %1 to i8
%5 = and i8 %3, %4
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
scalar_t__ Get_Bits(int);
int Get_dmvector() {
  if (Get_Bits(1)) {
    return Get_Bits(1) ? -1 : 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<Get_dmvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <Get_Bits@plt>
cmp    $0x0,%rax
je     1152 <Get_dmvector+0x42>
mov    $0x1,%edi
call   1030 <Get_Bits@plt>
mov    %rax,%rdx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <Get_dmvector+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_dmvector>:
push   %rax
mov    $0x1,%edi
call   1030 <Get_Bits@plt>
test   %rax,%rax
je     1134 <Get_dmvector+0x24>
mov    $0x1,%edi
call   1030 <Get_Bits@plt>
neg    %rax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Get_dmvector() {
%1 = alloca i32
%2 = call i64 @Get_Bits(i32 1)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = call i64 @Get_Bits(i32 1)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -1, i32 1
store i32 %8, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @Get_dmvector() {
%1 = tail call i64 @Get_Bits(i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 @Get_Bits(i32 1)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 1, i32 -1
br label %7
7: ; preds = %0, %3
%8 = phi i32 [ %6, %3 ], [ 0, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_help() {
  printf("Usage: ide-smart [DEVICE] [OPTION]\n"
         "       -d, --device=DEVICE  Select device DEVICE\n"
         "       -i, --immediate      Perform immediately offline tests\n"
         "       -q, --quiet-check    Returns the number of failed tests\n"
         "       -1, --auto-on        Turn on automatic offline tests\n"
         "       -0, --auto-off       Turn off automatic offline tests\n"
         "       -h, --help\n"
         "       -V, --version\n");
}


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

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

LLVM IR (-O0):
@.str = [370 x i8] c"Usage: ide-smart [DEVICE] [OPTION]\0A -d, --device=DEVICE Select device DEVICE\0A -i, --immediate Perform immediately offline tests\0A -q, --quiet-check Returns the number of failed tests\0A -1, --auto-on Turn on automatic offline tests\0A -0, --auto-off Turn off automatic offline tests\0A -h, --help\0A -V, --version\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([370 x i8], [370 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [369 x i8] c"Usage: ide-smart [DEVICE] [OPTION]\0A -d, --device=DEVICE Select device DEVICE\0A -i, --immediate Perform immediately offline tests\0A -q, --quiet-check Returns the number of failed tests\0A -1, --auto-on Turn on automatic offline tests\0A -0, --auto-off Turn off automatic offline tests\0A -h, --help\0A -V, --version\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([369 x i8], [369 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double atan2(double, double);
double hl_math_atan2(double a, double b) { return atan2(a, b); }


x86 assembly (clang, -O0):
<hl_math_atan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hl_math_atan2>:
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @hl_math_atan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @atan2(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @hl_math_atan2(double %0, double %1) {
%3 = tail call double @atan2(double %0, double %1)
ret double %3
}
unsigned int f50(unsigned int x, long int y) {
  return (x << (8 * 4 - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f50>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f50>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f50(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 32, %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %5, %8
%10 = load i32, i32* %3
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = lshr i32 %10, %12
%14 = xor i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f50(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = sub i32 32, %3
%5 = shl i32 %0, %4
%6 = lshr i32 %0, %3
%7 = xor i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ endian_write_double(void *, double, int);
void le_write_double(void *ptr, double d) { endian_write_double(ptr, d, 1); }


x86 assembly (clang, -O0):
<le_write_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%esi
call   1030 <endian_write_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_write_double>:
mov    $0x1,%esi
jmp    1030 <endian_write_double@plt>

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

LLVM IR (-O2):
define void @le_write_double(i8* %0, double %1) {
%3 = tail call i32 @endian_write_double(i8* %0, double %1, i32 1)
ret void
}
void RTVfsParsePath(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsParsePath() {
ret void
}
int foo(int a) {
  int b = a != 0;
  if (b)
    if (a != 0)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113b <foo+0x3b>
cmpl   $0x0,-0x8(%rbp)
je     1136 <foo+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1142 <foo+0x42>
jmp    113b <foo+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void microdelay(int us) {}


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

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

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

LLVM IR (-O2):
define void @microdelay(i32 %0) {
ret void
}
char *RCSid() {
  return RCSid("$Id: command.c,v 1.230.2.11 2013/07/22 22:19:10 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [60 x i8] c"$Id: command.c,v 1.230.2.11 2013/07/22 22:19:10 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ sysCall(int, char, unsigned char, unsigned char,
                           unsigned char, int /*<<< orphan*/);
void sysWriteChar(char ch, unsigned char color_blue, unsigned char color_green,
                  unsigned char color_red) {
  sysCall(4, ch, color_blue, color_green, color_red, 0);
}


x86 assembly (clang, -O0):
<sysWriteChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x2(%rbp),%cl
mov    -0x3(%rbp),%al
mov    $0x4,%edi
xor    %r9d,%r9d
movsbl %dl,%esi
movzbl %cl,%edx
movzbl %al,%ecx
movzbl -0x4(%rbp),%r8d
call   1030 <sysCall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysWriteChar>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x4,%edi
xor    %r9d,%r9d
jmp    1030 <sysCall@plt>

LLVM IR (-O0):
define void @sysWriteChar(i8 signext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %5
%10 = load i8, i8* %6
%11 = load i8, i8* %7
%12 = load i8, i8* %8
%13 = call i32 @sysCall(i32 4, i8 signext %9, i8 zeroext %10, i8 zeroext %11, i8 zeroext %12, i32 0)
ret void
}

LLVM IR (-O2):
define void @sysWriteChar(i8 signext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = tail call i32 @sysCall(i32 4, i8 signext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ client_stop();
void sighandler(int sig) { client_stop(); }


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

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

LLVM IR (-O0):
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @client_stop()
ret void
}

LLVM IR (-O2):
define void @sighandler(i32 %0) {
%2 = tail call i32 (...) @client_stop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: bzimage2eva <loadadddr> <entry> <bzimagefile> <evafile>\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"usage: bzimage2eva <loadadddr> <entry> <bzimagefile> <evafile>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"usage: bzimage2eva <loadadddr> <entry> <bzimagefile> <evafile>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int);
void ibx_debug_blc_pwm_ctl2(char *result, int len, int reg, uint32_t val,
                            uint32_t devid) {
  int freq, cycle;
  freq = (val >> 16) & 0xFFFF;
  cycle = val & 0xFFFF;
  snprintf(result, len, "freq %d, cycle %d", freq, cycle);
}


x86 assembly (clang, -O0):
<ibx_debug_blc_pwm_ctl2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x10,%eax
and    $0xffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xea9(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibx_debug_blc_pwm_ctl2>:
movzwl %cx,%r8d
shr    $0x10,%ecx
lea    0xee2(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"freq %d, cycle %d\00"
define void @ibx_debug_blc_pwm_ctl2(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load i32, i32* %9
%14 = ashr i32 %13, 16
%15 = and i32 %14, 65535
store i32 %15, i32* %11
%16 = load i32, i32* %9
%17 = and i32 %16, 65535
store i32 %17, i32* %12
%18 = load i8*, i8** %6
%19 = load i32, i32* %7
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = call i32 @snprintf(i8* %18, i32 %19, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"freq %d, cycle %d\00"
define void @ibx_debug_blc_pwm_ctl2(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = lshr i32 %3, 16
%7 = and i32 %3, 65535
%8 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret void
}
int CharacterIsLowercase(char ch) { return ((ch >= 'a') && (ch <= 'z')); }


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

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

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

LLVM IR (-O2):
define i32 @CharacterIsLowercase(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int f(int x, int y, unsigned u, unsigned v) {
  return (x < y) + (x <= y) + (x >= y) + (x != y) + (u < v);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setge  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
cmp    -0x10(%rbp),%ecx
setb   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %r10d,%r10d
xor    %eax,%eax
cmp    %esi,%edi
setl   %r8b
setle  %r9b
setge  %r10b
setne  %al
add    %r8d,%r9d
add    %r10d,%r9d
add    %r9d,%eax
cmp    %ecx,%edx
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
%12 = zext i1 %11 to i32
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sle i32 %13, %14
%16 = zext i1 %15 to i32
%17 = add nsw i32 %12, %16
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = icmp sge i32 %18, %19
%21 = zext i1 %20 to i32
%22 = add nsw i32 %17, %21
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = icmp ne i32 %23, %24
%26 = zext i1 %25 to i32
%27 = add nsw i32 %22, %26
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = icmp ult i32 %28, %29
%31 = zext i1 %30 to i32
%32 = add nsw i32 %27, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %0, %1
%6 = zext i1 %5 to i32
%7 = icmp sle i32 %0, %1
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = icmp sge i32 %0, %1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %9, %11
%13 = icmp ne i32 %0, %1
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %12, %14
%16 = icmp ult i32 %2, %3
%17 = zext i1 %16 to i32
%18 = add nuw nsw i32 %15, %17
ret i32 %18
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ config_weechat_debug_set_all();
void config_weechat_debug_change_cb(void *data,
                                    struct t_config_option *option) {
  (void)data;
  (void)option;
  config_weechat_debug_set_all();
}


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

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

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

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @config_weechat_debug_change_cb(i8* nocapture readnone %0, %struct.t_config_option* nocapture readnone %1) {
%3 = tail call i32 (...) @config_weechat_debug_set_all()
ret void
}
/* Variables and functions */
int f368(int *);
int f369(int *p) { return f368(p); }


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

x86 assembly (clang, -O2):
<f369>:
jmp    1030 <f368@plt>

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

LLVM IR (-O2):
define i32 @f369(i32* %0) {
%2 = tail call i32 @f368(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

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


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

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

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

LLVM IR (-O2):
define i32 @be_to_h_u32(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 3
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i64, i64* %0, i64 2
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %0, i64 1
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %9, %13
%15 = load i64, i64* %0
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %14, %17
ret i32 %18
}
int test_imm_DCuint16_mem(unsigned short *val) {
  return ((*val) & (0xDC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DCuint16_mem>:
testb  $0xdc,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DCuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 220
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int hoare_artition(int *, int, int);
void hoare_quick_sort(int A[], int p, int r) {
  if (p < r) {
    int q = hoare_artition(A, p, r);
    hoare_quick_sort(A, p, q - 1);
    hoare_quick_sort(A, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<hoare_quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <hoare_quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <hoare_artition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <hoare_quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <hoare_quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hoare_quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <hoare_quick_sort+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   1040 <hoare_artition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <hoare_quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <hoare_quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @hoare_quick_sort(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
%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 @hoare_artition(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 @hoare_quick_sort(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 @hoare_artition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @hoare_quick_sort(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
}
/* Variables and functions */
char *strdup(char *);
char *sub_help_filter(int key, const char *text, void *input) {
  if (key == 0x2000004)
    return strdup("This is some extra text from the sub parser (note that it "
                  "is preceded by a blank line).");
  else
    return (char *)text;
}


x86 assembly (clang, -O0):
<sub_help_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x2000004,-0xc(%rbp)
jne    1145 <sub_help_filter+0x35>
lea    0xec9(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    114d <sub_help_filter+0x3d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_help_filter>:
cmp    $0x2000004,%edi
jne    1124 <sub_help_filter+0x14>
lea    0xee1(%rip),%rdi
jmp    1030 <strdup@plt>
mov    %rsi,%rax
ret

LLVM IR (-O0):
@.str = [88 x i8] c"This is some extra text from the sub parser (note that it is preceded by a blank line).\00"
define i8* @sub_help_filter(i32 %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 33554436
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i8* @strdup(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
store i8* %11, i8** %4
br label %14
12: ; preds = %3
%13 = load i8*, i8** %6
store i8* %13, i8** %4
br label %14
14: ; preds = %12, %10
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
@.str = [88 x i8] c"This is some extra text from the sub parser (note that it is preceded by a blank line).\00"
define i8* @sub_help_filter(i32 %0, i8* readnone %1, i8* nocapture readnone %2) {
%4 = icmp eq i32 %0, 33554436
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call dereferenceable_or_null(88) i8* @strdup(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %3, %5
%8 = phi i8* [ %6, %5 ], [ %1, %3 ]
ret i8* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_movc_DPTR(FILE *stream) {
  fprintf(stream, "MOVC  A, @A+DPTR                ");
}


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

x86 assembly (clang, -O2):
<fprint_movc_DPTR>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"MOVC A, @A+DPTR \00"
define void @fprint_movc_DPTR(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"MOVC A, @A+DPTR \00"
define void @fprint_movc_DPTR(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 32, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_hex(int, unsigned char *, int);
int /*<<< orphan*/ printerr(int, char *, ...);
void print_hexl(int pri, unsigned char *cp, int length) {
  printerr(pri, "length %d\n", length);
  printerr(pri, "\n");
  print_hex(pri, cp, length);
}


x86 assembly (clang, -O0):
<print_hexl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%edx
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <printerr@plt>
mov    -0x4(%rbp),%edi
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1030 <printerr@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <print_hex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hexl>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xece(%rip),%rsi
xor    %eax,%eax
call   1030 <printerr@plt>
lea    0xec9(%rip),%rsi
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <printerr@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <print_hex@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"length %d\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_hexl(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = call i32 (i32, i8*, ...) @printerr(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %4
%11 = call i32 (i32, i8*, ...) @printerr(i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i32 @print_hex(i32 %12, i8* %13, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"length %d\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_hexl(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i32, i8*, ...) @printerr(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = tail call i32 (i32, i8*, ...) @printerr(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @print_hex(i32 %0, i8* %1, i32 %2)
ret void
}
int aRead() {
  unsigned char h, l;
  l = (*(volatile unsigned char *)(0x78));
  h = (*(volatile unsigned char *)(0x79));
  return (h << 8) | l;
}


x86 assembly (clang, -O0):
<aRead>:
push   %rbp
mov    %rsp,%rbp
mov    $0x78,%eax
mov    (%rax),%al
mov    %al,-0x2(%rbp)
mov    $0x79,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aRead>:
movzbl 0x78,%ecx
movzbl 0x79,%eax
shl    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @aRead() {
%1 = alloca i8
%2 = alloca i8
%3 = load volatile i8, i8* inttoptr (i64 120 to i8*)
store i8 %3, i8* %2
%4 = load volatile i8, i8* inttoptr (i64 121 to i8*)
store i8 %4, i8* %1
%5 = load i8, i8* %1
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = or i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @aRead() {
%1 = load volatile i8, i8* inttoptr (i64 120 to i8*)
%2 = load volatile i8, i8* inttoptr (i64 121 to i8*)
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freesize(void *p, size_t s) {
  (void)s;
  free(p);
}


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

x86 assembly (clang, -O2):
<freesize>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freesize(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void table_end(void) { printf("\n  };\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"\0A };\00"
define void @table_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct dspd_dict {
  int dummy;
};

/* Variables and functions */
struct dspd_dict *new_section(char const *, int /*<<< orphan*/ *);
struct dspd_dict *dspd_dict_new(const char *name) {
  return new_section(name, NULL);
}


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

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

LLVM IR (-O0):
%struct.dspd_dict = type { i32 }
define %struct.dspd_dict* @dspd_dict_new(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.dspd_dict* @new_section(i8* %3, i32* null)
ret %struct.dspd_dict* %4
}

LLVM IR (-O2):
%struct.dspd_dict = type { i32 }
define %struct.dspd_dict* @dspd_dict_new(i8* %0) {
%2 = tail call %struct.dspd_dict* @new_section(i8* %0, i32* null)
ret %struct.dspd_dict* %2
}
/* Variables and functions */
int strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int);
int nz_strcmp(int nzlength, const char *nz, const char *z) {
  int zlength = strlen(z);
  return (zlength == nzlength) && (strncmp(nz, z, zlength) == 0) ? 0 : -1;
}


x86 assembly (clang, -O0):
<nz_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x1d(%rbp)
jne    116a <nz_strcmp+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%dl
mov    $0xffffffff,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nz_strcmp>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %rdx,%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ebp,%ecx
jne    1151 <nz_strcmp+0x31>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <strncmp@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nz_strcmp(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load i32, i32* %4
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = call i64 @strncmp(i8* %14, i8* %15, i32 %16)
%18 = icmp eq i64 %17, 0
br label %19
19: ; preds = %13, %3
%20 = phi i1 [ false, %3 ], [ %18, %13 ]
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 0, i32 -1
ret i32 %22
}

LLVM IR (-O2):
define i32 @nz_strcmp(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = icmp eq i32 %4, %0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @strncmp(i8* %1, i8* %2, i32 %0)
%8 = icmp ne i64 %7, 0
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ -1, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int get_version_1();
int get_version_2();
int main(void) {
  int v1 = get_version_1();
  int v2 = get_version_2();
  if (v1 != 104)
    return 1;
  if (v2 != 104 && v2 != 203)
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_version_1@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <get_version_2@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x68,-0x8(%rbp)
je     1159 <main+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1183 <main+0x63>
cmpl   $0x68,-0xc(%rbp)
je     117c <main+0x5c>
cmpl   $0xcb,-0xc(%rbp)
je     117c <main+0x5c>
movl   $0x2,-0x4(%rbp)
jmp    1183 <main+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <get_version_1@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <get_version_2@plt>
xor    %ecx,%ecx
cmp    $0x68,%eax
setne  %cl
add    %ecx,%ecx
cmp    $0xcb,%eax
cmove  %ebp,%ecx
cmp    $0x68,%ebx
mov    $0x1,%eax
cmove  %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @get_version_1()
%2 = tail call i32 (...) @get_version_2()
%3 = icmp eq i32 %1, 104
%4 = icmp eq i32 %2, 203
%5 = icmp eq i32 %2, 104
%6 = or i1 %4, %5
%7 = select i1 %6, i32 0, i32 2
%8 = select i1 %3, i32 %7, i32 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++)
    printf("%s ", argv[i]);
  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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %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 i32 0
}
/* Type definitions */
struct WaitGroup {
  int dummy;
};

/* Variables and functions */
int Add(struct WaitGroup *, int);
int Done(struct WaitGroup *wp) { return Add(wp, -1); }


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

x86 assembly (clang, -O2):
<Done>:
mov    $0xffffffff,%esi
jmp    1030 <Add@plt>

LLVM IR (-O0):
%struct.WaitGroup = type { i32 }
define i32 @Done(%struct.WaitGroup* %0) {
%2 = alloca %struct.WaitGroup*
store %struct.WaitGroup* %0, %struct.WaitGroup** %2
%3 = load %struct.WaitGroup*, %struct.WaitGroup** %2
%4 = call i32 @Add(%struct.WaitGroup* %3, i32 -1)
ret i32 %4
}

LLVM IR (-O2):
%struct.WaitGroup = type { i32 }
define i32 @Done(%struct.WaitGroup* %0) {
%2 = tail call i32 @Add(%struct.WaitGroup* %0, i32 -1)
ret i32 %2
}