xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ F_WRLCK;
int dolock(int, int /*<<< orphan*/);
int takewritelock(int fd) { return dolock(fd, F_WRLCK); }


x86 assembly (clang, -O0):
<takewritelock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <dolock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<takewritelock>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <dolock@plt>

LLVM IR (-O0):
@F_WRLCK = global i32 0
define i32 @takewritelock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_WRLCK
%5 = call i32 @dolock(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@F_WRLCK = global i32 0
define i32 @takewritelock(i32 %0) {
%2 = load i32, i32* @F_WRLCK
%3 = tail call i32 @dolock(i32 %0, i32 %2)
ret i32 %3
}
hdrawchar_(s) char *s;
{ hdrawchar(*s); }


x86 assembly (clang, -O0):
<hdrawchar_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <hdrawchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdrawchar_>:
movsbl (%rdi),%edi
xor    %eax,%eax
jmp    1030 <hdrawchar@plt>

LLVM IR (-O0):
define i32 @hdrawchar_(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = call i32 (i32, ...) bitcast (i32 (...)* @hdrawchar to i32 (i32, ...)*)(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @hdrawchar_(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @hdrawchar to i32 (i32, ...)*)(i32 %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main() {
  int i;
  for (i = 0; i < 1000; i++) {
    __VERIFIER_assert(i < 2000);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1155 <main+0x45>
cmpl   $0x7d0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <__VERIFIER_assert@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @__VERIFIER_assert(i32 1)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
char *fgets_or_exit(char *buffer, int size, FILE *stream) {
  if (fgets(buffer, size, stream) == NULL) {
    exit(1);
  }
  return buffer;
}


x86 assembly (clang, -O0):
<fgets_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%rax
jne    1157 <fgets_or_exit+0x37>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets_or_exit>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fgets@plt>
test   %rax,%rax
je     1133 <fgets_or_exit+0x13>
mov    %rbx,%rax
pop    %rbx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i8* @fgets_or_exit(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32* @fgets(i8* %7, i32 %8, i32* %9)
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %3
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @fgets_or_exit(i8* returned %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ main();
void _start(void) {
  (void)main();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <main@plt>
jmp    111b <_start+0xb>

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %eax,%eax
call   1030 <main@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <_start+0x10>

LLVM IR (-O0):
define void @_start() {
%1 = call i32 (...) @main()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 (...) @main()
br label %2
2: ; preds = %0, %2
br label %2
}
int utl_peg_wspace(const char *str) {
  int ret = 0;
  while (1) {
    switch (*str) {
    case '\b':
    case '\a':
    case ' ':
    case '\t':
    case '\xA0':
      ret++;
      str++;
      break;
    default:
      return ret;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<utl_peg_wspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
sub    $0xffffffa0,%eax
je     114c <utl_peg_wspace+0x4c>
jmp    1127 <utl_peg_wspace+0x27>
mov    -0x10(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x3,%eax
jb     114c <utl_peg_wspace+0x4c>
jmp    113b <utl_peg_wspace+0x3b>
mov    -0x10(%rbp),%eax
sub    $0x20,%eax
jne    1166 <utl_peg_wspace+0x66>
jmp    114c <utl_peg_wspace+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116b <utl_peg_wspace+0x6b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
jmp    110f <utl_peg_wspace+0xf>

x86 assembly (clang, -O2):
<utl_peg_wspace>:
xor    %eax,%eax
movabs $0x100000380,%rcx
jmp    111a <utl_peg_wspace+0x1a>
xchg   %ax,%ax
bt     %rdx,%rcx
jae    1123 <utl_peg_wspace+0x23>
add    $0x1,%rax
movsbl (%rdi,%rax,1),%edx
cmp    $0x20,%edx
jbe    1110 <utl_peg_wspace+0x10>
cmp    $0xffffffa0,%edx
je     1116 <utl_peg_wspace+0x16>
ret

LLVM IR (-O0):
define i32 @utl_peg_wspace(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %1, %15
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %13 [
i32 8, label %8
i32 7, label %8
i32 32, label %8
i32 9, label %8
i32 -96, label %8
]
8: ; preds = %4, %4, %4, %4, %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %15
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
15: ; preds = %8
br label %4
}

LLVM IR (-O2):
define i32 @utl_peg_wspace(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %9, %7 ]
%4 = phi i32 [ 0, %1 ], [ %8, %7 ]
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
switch i32 %6, label %10 [
i32 8, label %7
i32 7, label %7
i32 32, label %7
i32 9, label %7
i32 -96, label %7
]
7: ; preds = %2, %2, %2, %2, %2
%8 = add nuw nsw i32 %4, 1
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2
ret i32 %4
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t get_flags(void) {
  uint32_t r;
  __asm__ __volatile__("pushf\n"
                       "pop %0\n"
                       : "=r"(r));
  return r;
}


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

x86 assembly (clang, -O2):
<get_flags>:
pushf
pop    %rax
ret

LLVM IR (-O0):
define i8* @get_flags() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "pushf\0Apop $0\0A", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @get_flags() {
%1 = tail call i8* asm sideeffect "pushf\0Apop $0\0A", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, long, char *, long);
void abstract_text___Int_native_int_to_s___impl(long self, char *nstr,
                                                long strlen) {
  snprintf(nstr, strlen, "%ld", self);
}


x86 assembly (clang, -O0):
<abstract_text___Int_native_int_to_s___impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rcx
lea    0xec9(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abstract_text___Int_native_int_to_s___impl>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define void @abstract_text___Int_native_int_to_s___impl(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i64, i64* %4
%10 = call i32 @snprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %9)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @abstract_text___Int_native_int_to_s___impl(i64 %0, i8* %1, i64 %2) {
%4 = tail call i32 @snprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ d2i_of_void;
typedef int /*<<< orphan*/ DSA;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *PEM_ASN1_read_bio(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                      int /*<<< orphan*/ *, void **,
                                      int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ PEM_STRING_PUBLIC;
scalar_t__ d2i_DSA_PUBKEY;
DSA *PEM_read_bio_DSA_PUBKEY(BIO *bp, DSA **x, pem_password_cb *cb, void *u) {
  return PEM_ASN1_read_bio((d2i_of_void *)d2i_DSA_PUBKEY, PEM_STRING_PUBLIC, bp,
                           (void **)x, cb, u);
}


x86 assembly (clang, -O0):
<PEM_read_bio_DSA_PUBKEY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <PEM_ASN1_read_bio@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_bio_DSA_PUBKEY>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <PEM_ASN1_read_bio@plt>

LLVM IR (-O0):
@d2i_DSA_PUBKEY = global i64 0
@PEM_STRING_PUBLIC = global i32 0
define i32* @PEM_read_bio_DSA_PUBKEY(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i64, i64* @d2i_DSA_PUBKEY
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* @PEM_STRING_PUBLIC
%12 = load i32*, i32** %5
%13 = load i32**, i32*** %6
%14 = bitcast i32** %13 to i8**
%15 = load i32*, i32** %7
%16 = load i8*, i8** %8
%17 = call i32* @PEM_ASN1_read_bio(i32* %10, i32 %11, i32* %12, i8** %14, i32* %15, i8* %16)
ret i32* %17
}

LLVM IR (-O2):
@d2i_DSA_PUBKEY = global i64 0
@PEM_STRING_PUBLIC = global i32 0
define i32* @PEM_read_bio_DSA_PUBKEY(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = load i64, i64* @d2i_DSA_PUBKEY
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_PUBLIC
%8 = bitcast i32** %1 to i8**
%9 = tail call i32* @PEM_ASN1_read_bio(i32* %6, i32 %7, i32* %0, i8** %8, i32* %2, i8* %3)
ret i32* %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  if (!(x == 1 || x == 2))
    return 0;
  while (1) {
    if (x == 1)
      x = 2;
    else if (x == 2)
      x = 1;
    assert(x <= 8);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     113b <main+0x2b>
cmpl   $0x2,-0x8(%rbp)
je     113b <main+0x2b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1140 <main+0x30>
cmpl   $0x1,-0x8(%rbp)
jne    1156 <main+0x46>
movl   $0x2,-0x8(%rbp)
jmp    116c <main+0x5c>
cmpl   $0x2,-0x8(%rbp)
jne    1167 <main+0x57>
movl   $0x1,-0x8(%rbp)
jmp    116c <main+0x5c>
cmpl   $0x8,-0x8(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1140 <main+0x30>

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ code;

/* Variables and functions */
int /*<<< orphan*/ __console_write(char const *, int);
void console_darkgreen() {
  static const char code[] = {0x1b, '[', '3', '2', ';', '0', '6', 'm'};
  __console_write(code, sizeof(code));
}


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

x86 assembly (clang, -O2):
<console_darkgreen>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
jmp    1030 <__console_write@plt>

LLVM IR (-O0):
@console_darkgreen.code = internal constant [8 x i8] c"\1B[32;06m"
define void @console_darkgreen() {
%1 = call i32 @__console_write(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @console_darkgreen.code, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@console_darkgreen.code = internal constant [8 x i8] c"\1B[32;06m"
define void @console_darkgreen() {
%1 = tail call i32 @__console_write(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @console_darkgreen.code, i64 0, i64 0), i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Test.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <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 = [7 x i8] c"Test.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"Test.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Delay_100ms();
int /*<<< orphan*/ TWIE_Init(int);
int /*<<< orphan*/ TWIE_Send(int, int, int);
void main() {
  TWIE_Init(100000);
  TWIE_Send(0x1a, 0x03, 0x00);
  TWIE_Send(0x1a, 0x02, 0x00);
  while (1) {
    Delay_100ms();
    TWIE_Send(0x1a, 0x01, 0x00);
    Delay_100ms();
    TWIE_Send(0x1a, 0x01, 0xFF);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x186a0,%edi
call   1050 <TWIE_Init@plt>
mov    $0x1a,%edi
mov    $0x3,%esi
xor    %edx,%edx
call   1040 <TWIE_Send@plt>
mov    $0x1a,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <TWIE_Send@plt>
mov    $0x0,%al
call   1030 <Delay_100ms@plt>
mov    $0x1a,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <TWIE_Send@plt>
mov    $0x0,%al
call   1030 <Delay_100ms@plt>
mov    $0x1a,%edi
mov    $0x1,%esi
mov    $0xff,%edx
call   1040 <TWIE_Send@plt>
jmp    1160 <main+0x30>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x186a0,%edi
call   1050 <TWIE_Init@plt>
mov    $0x1a,%edi
mov    $0x3,%esi
xor    %edx,%edx
call   1040 <TWIE_Send@plt>
mov    $0x1a,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <TWIE_Send@plt>
nopl   (%rax)
xor    %eax,%eax
call   1030 <Delay_100ms@plt>
mov    $0x1a,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <TWIE_Send@plt>
xor    %eax,%eax
call   1030 <Delay_100ms@plt>
mov    $0x1a,%edi
mov    $0x1,%esi
mov    $0xff,%edx
call   1040 <TWIE_Send@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @TWIE_Init(i32 100000)
%2 = call i32 @TWIE_Send(i32 26, i32 3, i32 0)
%3 = call i32 @TWIE_Send(i32 26, i32 2, i32 0)
br label %4
4: ; preds = %0, %4
%5 = call i32 (...) @Delay_100ms()
%6 = call i32 @TWIE_Send(i32 26, i32 1, i32 0)
%7 = call i32 (...) @Delay_100ms()
%8 = call i32 @TWIE_Send(i32 26, i32 1, i32 255)
br label %4
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @TWIE_Init(i32 100000)
%2 = tail call i32 @TWIE_Send(i32 26, i32 3, i32 0)
%3 = tail call i32 @TWIE_Send(i32 26, i32 2, i32 0)
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @Delay_100ms()
%6 = tail call i32 @TWIE_Send(i32 26, i32 1, i32 0)
%7 = tail call i32 (...) @Delay_100ms()
%8 = tail call i32 @TWIE_Send(i32 26, i32 1, i32 255)
br label %4
}
skip_wsp(strptr) char **strptr;
{
  while (isspace(**strptr))
    (*strptr)++;
}


x86 assembly (clang, -O0):
<skip_wsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
je     1147 <skip_wsp+0x37>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <skip_wsp+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_wsp>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
movsbl (%rbx),%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1143 <skip_wsp+0x33>
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,(%r14)
movsbl (%rbx),%edi
call   1030 <isspace@plt>
add    $0x1,%rbx
test   %eax,%eax
jne    1130 <skip_wsp+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @skip_wsp(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = tail call i32 @isspace(i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %1, %7
%8 = phi i8* [ %9, %7 ], [ %2, %1 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = tail call i32 @isspace(i32 %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %1
ret i32 undef
}
/* Variables and functions */
int *mk_dangle();
int main(void) {
  int y __attribute__((unused));
  int *x = mk_dangle();
  y = x[5];
  y = x[-1];
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* (...) @mk_dangle()
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 5
%7 = load i32, i32* %6
store i32 %7, i32* %2
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 -1
%10 = load i32, i32* %9
store i32 %10, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @mk_dangle()
ret i32 0
}
/* Variables and functions */
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ xmousescreen(int);
void basXMouseScreen() {
  int n;
  n = popNumber();
  pushNumber(xmousescreen(n));
}


x86 assembly (clang, -O0):
<basXMouseScreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <xmousescreen@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basXMouseScreen>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <xmousescreen@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basXMouseScreen() {
%1 = alloca i32
%2 = call i32 (...) @popNumber()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @xmousescreen(i32 %3)
%5 = call i32 @pushNumber(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basXMouseScreen() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @xmousescreen(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int main2() {
  initscr();
  printw("Hola linux!");
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initscr@plt>
lea    0xe9e(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main2>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0xea1(%rip),%rdi
call   1040 <printw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hola linux!\00"
define i32 @main2() {
%1 = call i32 (...) @initscr()
%2 = call i32 @printw(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @refresh()
%4 = call i32 (...) @getch()
%5 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hola linux!\00"
define i32 @main2() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @printw(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @refresh()
%4 = tail call i32 (...) @getch()
%5 = tail call i32 (...) @endwin()
ret i32 0
}
void g_markup_parse_context_get_position() {}


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

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

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

LLVM IR (-O2):
define void @g_markup_parse_context_get_position() {
ret void
}
int extract(char *image_data, int data_length, char **message) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @extract(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
ret i32 0
}
gnargs(d) int d;
{
  ot("ldu\t#");
  onum(d);
  nl();
}


x86 assembly (clang, -O0):
<gnargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <onum@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnargs>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1050 <ot@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <onum@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ldu\09#\00"
define i32 @gnargs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @onum to i32 (i32, ...)*)(i32 %5)
%7 = call i32 (...) @nl()
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"ldu\09#\00"
define i32 @gnargs(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @onum to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (...) @nl()
ret i32 undef
}
void test_isupper_macro(void) {
  int i, j;
  for (i = -127; i < 256;)
    j = i, printf("%s: %d -> %d\n", __FUNCTION__, j, isupper(i++) ? 1 : 0);
}


x86 assembly (clang, -O0):
<test_isupper_macro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffff81,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1184 <test_isupper_macro+0x64>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1040 <isupper@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%esi
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%esi
cmovne %eax,%ecx
lea    0xe8f(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <test_isupper_macro+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isupper_macro>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffff81,%ebx
lea    0xecd(%rip),%r14
lea    0xed4(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
call   1040 <isupper@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%ebx
cmp    $0x100,%ebp
jne    1140 <test_isupper_macro+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isupper_macro = [19 x i8] c"test_isupper_macro\00"
define void @test_isupper_macro() {
%1 = alloca i32
%2 = alloca i32
store i32 -127, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = call i32 @isupper(i32 %9)
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.test_isupper_macro, i64 0, i64 0), i32 %8, i32 %14)
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_isupper_macro = [19 x i8] c"test_isupper_macro\00"
define void @test_isupper_macro() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -127, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, 1
%4 = tail call i32 @isupper(i32 %2)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.test_isupper_macro, i64 0, i64 0), i32 %2, i32 %6)
%8 = icmp eq i32 %3, 256
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
void eval_set_alarm_point(const char in[]) {}


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

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

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

LLVM IR (-O2):
define void @eval_set_alarm_point(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chaz_ConfWriter_append_conf(char *);
void chaz_ConfWriter_end_short_names(void) {
  chaz_ConfWriter_append_conf("#endif /* USE_SHORT_NAMES */\n");
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"#endif /* USE_SHORT_NAMES */\0A\00"
define void @chaz_ConfWriter_end_short_names() {
%1 = call i32 @chaz_ConfWriter_append_conf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"#endif /* USE_SHORT_NAMES */\0A\00"
define void @chaz_ConfWriter_end_short_names() {
%1 = tail call i32 @chaz_ConfWriter_append_conf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, size_t);
void file_unmap(void *buf, size_t bufsize) { munmap(buf, bufsize); }


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

x86 assembly (clang, -O2):
<file_unmap>:
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define void @file_unmap(i8* %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 = load i64, i64* %4
%7 = call i32 @munmap(i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @file_unmap(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello word \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <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 word \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = 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 word \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ jhash_3words(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t jhash_2words(uint32_t a, uint32_t b, uint32_t initval) {
  return jhash_3words(a, b, 0, initval);
}


x86 assembly (clang, -O0):
<jhash_2words>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
call   1030 <jhash_3words@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jhash_2words>:
mov    %edx,%ecx
xor    %edx,%edx
jmp    1030 <jhash_3words@plt>

LLVM IR (-O0):
define i32 @jhash_2words(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @jhash_3words(i32 %7, i32 %8, i32 0, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @jhash_2words(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @jhash_3words(i32 %0, i32 %1, i32 0, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ writeDigit(unsigned char);
void writeByte(unsigned char n) {
  writeDigit(n >> 4);
  writeDigit(n & 0x0F);
}


x86 assembly (clang, -O0):
<writeByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
movzbl %al,%edi
call   1030 <writeDigit@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl %al,%edi
call   1030 <writeDigit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeByte>:
push   %rbx
mov    %edi,%ebx
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <writeDigit@plt>
and    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <writeDigit@plt>

LLVM IR (-O0):
define void @writeByte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = trunc i32 %5 to i8
%7 = call i32 @writeDigit(i8 zeroext %6)
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = trunc i32 %10 to i8
%12 = call i32 @writeDigit(i8 zeroext %11)
ret void
}

LLVM IR (-O2):
define void @writeByte(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = tail call i32 @writeDigit(i8 zeroext %2)
%4 = and i8 %0, 15
%5 = tail call i32 @writeDigit(i8 zeroext %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ safe_free(char **);
char *safe_strdup(char const *);
void mutt_str_replace(char **p, const char *s) {
  safe_free(p);
  *p = safe_strdup(s);
}


x86 assembly (clang, -O0):
<mutt_str_replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <safe_free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <safe_strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutt_str_replace>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <safe_free@plt>
mov    %r14,%rdi
call   1030 <safe_strdup@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mutt_str_replace(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 = call i32 @safe_free(i8** %5)
%7 = load i8*, i8** %4
%8 = call i8* @safe_strdup(i8* %7)
%9 = load i8**, i8*** %3
store i8* %8, i8** %9
ret void
}

LLVM IR (-O2):
define void @mutt_str_replace(i8** %0, i8* %1) {
%3 = tail call i32 @safe_free(i8** %0)
%4 = tail call i8* @safe_strdup(i8* %1)
store i8* %4, i8** %0
ret void
}
/* Variables and functions */
int w5100_readSn_byte(unsigned int, int);
unsigned w5100_readSnMR(unsigned sock) {
  return w5100_readSn_byte(sock, 0x0000);
}


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

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

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

LLVM IR (-O2):
define i32 @w5100_readSnMR(i32 %0) {
%2 = tail call i32 @w5100_readSn_byte(i32 %0, i32 0)
ret i32 %2
}
void release_thread(struct task_struct *dead_task) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @release_thread(%struct.task_struct* nocapture %0) {
ret void
}
/* Type definitions */
struct packet_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct packet_t *);
void packet_delete(struct packet_t *p) { free(p); }


x86 assembly (clang, -O0):
<packet_delete>:
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):
<packet_delete>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.packet_t = type { i32 }
define void @packet_delete(%struct.packet_t* %0) {
%2 = alloca %struct.packet_t*
store %struct.packet_t* %0, %struct.packet_t** %2
%3 = load %struct.packet_t*, %struct.packet_t** %2
%4 = call i32 @free(%struct.packet_t* %3)
ret void
}

LLVM IR (-O2):
%struct.packet_t = type { i32 }
define void @packet_delete(%struct.packet_t* nocapture %0) {
%2 = tail call i32 @free(%struct.packet_t* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ window;
};
struct TYPE_4__ {
  TYPE_1__ xmaprequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xmaprequest_window(void *_p) {
  return (unsigned long)((XEvent *)_p)->xmaprequest.window;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xmaprequest_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xmaprequest_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int __attribute__((optimize("Os"), no, noclone)) foo(int a) { return a * a; }


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

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

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void KVfree(void *v, void *ctx) { free(v); }


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

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

LLVM IR (-O0):
define void @KVfree(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 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @KVfree(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i = *((int *)NULL);
  printf("%d\n", i);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vrc6AudioClockTimers();
int /*<<< orphan*/ vrc_irq_cycle();
void vrc6cycle() {
  vrc6AudioClockTimers();
  vrc_irq_cycle();
}


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

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

LLVM IR (-O0):
define void @vrc6cycle() {
%1 = call i32 (...) @vrc6AudioClockTimers()
%2 = call i32 (...) @vrc_irq_cycle()
ret void
}

LLVM IR (-O2):
define void @vrc6cycle() {
%1 = tail call i32 (...) @vrc6AudioClockTimers()
%2 = tail call i32 (...) @vrc_irq_cycle()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void report_bye(char *s) {
  fprintf(stderr, "%s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<report_bye>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<report_bye>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @report_bye(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @report_bye(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void sting_process_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @sting_process_exit() {
ret void
}
int length(char *s) {
  int i = 0;
  while (s[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <length+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <length+0x10>
ret

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

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t bnep_event_service_registered_get_status(const uint8_t *event) {
  return event[2];
}


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

x86 assembly (clang, -O2):
<bnep_event_service_registered_get_status>:
mov    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @bnep_event_service_registered_get_status(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @bnep_event_service_registered_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}