xunge/DecIR huggingface dataset:
int strcmp(const char *p, const char *q) {
  for (;;) {
    unsigned char a, b;
    a = *p++;
    b = *q++;
    if (a == 0 || a != b)
      return a - b;
  }
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x0,%eax
je     1151 <strcmp+0x51>
movzbl -0x11(%rbp),%eax
movzbl -0x12(%rbp),%ecx
cmp    %ecx,%eax
je     115d <strcmp+0x5d>
movzbl -0x11(%rbp),%eax
movzbl -0x12(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret
jmp    110c <strcmp+0xc>

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%eax
movzbl (%rsi,%rcx,1),%edx
test   %eax,%eax
je     1124 <strcmp+0x24>
add    $0x1,%rcx
cmp    %dl,%al
je     1110 <strcmp+0x10>
movzbl %dl,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %8, %3 ]
%5 = phi i8* [ %0, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %4
%10 = icmp ne i8 %7, 0
%11 = icmp eq i8 %7, %9
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %3, label %13
13: ; preds = %3
%14 = zext i8 %7 to i32
%15 = zext i8 %9 to i32
%16 = sub nsw i32 %14, %15
ret i32 %16
}
/* Variables and functions */
float atof(char *);
char *strchr(char *, char);
float sqlFloatComma(char **pS) {
  char *s = *pS;
  char *e = strchr(s, ',');
  float ret;
  *e++ = 0;
  *pS = e;
  ret = atof(s);
  return ret;
}


x86 assembly (clang, -O0):
<sqlFloatComma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlFloatComma>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%r14
mov    %r14,%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rax,(%rbx)
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <atof@plt>

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

LLVM IR (-O2):
define float @sqlFloatComma(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 44)
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %3
store i8* %4, i8** %0
%5 = tail call float @atof(i8* %2)
ret float %5
}
/* Variables and functions */
int sqrtf(float);
float test(float f) { return 1 / sqrtf(f); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
call   1030 <sqrtf@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @test(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @sqrtf(float %3)
%5 = sdiv i32 1, %4
%6 = sitofp i32 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @test(float %0) {
%2 = tail call i32 @sqrtf(float %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to float
ret float %6
}
void print_answer_struct(const struct answer *a) {}


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

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

LLVM IR (-O0):
%struct.answer = type opaque
define void @print_answer_struct(%struct.answer* %0) {
%2 = alloca %struct.answer*
store %struct.answer* %0, %struct.answer** %2
ret void
}

LLVM IR (-O2):
%struct.answer = type opaque
define void @print_answer_struct(%struct.answer* nocapture %0) {
ret void
}
void dev_print(struct blk_desc *dev_desc) {}


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

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

LLVM IR (-O0):
%struct.blk_desc = type opaque
define void @dev_print(%struct.blk_desc* %0) {
%2 = alloca %struct.blk_desc*
store %struct.blk_desc* %0, %struct.blk_desc** %2
ret void
}

LLVM IR (-O2):
%struct.blk_desc = type opaque
define void @dev_print(%struct.blk_desc* nocapture %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int pixel;
};
typedef TYPE_1__ XColor;

/* Variables and functions */
int _pixelSort(const void *_arg1, const void *_arg2) {
  return (((XColor *)_arg1)->pixel - ((XColor *)_arg2)->pixel);
}


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

x86 assembly (clang, -O2):
<_pixelSort>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @_pixelSort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.TYPE_2__*
%7 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to %struct.TYPE_2__*
%11 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @_pixelSort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_description(void) {
  printf("    A utility to print data from backup stream files.\n\n"
         "    By default, print backup header and backup trailer,\n"
         "    and give object stats at the end.\n\n"
         "    Optionally print object headers, object metadata,\n"
         "    object key and object data.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [238 x i8] c" A utility to print data from backup stream files.\0A\0A By default, print backup header and backup trailer,\0A and give object stats at the end.\0A\0A Optionally print object headers, object metadata,\0A object key and object data.\0A\0A\00"
define void @print_description() {
%1 = call i32 @printf(i8* getelementptr inbounds ([238 x i8], [238 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [237 x i8] c" A utility to print data from backup stream files.\0A\0A By default, print backup header and backup trailer,\0A and give object stats at the end.\0A\0A Optionally print object headers, object metadata,\0A object key and object data.\0A\00"
define void @print_description() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([237 x i8], [237 x i8]* @str, i64 0, i64 0))
ret void
}
void times2(int n, int *m) { *m = (2 * n); }


x86 assembly (clang, -O0):
<times2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<times2>:
add    %edi,%edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @times2(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 = mul nsw i32 2, %5
%7 = load i32*, i32** %4
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @times2(i32 %0, i32* nocapture writeonly %1) {
%3 = shl nsw i32 %0, 1
store i32 %3, i32* %1
ret void
}
void global_setup() { printf("%s: hello global setup\n", __func__); }


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

x86 assembly (clang, -O2):
<global_setup>:
lea    0xee9(%rip),%rdi
lea    0xefa(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"%s: hello global setup\0A\00"
@__func__.global_setup = [13 x i8] c"global_setup\00"
define void @global_setup() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.global_setup, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"%s: hello global setup\0A\00"
@__func__.global_setup = [13 x i8] c"global_setup\00"
define void @global_setup() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.global_setup, i64 0, i64 0))
ret void
}
/* Variables and functions */
int SPI_NO_CS;
int SPI_getMode(int);
int SPI_setMode(int, int);
int SPI_disableCS(int spidev_fd) {
  int mode = SPI_getMode(spidev_fd);
  if (mode < 0)
    return -1;
  return SPI_setMode(spidev_fd, mode | SPI_NO_CS);
}


x86 assembly (clang, -O0):
<SPI_disableCS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <SPI_getMode@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114c <SPI_disableCS+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <SPI_disableCS+0x43>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2e87(%rip),%rax
or     (%rax),%esi
call   1030 <SPI_setMode@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_disableCS>:
push   %rbx
mov    %edi,%ebx
call   1040 <SPI_getMode@plt>
test   %eax,%eax
js     113f <SPI_disableCS+0x1f>
mov    0x2ead(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <SPI_setMode@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@SPI_NO_CS = global i32 0
define i32 @SPI_disableCS(i32 %0) {
%2 = tail call i32 @SPI_getMode(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @SPI_NO_CS
%6 = or i32 %5, %2
%7 = tail call i32 @SPI_setMode(i32 %0, i32 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
int lge_input_set_touch(void *dev) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lge_input_set_touch(i8* nocapture readnone %0) {
ret i32 0
}
void do_fldz(void *p) {
  asm __volatile__("fninit");
  asm __volatile__("fldz");
  asm __volatile__("fstpl (%0)" : : "r"(p) : "memory");
}


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

x86 assembly (clang, -O2):
<do_fldz>:
fninit
fldz
fstpl  (%rdi)
ret

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

LLVM IR (-O2):
define void @do_fldz(i8* %0) {
tail call void asm sideeffect "fninit", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "fldz", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "fstpl ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
int getValue(void) { return 12345; }


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

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

LLVM IR (-O0):
define i32 @getValue() {
ret i32 12345
}

LLVM IR (-O2):
define i32 @getValue() {
ret i32 12345
}
/* Variables and functions */
int cpuid_eax(int);
int perfmon_available(void) {
  unsigned eax;
  if (cpuid_eax(0) < 10)
    return 0;
  eax = cpuid_eax(10);
  if ((eax & 0xff) == 0)
    return 0;
  return (eax >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<perfmon_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <cpuid_eax@plt>
cmp    $0xa,%eax
jge    1134 <perfmon_available+0x24>
movl   $0x0,-0x4(%rbp)
jmp    116c <perfmon_available+0x5c>
mov    $0xa,%edi
call   1030 <cpuid_eax@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
cmp    $0x0,%eax
jne    115e <perfmon_available+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    116c <perfmon_available+0x5c>
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perfmon_available>:
push   %rbx
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <cpuid_eax@plt>
cmp    $0xa,%eax
jl     1130 <perfmon_available+0x20>
mov    $0xa,%edi
call   1030 <cpuid_eax@plt>
test   %al,%al
je     1130 <perfmon_available+0x20>
movzbl %ah,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @perfmon_available() {
%1 = tail call i32 @cpuid_eax(i32 0)
%2 = icmp slt i32 %1, 10
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i32 @cpuid_eax(i32 10)
%5 = and i32 %4, 255
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = lshr i32 %4, 8
%9 = and i32 %8, 255
br label %10
10: ; preds = %3, %0, %7
%11 = phi i32 [ %9, %7 ], [ 0, %0 ], [ 0, %3 ]
ret i32 %11
}
int SDL_imageFilterBinarizeUsingThresholdMMX(unsigned char *Src1,
                                             unsigned char *Dest,
                                             unsigned int SrcLength,
                                             unsigned char T) {
  return (-1);
}


x86 assembly (clang, -O0):
<SDL_imageFilterBinarizeUsingThresholdMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SDL_imageFilterBinarizeUsingThresholdMMX(i8* %0, i8* %1, i32 %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8 %3, i8* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @SDL_imageFilterBinarizeUsingThresholdMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8 zeroext %3) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ delayMicroseconds(unsigned int);
void wait(int time) { delayMicroseconds((unsigned int)time); }


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

x86 assembly (clang, -O2):
<wait>:
jmp    1030 <delayMicroseconds@plt>

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

LLVM IR (-O2):
define void @wait(i32 %0) {
%2 = tail call i32 @delayMicroseconds(i32 %0)
ret void
}
void someother(void) {}


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

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

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

LLVM IR (-O2):
define void @someother() {
ret void
}
/* Variables and functions */
unsigned int _MM_GET_EXCEPTION_STATE();
unsigned int test_MM_GET_EXCEPTION_STATE() { return _MM_GET_EXCEPTION_STATE(); }


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

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

LLVM IR (-O0):
define i32 @test_MM_GET_EXCEPTION_STATE() {
%1 = call i32 (...) @_MM_GET_EXCEPTION_STATE()
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_MM_GET_EXCEPTION_STATE() {
%1 = tail call i32 (...) @_MM_GET_EXCEPTION_STATE()
ret i32 %1
}
int main(__attribute__((unused)) int argc,
         __attribute__((unused)) char **argv) {
  __asm__("mov $1, %eax\n\t"
          "int $0x80\n\t");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
int    $0x80
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
int    $0x80
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
tail call void asm sideeffect "mov $$1, %eax\0A\09int $$0x80\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Type definitions */
struct btf_type {
  int dummy;
};

/* Variables and functions */
scalar_t__ BTF_KIND_ENUM;
scalar_t__ btf_kind(struct btf_type const *);
bool btf_is_enum(const struct btf_type *t) {
  return btf_kind(t) == BTF_KIND_ENUM;
}


x86 assembly (clang, -O0):
<btf_is_enum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <btf_kind@plt>
mov    0x2ebc(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btf_is_enum>:
push   %rax
call   1030 <btf_kind@plt>
mov    0x2ecb(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.btf_type = type { i32 }
@BTF_KIND_ENUM = global i64 0
define i32 @btf_is_enum(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = call i64 @btf_kind(%struct.btf_type* %3)
%5 = load i64, i64* @BTF_KIND_ENUM
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
@BTF_KIND_ENUM = global i64 0
define i32 @btf_is_enum(%struct.btf_type* %0) {
%2 = tail call i64 @btf_kind(%struct.btf_type* %0)
%3 = load i64, i64* @BTF_KIND_ENUM
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned XXH_versionNumber(void) { return (0 * 100 * 100 + 5 * 100 + 0); }


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

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

LLVM IR (-O0):
define i32 @XXH_versionNumber() {
ret i32 500
}

LLVM IR (-O2):
define i32 @XXH_versionNumber() {
ret i32 500
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int QuitFunc(int argc, char **argv) {
  exit(0);
  return 1;
}


x86 assembly (clang, -O0):
<QuitFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<QuitFunc>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @QuitFunc(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @QuitFunc(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
unsigned long uart_getchar(int);
unsigned long crb_getc(long unit) {
  if (unit != 0)
    return 0x8000000000000000ul;
  return uart_getchar((0x3f8 - 0x2f8));
}


x86 assembly (clang, -O0):
<crb_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113a <crb_getc+0x2a>
movabs $0x8000000000000000,%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <crb_getc+0x38>
mov    $0x100,%edi
call   1030 <uart_getchar@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crb_getc>:
test   %rdi,%rdi
je     1120 <crb_getc+0x10>
movabs $0x8000000000000000,%rax
ret
mov    $0x100,%edi
jmp    1030 <uart_getchar@plt>

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

LLVM IR (-O2):
define i64 @crb_getc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i64 @uart_getchar(i32 256)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ -9223372036854775808, %1 ]
ret i64 %6
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char *strerror(int);
void perror(const char *s) {
  int e = errno;
  fputs(s, stderr);
  fputs(": ", stderr);
  fputs(strerror(e), stderr);
  fputs("\n", stderr);
}


x86 assembly (clang, -O0):
<perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
lea    0xea6(%rip),%rdi
call   1030 <fputs@plt>
mov    -0xc(%rbp),%edi
call   1040 <strerror@plt>
mov    %rax,%rdi
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
lea    0xe7b(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perror>:
push   %rbp
push   %rbx
push   %rax
mov    0x2eae(%rip),%rax
mov    (%rax),%ebp
mov    0x2ead(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xebd(%rip),%rdi
call   1030 <fputs@plt>
mov    %ebp,%edi
call   1040 <strerror@plt>
mov    (%rbx),%esi
mov    %rax,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xea1(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [3 x i8] c": \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @perror(i8* %0) {
%2 = load i32, i32* @errno
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* %0, i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i8* @strerror(i32 %2)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fputs(i8* %7, i32 %8)
%10 = load i32, i32* @stderr
%11 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret void
}
void glFlushMappedBufferRange(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glFlushMappedBufferRange() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _response(char const *);
void _stat_error1_501(void) {
  const char msg[] = "501 Wrong arguments, the filename exists.\r\n";
  _response(msg);
}


x86 assembly (clang, -O0):
<_stat_error1_501>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x2c,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
call   1030 <_response@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_stat_error1_501>:
sub    $0x38,%rsp
movups 0xf01(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <_response@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const._stat_error1_501.msg = [44 x i8] c"501 Wrong arguments, the filename exists.\0D\0A\00"
define void @_stat_error1_501() {
%1 = alloca [44 x i8]
%2 = bitcast [44 x i8]* %1 to i8*
%3 = getelementptr inbounds [44 x i8], [44 x i8]* %1, i64 0, i64 0
%4 = call i32 @_response(i8* %3)
ret void
}

LLVM IR (-O2):
@__const._stat_error1_501.msg = [44 x i8] c"501 Wrong arguments, the filename exists.\0D\0A\00"
define void @_stat_error1_501() {
%1 = alloca [44 x i8]
%2 = getelementptr inbounds [44 x i8], [44 x i8]* %1, i64 0, i64 0
%3 = call i32 @_response(i8* %2)
ret void
}
int int_fetch_xor_acq_rel(int *ptr, int value) {
  return __atomic_fetch_xor(ptr, value, 4);
}


x86 assembly (clang, -O0):
<int_fetch_xor_acq_rel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    %ecx,-0x1c(%rbp)
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x28(%rbp),%rcx
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
xor    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x2c(%rbp)
test   $0x1,%cl
mov    %eax,-0x18(%rbp)
jne    114d <int_fetch_xor_acq_rel+0x4d>
jmp    1124 <int_fetch_xor_acq_rel+0x24>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_fetch_xor_acq_rel>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
xor    %esi,%ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <int_fetch_xor_acq_rel+0x10>
ret

LLVM IR (-O0):
define i32 @int_fetch_xor_acq_rel(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = atomicrmw xor i32* %7, i32 %9 acq_rel
store i32 %10, i32* %6
%11 = load i32, i32* %6
ret i32 %11
}

LLVM IR (-O2):
define i32 @int_fetch_xor_acq_rel(i32* nocapture %0, i32 %1) {
%3 = atomicrmw xor i32* %0, i32 %1 acq_rel
ret i32 %3
}
/* Variables and functions */
void *SHA1(void const *, size_t, void *);
size_t SHA_DIGEST_LENGTH;
void *KDF1_SHA1(const void *in, size_t inlen, void *out, size_t *outlen) {
  if (*outlen < SHA_DIGEST_LENGTH)
    return NULL;
  else
    *outlen = SHA_DIGEST_LENGTH;
  return SHA1(in, inlen, out);
}


x86 assembly (clang, -O0):
<KDF1_SHA1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    0x2eb2(%rip),%rcx
cmp    (%rcx),%rax
jae    114c <KDF1_SHA1+0x3c>
movq   $0x0,-0x8(%rbp)
jmp    1172 <KDF1_SHA1+0x62>
mov    0x2e95(%rip),%rax
mov    (%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <SHA1@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KDF1_SHA1>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rax
cmp    %rax,(%rcx)
jae    1122 <KDF1_SHA1+0x12>
xor    %eax,%eax
ret
mov    %rax,(%rcx)
jmp    1030 <SHA1@plt>

LLVM IR (-O0):
@SHA_DIGEST_LENGTH = global i64 0
define i8* @KDF1_SHA1(i8* %0, i64 %1, i8* %2, i64* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i64* %3, i64** %9
%10 = load i64*, i64** %9
%11 = load i64, i64* %10
%12 = load i64, i64* @SHA_DIGEST_LENGTH
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %4
store i8* null, i8** %5
br label %23
15: ; preds = %4
%16 = load i64, i64* @SHA_DIGEST_LENGTH
%17 = load i64*, i64** %9
store i64 %16, i64* %17
br label %18
18: ; preds = %15
%19 = load i8*, i8** %6
%20 = load i64, i64* %7
%21 = load i8*, i8** %8
%22 = call i8* @SHA1(i8* %19, i64 %20, i8* %21)
store i8* %22, i8** %5
br label %23
23: ; preds = %18, %14
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
@SHA_DIGEST_LENGTH = global i64 0
define i8* @KDF1_SHA1(i8* %0, i64 %1, i8* %2, i64* nocapture %3) {
%5 = load i64, i64* %3
%6 = load i64, i64* @SHA_DIGEST_LENGTH
%7 = icmp ult i64 %5, %6
br i1 %7, label %10, label %8
8: ; preds = %4
store i64 %6, i64* %3
%9 = tail call i8* @SHA1(i8* %0, i64 %1, i8* %2)
br label %10
10: ; preds = %4, %8
%11 = phi i8* [ %9, %8 ], [ null, %4 ]
ret i8* %11
}
int Bematech_FI_LeituraX(Retorno)
int Retorno[3];
{
  char Var;
  return Formata("\x1b|06|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_LeituraX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsbl -0x9(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_LeituraX>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B|06|\1B\00"
define i32 @Bematech_FI_LeituraX(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = load i32*, i32** %2
%7 = call i32 (i8*, i32, i32*, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B|06|\1B\00"
define i32 @Bematech_FI_LeituraX(i32* %0) {
%2 = tail call i32 (i8*, i32, i32*, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i32* %0)
ret i32 %2
}
__attribute__((always_)) void debug_dma_map_sg(struct device *dev,
                                               struct scatterlist *sg,
                                               int nents, int mapped_ents,
                                               int direction) {}


x86 assembly (clang, -O0):
<debug_dma_map_sg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.device = type opaque
%struct.scatterlist = type opaque
define void @debug_dma_map_sg(%struct.device* %0, %struct.scatterlist* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.device*
%7 = alloca %struct.scatterlist*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.device* %0, %struct.device** %6
store %struct.scatterlist* %1, %struct.scatterlist** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
%struct.scatterlist = type opaque
define void @debug_dma_map_sg(%struct.device* nocapture %0, %struct.scatterlist* nocapture %1, i32 %2, i32 %3, i32 %4) {
ret void
}
unsigned umax(unsigned a, unsigned b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<umax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1121 <umax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <umax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<umax>:
mov    %esi,%eax
cmp    %esi,%edi
cmova  %edi,%eax
ret

LLVM IR (-O0):
define i32 @umax(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 ugt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @umax(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int get_kmp_str(char *, int, char *, int);
int /*<<< orphan*/ printf(char *, char *, int);
int main(int argc, char *argv[]) {
  char *l_str = "ABC ABCDAB ABCDABCDABDE";
  char *s_str = "ABCDABD";
  printf("the index of '%s' is %d\n", s_str, get_kmp_str(l_str, 23, s_str, 7));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xed7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x17,%esi
mov    $0x7,%ecx
call   1030 <get_kmp_str@plt>
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xee9(%rip),%rbx
mov    $0x17,%esi
mov    %rbx,%rdx
mov    $0x7,%ecx
call   1030 <get_kmp_str@plt>
lea    0xed8(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"ABC ABCDAB ABCDABCDABDE\00"
@.str.1 = [8 x i8] c"ABCDABD\00"
@.str.2 = [25 x i8] c"the index of '%s' is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @get_kmp_str(i8* %8, i32 23, i8* %9, i32 7)
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %7, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"ABC ABCDAB ABCDABCDABDE\00"
@.str.1 = [8 x i8] c"ABCDABD\00"
@.str.2 = [25 x i8] c"the index of '%s' is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @get_kmp_str(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void remove_pid_file() { remove("/tmp/echod.pid"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"/tmp/echod.pid\00"
define void @remove_pid_file() {
%1 = call i32 @remove(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"/tmp/echod.pid\00"
define void @remove_pid_file() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void strcat() {}


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

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

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

LLVM IR (-O2):
define void @strcat() {
ret void
}
/* Variables and functions */
char *memchr(char const *, int /*<<< orphan*/, size_t);
size_t strnlen(const char *str, size_t maxlen) {
  const char *end = memchr(str, 0, maxlen);
  return end == NULL ? maxlen : (size_t)(end - str);
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114b <strnlen+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    115a <strnlen+0x4a>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i32 0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %4, i64 %1, i64 %7
ret i64 %8
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *duplica_string(char *s) {
  char *p;
  p = malloc(strlen(s) + 1);
  if (p != NULL)
    strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<duplica_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <duplica_string+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<duplica_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <duplica_string+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @duplica_string(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
int test_imm_BEint16_reg(short val) {
  return ((val) & (0xBE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BEint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xbe,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_BEint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 190
%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_BEint16_reg(i16 signext %0) {
%2 = and i16 %0, 190
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printXmlThreeDigits(int *data, unsigned int offset, const char *name) {
  if (offset > 0) {
    printf("%*c", offset, ' ');
  }
  printf("<%s>%i</%s>\n", name, *data, name);
}


x86 assembly (clang, -O0):
<printXmlThreeDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1143 <printXmlThreeDigits+0x33>
mov    -0xc(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x20,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rcx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printXmlThreeDigits>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
test   %esi,%esi
je     1131 <printXmlThreeDigits+0x21>
lea    0xedb(%rip),%rdi
mov    $0x20,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%r14),%edx
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rcx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%*c\00"
@.str.1 = [13 x i8] c"<%s>%i</%s>\0A\00"
define void @printXmlThreeDigits(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = icmp ugt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10, i32 32)
br label %12
12: ; preds = %9, %3
%13 = load i8*, i8** %6
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = load i8*, i8** %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %13, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%*c\00"
@.str.1 = [13 x i8] c"<%s>%i</%s>\0A\00"
define void @printXmlThreeDigits(i32* nocapture %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i32 32)
br label %7
7: ; preds = %5, %3
%8 = load i32, i32* %0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %8, i8* %2)
ret void
}
int do_parity(unsigned int v) {
  v ^= v >> 4;
  v ^= v >> 2;
  v ^= v >> 1;
  return (v ^ 1) & 1;
}


x86 assembly (clang, -O0):
<do_parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x1,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_parity>:
mov    %edi,%eax
shr    $0x4,%eax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    %eax
xor    %ecx,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @do_parity(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 4
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 2
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = lshr i32 %11, 1
%13 = load i32, i32* %2
%14 = xor i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = xor i32 %15, 1
%17 = and i32 %16, 1
ret i32 %17
}

LLVM IR (-O2):
define i32 @do_parity(i32 %0) {
%2 = lshr i32 %0, 4
%3 = xor i32 %2, %0
%4 = lshr i32 %3, 2
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 1
%7 = xor i32 %6, %5
%8 = and i32 %7, 1
%9 = xor i32 %8, 1
ret i32 %9
}