xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void main() {
  fprintf(stderr,
          " abc "
          "one"
          " cde %s\n",
          "wonder");
  ;
  ;
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c" abc one cde %s\0A\00"
@.str.1 = [7 x i8] c"wonder\00"
define void @main() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c" abc one cde %s\0A\00"
@.str.1 = [7 x i8] c"wonder\00"
define void @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int runCmd(char const **);
int doCapStop(FILE *file, int argc, char **argv) {
  const char *args[] = {"/etc/init.d/bitmeter", "stop", 0};
  return runCmd(args);
}


x86 assembly (clang, -O0):
<doCapStop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2cd6(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cd3(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2cd0(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <runCmd@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doCapStop>:
sub    $0x18,%rsp
mov    0x2cf5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <runCmd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"/etc/init.d/bitmeter\00"
@.str.1 = [5 x i8] c"stop\00"
@__const.doCapStop.args = [3 x i8*] [i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @doCapStop(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca [3 x i8*]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%8 = bitcast [3 x i8*]* %7 to i8*
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %7, i64 0, i64 0
%10 = call i32 @runCmd(i8** %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [21 x i8] c"/etc/init.d/bitmeter\00"
@.str.1 = [5 x i8] c"stop\00"
@__const.doCapStop.args = [3 x i8*] [i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* null]
define i32 @doCapStop(i32* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
%4 = alloca [3 x i8*]
%5 = bitcast [3 x i8*]* %4 to i8*
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%7 = call i32 @runCmd(i8** %6)
ret i32 %7
}
void GPMCECCDisable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x1F4)))) &= (~(0x00000001u));
}


x86 assembly (clang, -O0):
<GPMCECCDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1f4,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCECCDisable>:
add    $0x1f4,%edi
andl   $0xfffffffe,(%rdi)
ret

LLVM IR (-O0):
define void @GPMCECCDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 500
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -2
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @GPMCECCDisable(i32 %0) {
%2 = add i32 %0, 500
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -2
store volatile i32 %6, i32* %4
ret void
}
void acquire_bus(void) {}


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

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

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

LLVM IR (-O2):
define void @acquire_bus() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cta_svd(unsigned char const *, unsigned int, int);
void cta_y420vdb(const unsigned char *x, unsigned int length) {
  cta_svd(x, length, 1);
}


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

x86 assembly (clang, -O2):
<cta_y420vdb>:
mov    $0x1,%edx
jmp    1030 <cta_svd@plt>

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

LLVM IR (-O2):
define void @cta_y420vdb(i8* %0, i32 %1) {
%3 = tail call i32 @cta_svd(i8* %0, i32 %1, i32 1)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Hello");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ Screen;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_Screen_display(void *_p, void *_v) {
  ((Screen *)_p)->display = (Display *)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_Screen_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
unsigned short mem_blk_get_uint16_null(const void *ext, unsigned long addr) {
  return (0);
}


x86 assembly (clang, -O0):
<mem_blk_get_uint16_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @mem_blk_get_uint16_null(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @mem_blk_get_uint16_null(i8* nocapture readnone %0, i64 %1) {
ret i16 0
}
unsigned long namehash(const char *name, int len) {
  return len + ((const unsigned char *)name)[0] +
         ((const unsigned char *)name)[len - 1];
}


x86 assembly (clang, -O0):
<namehash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<namehash>:
movzbl (%rdi),%ecx
movslq %esi,%rax
add    %rax,%rcx
movzbl -0x1(%rax,%rdi,1),%eax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @namehash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = add nsw i32 %5, %9
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = add nsw i32 %10, %17
%19 = sext i32 %18 to i64
ret i64 %19
}

LLVM IR (-O2):
define i64 @namehash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = add nsw i32 %4, %1
%6 = add nsw i32 %1, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = add nsw i32 %5, %10
%12 = sext i32 %11 to i64
ret i64 %12
}
void xbee_clear_cache(void) {}


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

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

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

LLVM IR (-O2):
define void @xbee_clear_cache() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  printf("hello world\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void destory_netstring(char *buffer) { free(buffer); }


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

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

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

LLVM IR (-O2):
define void @destory_netstring(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_BAuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xBA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BAuint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xba,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BAuint64_highword_reg>:
movabs $0xba00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BAuint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 186
%6 = icmp ne i64 %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_BAuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 798863917056
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void firstStatic(void) {}


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

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

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

LLVM IR (-O2):
define void @firstStatic() {
ret void
}
unsigned __str_first_pos(const char *str, char c) {
  unsigned i = 0;
  while (str[i] != '\0') {
    if (str[i] == c)
      return i;
    i++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<__str_first_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1159 <__str_first_pos+0x59>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114b <__str_first_pos+0x4b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <__str_first_pos+0x60>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <__str_first_pos+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__str_first_pos>:
mov    (%rdi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1120 <__str_first_pos+0x20>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,%dl
je     1121 <__str_first_pos+0x21>
add    $0x1,%ecx
movzbl (%rdi,%rcx,1),%edx
test   %dl,%dl
jne    1110 <__str_first_pos+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @__str_first_pos(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %9
%6 = phi i8 [ %13, %9 ], [ %3, %2 ]
%7 = phi i32 [ %10, %9 ], [ 0, %2 ]
%8 = icmp eq i8 %6, %1
br i1 %8, label %15, label %9
9: ; preds = %5
%10 = add i32 %7, 1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %9, %2
%16 = phi i32 [ -1, %2 ], [ -1, %9 ], [ %7, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ test_strv_copy();
int /*<<< orphan*/ test_strv_generic();
int /*<<< orphan*/ test_strv_init();
int /*<<< orphan*/ test_strv_new();
int /*<<< orphan*/ test_strv_op();
int /*<<< orphan*/ test_strv_ref();
int main() {
  test_strv_new();
  test_strv_init();
  test_strv_copy();
  test_strv_ref();
  test_strv_op();
  test_strv_generic();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_strv_new@plt>
mov    $0x0,%al
call   1030 <test_strv_init@plt>
mov    $0x0,%al
call   1040 <test_strv_copy@plt>
mov    $0x0,%al
call   1080 <test_strv_ref@plt>
mov    $0x0,%al
call   1060 <test_strv_op@plt>
mov    $0x0,%al
call   1070 <test_strv_generic@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_strv_new@plt>
xor    %eax,%eax
call   1030 <test_strv_init@plt>
xor    %eax,%eax
call   1040 <test_strv_copy@plt>
xor    %eax,%eax
call   1080 <test_strv_ref@plt>
xor    %eax,%eax
call   1060 <test_strv_op@plt>
xor    %eax,%eax
call   1070 <test_strv_generic@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_strv_new()
%3 = call i32 (...) @test_strv_init()
%4 = call i32 (...) @test_strv_copy()
%5 = call i32 (...) @test_strv_ref()
%6 = call i32 (...) @test_strv_op()
%7 = call i32 (...) @test_strv_generic()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_strv_new()
%2 = tail call i32 (...) @test_strv_init()
%3 = tail call i32 (...) @test_strv_copy()
%4 = tail call i32 (...) @test_strv_ref()
%5 = tail call i32 (...) @test_strv_op()
%6 = tail call i32 (...) @test_strv_generic()
ret i32 0
}
int strcmp1(char *s, char *t) {
  int i;
  for (i = 0; s[i] == t[i]; i++) {
    if (s[i] == '\0')
      return 0;
    return s[i] - t[i];
  }
  return 0;
}


x86 assembly (clang, -O0):
<strcmp1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1176 <strcmp1+0x76>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1154 <strcmp1+0x54>
movl   $0x0,-0x4(%rbp)
jmp    117d <strcmp1+0x7d>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    117d <strcmp1+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp1>:
movsbl (%rdi),%ecx
movsbl (%rsi),%edx
mov    %ecx,%eax
sub    %edx,%eax
xor    %esi,%esi
cmp    %dl,%cl
cmovne %esi,%eax
test   %cl,%cl
cmove  %esi,%eax
ret

LLVM IR (-O0):
define i32 @strcmp1(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %44, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %13, %19
br i1 %20, label %21, label %47
21: ; preds = %7
%22 = load i8*, i8** %4
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %21
store i32 0, i32* %3
br label %48
30: ; preds = %21
%31 = load i8*, i8** %4
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = load i8*, i8** %5
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %37, i64 %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = sub nsw i32 %36, %42
store i32 %43, i32* %3
br label %48
44: ; No predecessors!
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
br label %7
47: ; preds = %7
store i32 0, i32* %3
br label %48
48: ; preds = %47, %30, %29
%49 = load i32, i32* %3
ret i32 %49
}

LLVM IR (-O2):
define i32 @strcmp1(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp ne i8 %3, %5
%8 = icmp eq i8 %3, 0
%9 = or i1 %8, %7
%10 = sub nsw i32 %4, %6
%11 = select i1 %9, i32 0, i32 %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, char const *);
char *strrchr(char const *, char);
int apply_t_mod(const char *path, char *buf, size_t buf_len) {
  char *p = strrchr(path, '/');
  snprintf(buf, buf_len, "%s", (p == NULL) ? path : (p + 1));
  return 0;
}


x86 assembly (clang, -O0):
<apply_t_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116e <apply_t_mod+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    117a <apply_t_mod+0x5a>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rcx
lea    0xe73(%rip),%rdx
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_t_mod>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
lea    0xeb6(%rip),%rdx
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <snprintf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @apply_t_mod(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* %0, i8* %6
%8 = tail call i32 @snprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}
void iwl_print_rx_config_cmd(struct iwl_priv *priv,
                             struct iwl_rxon_context *ctx) {}


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

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

LLVM IR (-O0):
%struct.iwl_priv = type opaque
%struct.iwl_rxon_context = type opaque
define void @iwl_print_rx_config_cmd(%struct.iwl_priv* %0, %struct.iwl_rxon_context* %1) {
%3 = alloca %struct.iwl_priv*
%4 = alloca %struct.iwl_rxon_context*
store %struct.iwl_priv* %0, %struct.iwl_priv** %3
store %struct.iwl_rxon_context* %1, %struct.iwl_rxon_context** %4
ret void
}

LLVM IR (-O2):
%struct.iwl_priv = type opaque
%struct.iwl_rxon_context = type opaque
define void @iwl_print_rx_config_cmd(%struct.iwl_priv* nocapture %0, %struct.iwl_rxon_context* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "klog [-b subbuf_size -n n_subbufs]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"klog [-b subbuf_size -n n_subbufs]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"klog [-b subbuf_size -n n_subbufs]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
double MAP_LOGISTIC(double x_n, int iteration) {
  return ((3.57) * (x_n) * (1.0 - x_n));
}


x86 assembly (clang, -O0):
<MAP_LOGISTIC>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xef4(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAP_LOGISTIC>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  0xef4(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @MAP_LOGISTIC(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = fmul double 3.570000e+00, %5
%7 = load double, double* %3
%8 = fsub double 1.000000e+00, %7
%9 = fmul double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @MAP_LOGISTIC(double %0, i32 %1) {
%3 = fmul double %0, 3.570000e+00
%4 = fsub double 1.000000e+00, %0
%5 = fmul double %3, %4
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_STRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_PRINTABLE_it;
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void ASN1_PRINTABLE_free(ASN1_STRING *a) {
  ASN1_item_free((ASN1_VALUE *)a, &ASN1_PRINTABLE_it);
}


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

x86 assembly (clang, -O2):
<ASN1_PRINTABLE_free>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@ASN1_PRINTABLE_it = global i32 0
define void @ASN1_PRINTABLE_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @ASN1_PRINTABLE_it)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ simple(char *, int, char, double, double);
void test_va_list() { simple("dcff", 3, 'a', 1.999, 42.5); }


x86 assembly (clang, -O0):
<test_va_list>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rdi
mov    $0x3,%esi
mov    $0x61,%edx
movsd  0xed3(%rip),%xmm0
movsd  0xed3(%rip),%xmm1
call   1030 <simple@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_va_list>:
lea    0xef9(%rip),%rdi
movsd  0xee1(%rip),%xmm0
movsd  0xee1(%rip),%xmm1
mov    $0x3,%esi
mov    $0x61,%edx
jmp    1030 <simple@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"dcff\00"
define void @test_va_list() {
%1 = call i32 @simple(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3, i8 signext 97, double 1.999000e+00, double 4.250000e+01)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"dcff\00"
define void @test_va_list() {
%1 = tail call i32 @simple(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3, i8 signext 97, double 1.999000e+00, double 4.250000e+01)
ret void
}
void gdk_screen_get_width() {}


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

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

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

LLVM IR (-O2):
define void @gdk_screen_get_width() {
ret void
}
int DRV_GET_AUTHORITY_VERSION(unsigned char *str, unsigned int len) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @DRV_GET_AUTHORITY_VERSION(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int main() {
  char foo[15];
  char bar[10];
  memcpy(foo, bar, 11);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x13(%rbp),%rdi
lea    -0x1d(%rbp),%rsi
mov    $0xb,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0x19(%rsp),%rdi
lea    0xf(%rsp),%rsi
mov    $0xb,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = call i32 @memcpy(i8* %4, i8* %5, i32 11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i8* %3, i8* %4, i32 11)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ teststr;

/* Variables and functions */
int memcpy(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  unsigned char teststr[] = "Hello, world\n";
  printf("%d", memcpy((unsigned char *)0x400, teststr, sizeof(teststr)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0x12(%rbp),%rsi
mov    $0x400,%edi
mov    $0xe,%edx
call   1040 <memcpy@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0xa646c726f7720,%rax
mov    %rax,0xe(%rsp)
movabs $0x77202c6f6c6c6548,%rax
2c 20 77
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x400,%edi
mov    $0xe,%edx
call   1040 <memcpy@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.teststr = [14 x i8] c"Hello, world\0A\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i8]
store i32 0, i32* %1
%3 = bitcast [14 x i8]* %2 to i8*
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i8* inttoptr (i64 1024 to i8*), i8* %4, i32 14)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.teststr = [14 x i8] c"Hello, world\0A\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = call i32 @memcpy(i8* inttoptr (i64 1024 to i8*), i8* %2, i32 14)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
size_t ft_strlen(const char *str) {
  const char *keep;
  keep = str;
  if (str) {
    while (*keep != '\0')
      ++keep;
    return ((size_t)(keep - str));
  } else
    return (0);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <ft_strlen+0x55>
jmp    1120 <ft_strlen+0x20>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <ft_strlen+0x41>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <ft_strlen+0x20>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    115d <ft_strlen+0x5d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
test   %rdi,%rdi
je     111f <ft_strlen+0x1f>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <ft_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @ft_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %7, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = ptrtoint i8* %4 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
br label %12
12: ; preds = %1, %8
%13 = phi i64 [ %11, %8 ], [ 0, %1 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ outportb(int, unsigned char);
void write_register(unsigned char reg, unsigned char value) {
  outportb(0x70, reg);
  outportb(0x71, value);
}


x86 assembly (clang, -O0):
<write_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x70,%edi
movzbl -0x1(%rbp),%esi
call   1030 <outportb@plt>
mov    $0x71,%edi
movzbl -0x2(%rbp),%esi
call   1030 <outportb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_register>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x70,%edi
call   1030 <outportb@plt>
mov    $0x71,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outportb@plt>

LLVM IR (-O0):
define void @write_register(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @outportb(i32 112, i8 zeroext %5)
%7 = load i8, i8* %4
%8 = call i32 @outportb(i32 113, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @write_register(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @outportb(i32 112, i8 zeroext %0)
%4 = tail call i32 @outportb(i32 113, i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void USBIntUnregister(unsigned long ulBase) {
  ;
  IntDisable(60);
  IntUnregister(60);
}


x86 assembly (clang, -O0):
<USBIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3c,%edi
call   1030 <IntDisable@plt>
mov    $0x3c,%edi
call   1040 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBIntUnregister>:
push   %rax
mov    $0x3c,%edi
call   1030 <IntDisable@plt>
mov    $0x3c,%edi
pop    %rax
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @USBIntUnregister(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @IntDisable(i32 60)
%4 = call i32 @IntUnregister(i32 60)
ret void
}

LLVM IR (-O2):
define void @USBIntUnregister(i64 %0) {
%2 = tail call i32 @IntDisable(i32 60)
%3 = tail call i32 @IntUnregister(i32 60)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putstr(char *);
void delete_char(void) { putstr("\x08 \x08"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"\08 \08\00"
define void @delete_char() {
%1 = tail call i32 @putstr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
void RTUtf16CalcUtf8LenEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUtf16CalcUtf8LenEx() {
ret void
}
int ws(int ch) { return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r'; }


x86 assembly (clang, -O0):
<ws>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <ws+0x3e>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <ws+0x3e>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <ws+0x3e>
cmpl   $0xd,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ws>:
cmp    $0x20,%edi
ja     111d <ws+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    111d <ws+0x1d>
ret
xor    %eax,%eax
cmp    $0xd,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ws(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
unsigned char f88(unsigned char x, long int y) {
  return (x << ((-y) & (8 - 1))) + (x >> y);
}


x86 assembly (clang, -O0):
<f88>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x7,%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f88>:
mov    %esi,%ecx
neg    %cl
and    $0x7,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f88(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = sub nsw i64 0, %7
%9 = and i64 %8, 7
%10 = trunc i64 %9 to i32
%11 = shl i32 %6, %10
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
%16 = ashr i32 %13, %15
%17 = add nsw i32 %11, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @f88(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 0, %4
%6 = and i32 %5, 7
%7 = shl nuw nsw i32 %3, %6
%8 = lshr i32 %3, %4
%9 = add nuw nsw i32 %7, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}
float psnd_sec2chan(float sec, float sw) { return sec * sw + 1; }


x86 assembly (clang, -O0):
<psnd_sec2chan>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xedc(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<psnd_sec2chan>:
mulss  %xmm1,%xmm0
addss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @psnd_sec2chan(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @llvm.fmuladd.f32(float %5, float %6, float 1.000000e+00)
ret float %7
}

LLVM IR (-O2):
define float @psnd_sec2chan(float %0, float %1) {
%3 = tail call float @llvm.fmuladd.f32(float %0, float %1, float 1.000000e+00)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ DelayInit();
int /*<<< orphan*/ OledInit();
void initOled() {
  DelayInit();
  OledInit();
}


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

x86 assembly (clang, -O2):
<initOled>:
push   %rax
xor    %eax,%eax
call   1040 <DelayInit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <OledInit@plt>

LLVM IR (-O0):
define void @initOled() {
%1 = call i32 (...) @DelayInit()
%2 = call i32 (...) @OledInit()
ret void
}

LLVM IR (-O2):
define void @initOled() {
%1 = tail call i32 (...) @DelayInit()
%2 = tail call i32 (...) @OledInit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ wait3(int *, int /*<<< orphan*/, int /*<<< orphan*/ *);
void reapchild(int sig) {
  int status;
  sig = sig;
  while (wait3(&status, WNOHANG, NULL) > 0)
    ;
}


x86 assembly (clang, -O0):
<reapchild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <wait3@plt>
cmp    $0x0,%rax
jle    1146 <reapchild+0x36>
jmp    1121 <reapchild+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reapchild>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
lea    0x4(%rsp),%rbx
mov    (%r14),%esi
mov    %rbx,%rdi
xor    %edx,%edx
call   1030 <wait3@plt>
test   %rax,%rax
jg     1120 <reapchild+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @reapchild(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i64 @wait3(i32* %3, i32 %6, i32* null)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @reapchild(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = load i32, i32* @WNOHANG
%6 = call i64 @wait3(i32* %2, i32 %5, i32* null)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
/* Variables and functions */
short *vrna_pt_snoop_get(char const *);
short *make_pair_table_snoop(const char *structure) {
  return vrna_pt_snoop_get(structure);
}


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

x86 assembly (clang, -O2):
<make_pair_table_snoop>:
jmp    1030 <vrna_pt_snoop_get@plt>

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

LLVM IR (-O2):
define i16* @make_pair_table_snoop(i8* %0) {
%2 = tail call i16* @vrna_pt_snoop_get(i8* %0)
ret i16* %2
}
/* Variables and functions */
int /*<<< orphan*/ write_serial(char);
void serial_print(char *str) {
  char *ptr = str;
  while (*ptr != 0) {
    char c = *ptr;
    write_serial(c);
    ptr++;
  }
}


x86 assembly (clang, -O0):
<serial_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <serial_print+0x47>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%edi
call   1030 <write_serial@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <serial_print+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_print>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <serial_print+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <write_serial@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <serial_print+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @serial_print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @write_serial(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}