xunge/DecIR huggingface dataset:
BOOST_AUTO_TEST_CASE(ln) { TESTCASE1(ln, 1, 0); }


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
mov    $0x1,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <TESTCASE1@plt>

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

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 1, i32 0)
ret i32 undef
}
int abs(int n) {
  if (n < 0)
    n = -n;
  return n;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1119 <abs+0x19>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%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
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void put_fs_word(short val, short *addr) {
  __asm__("movw %0,%%fs:%1" ::"r"(val), "m"(*addr));
}


x86 assembly (clang, -O0):
<put_fs_word>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rcx
mov    %ax,%fs:(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_fs_word>:
mov    %di,%fs:(%rsi)
ret

LLVM IR (-O0):
define void @put_fs_word(i16 signext %0, i16* %1) {
%3 = alloca i16
%4 = alloca i16*
store i16 %0, i16* %3
store i16* %1, i16** %4
%5 = load i16, i16* %3
%6 = load i16*, i16** %4
ret void
}

LLVM IR (-O2):
define void @put_fs_word(i16 signext %0, i16* %1) {
tail call void asm sideeffect "movw $0,%fs:$1", "r,*m,~{dirflag},~{fpsr},~{flags}"(i16 %0, i16* elementtype(i16) %1)
ret void
}
/* Type definitions */
struct bbiFile {
  int dummy;
};

/* Variables and functions */
struct bbiFile *bbiFileOpen(char *, int, char *);
struct bbiFile *bigWigFileOpen(char *fileName) {
  return bbiFileOpen(fileName, 0x888FFC26, "big wig");
}


x86 assembly (clang, -O0):
<bigWigFileOpen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x888ffc26,%esi
lea    0xed4(%rip),%rdx
call   1030 <bbiFileOpen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigWigFileOpen>:
lea    0xee9(%rip),%rdx
mov    $0x888ffc26,%esi
jmp    1030 <bbiFileOpen@plt>

LLVM IR (-O0):
%struct.bbiFile = type { i32 }
@.str = [8 x i8] c"big wig\00"
define %struct.bbiFile* @bigWigFileOpen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.bbiFile* @bbiFileOpen(i8* %3, i32 -2003829722, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.bbiFile* %4
}

LLVM IR (-O2):
%struct.bbiFile = type { i32 }
@.str = [8 x i8] c"big wig\00"
define %struct.bbiFile* @bigWigFileOpen(i8* %0) {
%2 = tail call %struct.bbiFile* @bbiFileOpen(i8* %0, i32 -2003829722, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.bbiFile* %2
}
/* Variables and functions */
int /*<<< orphan*/ cumnor(double *, double *, double *);
double gaudf(double x) {
  double xx = x, p, q;
  cumnor(&xx, &p, &q);
  return p;
}


x86 assembly (clang, -O0):
<gaudf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <cumnor@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaudf>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
lea    0x10(%rsp),%rdx
call   1030 <cumnor@plt>
movsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @gaudf(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
store double %6, double* %3
%7 = call i32 @cumnor(double* %3, double* %4, double* %5)
%8 = load double, double* %4
ret double %8
}

LLVM IR (-O2):
define double @gaudf(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %2 to i8*
store double %0, double* %2
%6 = bitcast double* %3 to i8*
%7 = bitcast double* %4 to i8*
%8 = call i32 @cumnor(double* %2, double* %3, double* %4)
%9 = load double, double* %3
ret double %9
}
/* Variables and functions */
void *strdup(void *);
void *strcp(void *key) { return strdup(key); }


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

x86 assembly (clang, -O2):
<strcp>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @strcp(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
void emit_int8(struct processor_explicatory_state *process_state,
               struct modern_stream *stream, void *stream_state,
               struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_int8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_int8(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_int8(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/, int);
char *get_version() {
  static char *version = NULL;
  if (version == NULL) {
    version = (char *)malloc(64);
    sprintf(version, "%d.%d", 0, 50);
  }
  return version;
}


x86 assembly (clang, -O0):
<get_version>:
push   %rbp
mov    %rsp,%rbp
cmpq   $0x0,0x2f0c(%rip)
jne    115d <get_version+0x3d>
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,0x2ef5(%rip)
mov    0x2eee(%rip),%rdi
lea    0xeaf(%rip),%rsi
xor    %edx,%edx
mov    $0x32,%ecx
call   1040 <sprintf@plt>
mov    0x2ed4(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_version>:
push   %rax
mov    0x2f10(%rip),%rax
test   %rax,%rax
je     112f <get_version+0xf>
pop    %rcx
ret
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,0x2ef8(%rip)
lea    0xeb9(%rip),%rsi
mov    %rax,%rdi
xor    %edx,%edx
mov    $0x32,%ecx
call   1040 <sprintf@plt>
mov    0x2edb(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@get_version.version = internal global i8* null
@.str = [6 x i8] c"%d.%d\00"
define i8* @get_version() {
%1 = load i8*, i8** @get_version.version
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = call i64 @malloc(i32 64)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** @get_version.version
%6 = load i8*, i8** @get_version.version
%7 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0, i32 50)
br label %8
8: ; preds = %3, %0
%9 = load i8*, i8** @get_version.version
ret i8* %9
}

LLVM IR (-O2):
@get_version.version = internal unnamed_addr global i8* null
@.str = [6 x i8] c"%d.%d\00"
define i8* @get_version() {
%1 = load i8*, i8** @get_version.version
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i64 @malloc(i32 64)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** @get_version.version
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0, i32 50)
%7 = load i8*, i8** @get_version.version
br label %8
8: ; preds = %3, %0
%9 = phi i8* [ %7, %3 ], [ %1, %0 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ utest_control();
void utest_adts_matrix(void) {
  utest_control();
  return;
}


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

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

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

LLVM IR (-O2):
define void @utest_adts_matrix() {
%1 = tail call i32 (...) @utest_control()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int turnoff_lcd_backlight(void) {
  system("echo 0 "
         ">/sys/devices/platform/sprd_backlight/backlight/sprd_backlight/"
         "brightness");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [81 x i8] c"echo 0 >/sys/devices/platform/sprd_backlight/backlight/sprd_backlight/brightness\00"
define i32 @turnoff_lcd_backlight() {
%1 = call i32 @system(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [81 x i8] c"echo 0 >/sys/devices/platform/sprd_backlight/backlight/sprd_backlight/brightness\00"
define i32 @turnoff_lcd_backlight() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ xlfail(char *);
void checkfzero(float farg) {
  if (farg == 0.0)
    xlfail("division by zero");
}


x86 assembly (clang, -O0):
<checkfzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1145 <checkfzero+0x35>
jp     1145 <checkfzero+0x35>
lea    0xec0(%rip),%rdi
call   1030 <xlfail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkfzero>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1126 <checkfzero+0x16>
jp     1126 <checkfzero+0x16>
lea    0xedf(%rip),%rdi
jmp    1030 <xlfail@plt>
ret

LLVM IR (-O0):
@.str = [17 x i8] c"division by zero\00"
define void @checkfzero(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @xlfail(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"division by zero\00"
define void @checkfzero(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @xlfail(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int pixel_satd_wxh(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *, int, int,
                   int);
int pixel_satd_8x8(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                   int i_stride_pix2) {
  return pixel_satd_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 8, 8);
}


x86 assembly (clang, -O0):
<pixel_satd_8x8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x8,%r9d
mov    %r9d,%r8d
call   1030 <pixel_satd_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_satd_8x8>:
mov    $0x8,%r8d
mov    $0x8,%r9d
jmp    1030 <pixel_satd_wxh@plt>

LLVM IR (-O0):
define i32 @pixel_satd_8x8(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 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @pixel_satd_wxh(i32* %9, i32 %10, i32* %11, i32 %12, i32 8, i32 8)
ret i32 %13
}

LLVM IR (-O2):
define i32 @pixel_satd_8x8(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @pixel_satd_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 8, i32 8)
ret i32 %5
}
int test_imm_64uint16_mem(unsigned short *val) {
  return ((*val) & (0x64 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_64uint16_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, 100
%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_64uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 100
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int slk_attron(int /*<<< orphan*/ const);
int __darwin_slk_attron(const uint32_t c) { return slk_attron(c); }


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

x86 assembly (clang, -O2):
<__darwin_slk_attron>:
jmp    1030 <slk_attron@plt>

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

LLVM IR (-O2):
define i32 @__darwin_slk_attron(i32 %0) {
%2 = tail call i32 @slk_attron(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void prompt() { printf("> "); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
define void @prompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct robot {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ drive(struct robot *, int, int);
int cmd_drive(struct robot *robot, int *args) {
  drive(robot, args[0], args[1]);
  return 1;
}


x86 assembly (clang, -O0):
<cmd_drive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
call   1030 <drive@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_drive>:
push   %rax
mov    (%rsi),%eax
mov    0x4(%rsi),%edx
mov    %eax,%esi
call   1030 <drive@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.robot = type { i32 }
define i32 @cmd_drive(%struct.robot* %0, i32* %1) {
%3 = alloca %struct.robot*
%4 = alloca i32*
store %struct.robot* %0, %struct.robot** %3
store i32* %1, i32** %4
%5 = load %struct.robot*, %struct.robot** %3
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = call i32 @drive(%struct.robot* %5, i32 %8, i32 %11)
ret i32 1
}

LLVM IR (-O2):
%struct.robot = type { i32 }
define i32 @cmd_drive(%struct.robot* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @drive(%struct.robot* %0, i32 %3, i32 %5)
ret i32 1
}
void uart_putchar(int c) {
  while (!(*(volatile unsigned char *)(0x14000000 + (0x3f8 + 5)) & 0x20))
    continue;
again:
  *(volatile unsigned char *)(0x14000000 + (0x3f8)) = c;
  while (!(*(volatile unsigned char *)(0x14000000 + (0x3f8 + 5)) & 0x20))
    continue;
  if (c == '\n') {
    c = '\r';
    goto again;
  }
}


x86 assembly (clang, -O0):
<uart_putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x140003fd,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1129 <uart_putchar+0x29>
jmp    112e <uart_putchar+0x2e>
jmp    1107 <uart_putchar+0x7>
jmp    1133 <uart_putchar+0x33>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x140003f8,%eax
mov    %cl,(%rax)
mov    $0x140003fd,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1161 <uart_putchar+0x61>
jmp    1166 <uart_putchar+0x66>
jmp    113f <uart_putchar+0x3f>
cmpl   $0xa,-0x4(%rbp)
jne    117c <uart_putchar+0x7c>
movl   $0xd,-0x4(%rbp)
jmp    1133 <uart_putchar+0x33>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_putchar>:
testb  $0x20,0x140003fd
20
je     1100 <uart_putchar>
nopw   0x0(%rax,%rax,1)
mov    %dil,0x140003f8
14
nopl   0x0(%rax,%rax,1)
testb  $0x20,0x140003fd
20
je     1120 <uart_putchar+0x20>
cmp    $0xa,%edi
mov    $0xd,%edi
je     1110 <uart_putchar+0x10>
ret

LLVM IR (-O0):
define void @uart_putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %9, %1
%4 = load volatile i8, i8* inttoptr (i64 335545341 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 32
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
br label %11
11: ; preds = %24, %10
%12 = load i32, i32* %2
%13 = trunc i32 %12 to i8
store volatile i8 %13, i8* inttoptr (i64 335545336 to i8*)
br label %14
14: ; preds = %20, %11
%15 = load volatile i8, i8* inttoptr (i64 335545341 to i8*)
%16 = zext i8 %15 to i32
%17 = and i32 %16, 32
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
br i1 %19, label %20, label %21
20: ; preds = %14
br label %14
21: ; preds = %14
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 10
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 13, i32* %2
br label %11
25: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @uart_putchar(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i8, i8* inttoptr (i64 335545341 to i8*)
%4 = and i8 %3, 32
%5 = icmp eq i8 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2, %13
%7 = phi i32 [ 13, %13 ], [ %0, %2 ]
%8 = trunc i32 %7 to i8
store volatile i8 %8, i8* inttoptr (i64 335545336 to i8*)
br label %9
9: ; preds = %9, %6
%10 = load volatile i8, i8* inttoptr (i64 335545341 to i8*)
%11 = and i8 %10, 32
%12 = icmp eq i8 %11, 0
br i1 %12, label %9, label %13
13: ; preds = %9
%14 = icmp eq i32 %7, 10
br i1 %14, label %6, label %15
15: ; preds = %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ split_me(int);
main() {
  split_me(1);
  split_me(2);
  split_me(3);
  split_me(4);
  split_me(5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <split_me@plt>
mov    $0x2,%edi
call   1030 <split_me@plt>
mov    $0x3,%edi
call   1030 <split_me@plt>
mov    $0x4,%edi
call   1030 <split_me@plt>
mov    $0x5,%edi
call   1030 <split_me@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <split_me@plt>
mov    $0x2,%edi
call   1030 <split_me@plt>
mov    $0x3,%edi
call   1030 <split_me@plt>
mov    $0x4,%edi
call   1030 <split_me@plt>
mov    $0x5,%edi
call   1030 <split_me@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @split_me(i32 1)
%2 = call i32 @split_me(i32 2)
%3 = call i32 @split_me(i32 3)
%4 = call i32 @split_me(i32 4)
%5 = call i32 @split_me(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @split_me(i32 1)
%2 = tail call i32 @split_me(i32 2)
%3 = tail call i32 @split_me(i32 3)
%4 = tail call i32 @split_me(i32 4)
%5 = tail call i32 @split_me(i32 5)
ret i32 0
}
testjump(label) int label;
{
  debug_ol("; testjump");
  ol("tstb");
  ol("bne	*+5");
  ot("jmp	");
  printlabel(label);
  nl();
}


x86 assembly (clang, -O0):
<testjump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1060 <debug_ol@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1050 <ol@plt>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1050 <ol@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1040 <ot@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1070 <printlabel@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testjump>:
push   %rbx
mov    %edi,%ebx
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1060 <debug_ol@plt>
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1050 <ol@plt>
lea    0xe9a(%rip),%rdi
xor    %eax,%eax
call   1050 <ol@plt>
lea    0xe94(%rip),%rdi
xor    %eax,%eax
call   1040 <ot@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1070 <printlabel@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"; testjump\00"
@.str.1 = [5 x i8] c"tstb\00"
@.str.2 = [8 x i8] c"bne\09*+5\00"
@.str.3 = [5 x i8] c"jmp\09\00"
define i32 @testjump(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%8 = load i32, i32* %3
%9 = call i32 (i32, ...) bitcast (i32 (...)* @printlabel to i32 (i32, ...)*)(i32 %8)
%10 = call i32 (...) @nl()
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [11 x i8] c"; testjump\00"
@.str.1 = [5 x i8] c"tstb\00"
@.str.2 = [8 x i8] c"bne\09*+5\00"
@.str.3 = [5 x i8] c"jmp\09\00"
define i32 @testjump(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @printlabel to i32 (i32, ...)*)(i32 %0)
%7 = tail call i32 (...) @nl()
ret i32 undef
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *stringFieldInSubmissionSet(struct sqlConnection *, int, char *);
char *genePixSetUrl(struct sqlConnection *conn, int id) {
  return stringFieldInSubmissionSet(conn, id, "setUrl");
}


x86 assembly (clang, -O0):
<genePixSetUrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <stringFieldInSubmissionSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genePixSetUrl>:
lea    0xee9(%rip),%rdx
jmp    1030 <stringFieldInSubmissionSet@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [7 x i8] c"setUrl\00"
define i8* @genePixSetUrl(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @stringFieldInSubmissionSet(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [7 x i8] c"setUrl\00"
define i8* @genePixSetUrl(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @stringFieldInSubmissionSet(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
int sarprintf_warning(const char *format, ...) {
  format = format;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sarprintf_warning(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmove_ata_2a1t_subcomm();
int main() {
  gmove_ata_2a1t_subcomm();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <gmove_ata_2a1t_subcomm@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gmove_ata_2a1t_subcomm()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gmove_ata_2a1t_subcomm()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void printhelp(FILE *file) {
  fputs("usage: adnsheloex [<options>] [<logfile>]\n"
        "       adnsheloex --version|--help\n"
        "options: -c <concurrency>  set max number of outstanding queries\n"
        "         -p                use poll(2) instead of select(2)\n"
        "         -d                turn on debugging\n"
        "         -C <config>       use instead of contents of resolv.conf\n",
        stdout);
}


x86 assembly (clang, -O0):
<printhelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhelp>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [314 x i8] c"usage: adnsheloex [<options>] [<logfile>]\0A adnsheloex --version|--help\0Aoptions: -c <concurrency> set max number of outstanding queries\0A -p use poll(2) instead of select(2)\0A -d turn on debugging\0A -C <config> use instead of contents of resolv.conf\0A\00"
@stdout = global i32 0
define void @printhelp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([314 x i8], [314 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [314 x i8] c"usage: adnsheloex [<options>] [<logfile>]\0A adnsheloex --version|--help\0Aoptions: -c <concurrency> set max number of outstanding queries\0A -p use poll(2) instead of select(2)\0A -d turn on debugging\0A -C <config> use instead of contents of resolv.conf\0A\00"
@stdout = global i32 0
define void @printhelp(i32* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([314 x i8], [314 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void foo_2_2_2_1_1_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_1_2_1_2_2() {
ret void
}
signed long long signedlonglong_ignoring_signedchar(signed long long x,
                                                    signed char y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlonglong_ignoring_signedchar(i64 %0, i8 signext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlonglong_ignoring_signedchar(i64 returned %0, i8 signext %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
#pragma omp parallel sections
  {
#pragma omp section
    {
      unsigned int i = -1;
      printf("Hello world of omp #%u\n", i++);
    }
#pragma omp section
    {
      unsigned int i;
      printf("Hello world of omp #%u\n", i++);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Hello world of omp #%u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 -1, i32* %5
%7 = load i32, i32* %5
%8 = add i32 %7, 1
store i32 %8, i32* %5
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
%10 = load i32, i32* %6
%11 = add i32 %10, 1
store i32 %11, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Hello world of omp #%u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 -1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x, y;
  x = 3;
  y = 4;
  assert(x * y == 12);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 4, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = mul nsw i32 %4, %5
%7 = icmp eq i32 %6, 12
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
unsigned char peek2(unsigned short, unsigned short);
unsigned char peek3(unsigned short int seg, unsigned short int offset) {
  unsigned short int w;
  if (offset == 0xFFFFU) {
    w = peek2(seg, 0xFFFEU);
    return (w >> 8) & 0xFF;
  }
  return peek2(seg, offset);
}


x86 assembly (clang, -O0):
<peek3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
cmp    $0xffff,%eax
jne    115e <peek3+0x4e>
mov    $0xfffe,%esi
movzwl -0x4(%rbp),%edi
call   1030 <peek2@plt>
movzbl %al,%eax
mov    %ax,-0x8(%rbp)
movzwl -0x8(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x1(%rbp)
jmp    1171 <peek3+0x61>
mov    -0x4(%rbp),%ax
movzwl %ax,%edi
movzwl -0x6(%rbp),%esi
call   1030 <peek2@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peek3>:
cmp    $0xffff,%si
je     1121 <peek3+0x11>
movzwl %di,%edi
movzwl %si,%esi
jmp    1030 <peek2@plt>
push   %rax
movzwl %di,%edi
mov    $0xfffe,%esi
call   1030 <peek2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @peek3(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
%7 = load i16, i16* %5
%8 = zext i16 %7 to i32
%9 = icmp eq i32 %8, 65535
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = load i16, i16* %4
%12 = call zeroext i8 @peek2(i16 zeroext %11, i16 zeroext -2)
%13 = zext i8 %12 to i16
store i16 %13, i16* %6
%14 = load i16, i16* %6
%15 = zext i16 %14 to i32
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = trunc i32 %17 to i8
store i8 %18, i8* %3
br label %23
19: ; preds = %2
%20 = load i16, i16* %4
%21 = load i16, i16* %5
%22 = call zeroext i8 @peek2(i16 zeroext %20, i16 zeroext %21)
store i8 %22, i8* %3
br label %23
23: ; preds = %19, %10
%24 = load i8, i8* %3
ret i8 %24
}

LLVM IR (-O2):
define zeroext i8 @peek3(i16 zeroext %0, i16 zeroext %1) {
%3 = icmp eq i16 %1, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call zeroext i8 @peek2(i16 zeroext %0, i16 zeroext -2)
br label %8
6: ; preds = %2
%7 = tail call zeroext i8 @peek2(i16 zeroext %0, i16 zeroext %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8 [ 0, %4 ], [ %7, %6 ]
ret i8 %9
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
double sfmt_to_res53(int);
double sfmt_to_res53_mix(uint32_t x, uint32_t y) {
  return sfmt_to_res53(x | ((uint64_t)y << 32));
}


x86 assembly (clang, -O0):
<sfmt_to_res53_mix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     %eax,%edi
call   1030 <sfmt_to_res53@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfmt_to_res53_mix>:
jmp    1030 <sfmt_to_res53@plt>

LLVM IR (-O0):
define double @sfmt_to_res53_mix(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 = shl i32 %6, 32
%8 = or i32 %5, %7
%9 = call double @sfmt_to_res53(i32 %8)
ret double %9
}

LLVM IR (-O2):
define double @sfmt_to_res53_mix(i32 %0, i32 %1) {
%3 = tail call double @sfmt_to_res53(i32 poison)
ret double %3
}
oldstyle3(a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @oldstyle3(i32 returned %0) {
ret i32 %0
}
f(m) {
  int i, s = 0;
  for (i = 0; i < m; i++)
    s += i;
  return s;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <f+0x38>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <f+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
jle    1118 <f+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,1),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = add i32 %10, %0
%12 = add i32 %11, -1
br label %13
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %12, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ null();
int /*<<< orphan*/ write_char(int);
void print_small_int(int x) {
  null();
  write_char('0' + x);
}


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

x86 assembly (clang, -O2):
<print_small_int>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <null@plt>
add    $0x30,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <write_char@plt>

LLVM IR (-O0):
define void @print_small_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @null()
%4 = load i32, i32* %2
%5 = add nsw i32 48, %4
%6 = call i32 @write_char(i32 %5)
ret void
}

LLVM IR (-O2):
define void @print_small_int(i32 %0) {
%2 = tail call i32 (...) @null()
%3 = add nsw i32 %0, 48
%4 = tail call i32 @write_char(i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ isTrue(char const *);
unsigned long strtoul(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
unsigned long parseLongInteger(const char *value) {
  if (isTrue(value))
    return (1);
  return (strtoul(value, NULL, 0));
}


x86 assembly (clang, -O0):
<parseLongInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <isTrue@plt>
cmp    $0x0,%rax
je     114c <parseLongInteger+0x2c>
movq   $0x1,-0x8(%rbp)
jmp    115f <parseLongInteger+0x3f>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseLongInteger>:
push   %rbx
mov    %rdi,%rbx
call   1030 <isTrue@plt>
test   %rax,%rax
je     1135 <parseLongInteger+0x15>
mov    $0x1,%eax
pop    %rbx
ret
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <strtoul@plt>

LLVM IR (-O0):
define i64 @parseLongInteger(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @isTrue(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 1, i64* %2
br label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strtoul(i8* %9, i32* null, i32 0)
store i64 %10, i64* %2
br label %11
11: ; preds = %8, %7
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
define i64 @parseLongInteger(i8* %0) {
%2 = tail call i64 @isTrue(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i64 @strtoul(i8* nocapture %0, i32* null, i32 0)
br label %6
6: ; preds = %1, %4
%7 = phi i64 [ %5, %4 ], [ 1, %1 ]
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ error(int, char *, char *, char *);
int /*<<< orphan*/ exit(int);
void unterminated_string(int lineno, char *line, char *cptr) {
  error(lineno, line, cptr, "unterminated string");
  exit(1);
}


x86 assembly (clang, -O0):
<unterminated_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xebb(%rip),%rcx
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<unterminated_string>:
push   %rax
lea    0xed8(%rip),%rcx
call   1030 <error@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"unterminated string\00"
define void @unterminated_string(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @error(i32 %7, i8* %8, i8* %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"unterminated string\00"
define void @unterminated_string(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @error(i32 %0, i8* %1, i8* %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct ct2db_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int ct2db_cmdline_parser_required(struct ct2db_args_info *args_info,
                                  const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<ct2db_cmdline_parser_required>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct2db_cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.ct2db_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @ct2db_cmdline_parser_required(%struct.ct2db_args_info* %0, i8* %1) {
%3 = alloca %struct.ct2db_args_info*
%4 = alloca i8*
store %struct.ct2db_args_info* %0, %struct.ct2db_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.ct2db_args_info*, %struct.ct2db_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.ct2db_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @ct2db_cmdline_parser_required(%struct.ct2db_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
int test_imm_6Auint8_reg(unsigned char val) {
  return ((val) & (0x6A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Auint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 106
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ test_show(char *, int, int);
void test_assert(int result, int value) {
  if (result != value) {
    test_show("assert (%d == %d) FAILED\n", result, value);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<test_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1156 <test_assert+0x36>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb9(%rip),%rdi
call   1030 <test_show@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert>:
mov    %esi,%edx
cmp    %esi,%edi
jne    1127 <test_assert+0x7>
ret
push   %rax
mov    %edi,%esi
lea    0xecf(%rip),%rdi
call   1030 <test_show@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"assert (%d == %d) FAILED\0A\00"
define void @test_assert(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 = icmp ne i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @test_show(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"assert (%d == %d) FAILED\0A\00"
define void @test_assert(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @test_show(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret void
}
void g_param_spec_object() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_object() {
ret void
}
void Default_Handler() {
  while (1) {
    asm("nop");
  }
}


x86 assembly (clang, -O0):
<Default_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_Handler+0x9>
nop
jmp    1109 <Default_Handler+0x9>

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

LLVM IR (-O0):
define void @Default_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Default_Handler() {
br label %1
1: ; preds = %0, %1
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}