xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __Init_Data();
int /*<<< orphan*/ main();
void Reset_Handler(void) {
  __Init_Data();
  main();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Reset_Handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <__Init_Data@plt>
mov    $0x0,%al
call   1040 <main@plt>
jmp    1132 <Reset_Handler+0x12>

x86 assembly (clang, -O2):
<Reset_Handler>:
push   %rax
xor    %eax,%eax
call   1030 <__Init_Data@plt>
xor    %eax,%eax
call   1040 <main@plt>
nop
jmp    1130 <Reset_Handler+0x10>

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

LLVM IR (-O2):
define void @Reset_Handler() {
%1 = tail call i32 (...) @__Init_Data()
%2 = tail call i32 (...) @main()
br label %3
3: ; preds = %0, %3
br label %3
}
int hash(const char *string) {
  int value = -1;
  int i = 0;
  char c;
  while ((c = string[i]) != '\0') {
    value += (c * i) + c;
    i++;
  }
  return (value % 20);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1152 <hash+0x52>
movsbl -0x11(%rbp),%eax
imul   -0x10(%rbp),%eax
movsbl -0x11(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <hash+0x16>
mov    -0xc(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%dl
test   %dl,%dl
je     1148 <hash+0x48>
mov    $0xffffffff,%eax
xor    %ecx,%ecx
nopl   (%rax)
movsbl %dl,%edx
mov    %ecx,%esi
imul   %edx,%esi
add    %edx,%eax
add    %esi,%eax
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <hash+0x10>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %13, %4 ], [ 0, %1 ]
%6 = phi i8 [ %15, %4 ], [ %2, %1 ]
%7 = phi i32 [ %12, %4 ], [ -1, %1 ]
%8 = sext i8 %6 to i32
%9 = trunc i64 %5 to i32
%10 = mul nsw i32 %9, %8
%11 = add i32 %7, %8
%12 = add i32 %11, %10
%13 = add nuw nsw i64 %5, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4
%18 = srem i32 %12, 20
br label %19
19: ; preds = %17, %1
%20 = phi i32 [ -1, %1 ], [ %18, %17 ]
ret i32 %20
}
int FC(const int row, const int col, const unsigned int filters) {
  return filters >> ((((row) << 1 & 14) + ((col)&1)) << 1) & 3;
}


x86 assembly (clang, -O0):
<FC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
and    $0xe,%ecx
mov    -0x8(%rbp),%edx
and    $0x1,%edx
add    %edx,%ecx
shl    $0x1,%ecx
shr    %cl,%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FC>:
mov    %edx,%eax
and    $0x7,%edi
and    $0x1,%esi
lea    (%rsi,%rdi,2),%ecx
add    %ecx,%ecx
shr    %cl,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @FC(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* %6
%8 = load i32, i32* %4
%9 = shl i32 %8, 1
%10 = and i32 %9, 14
%11 = load i32, i32* %5
%12 = and i32 %11, 1
%13 = add nsw i32 %10, %12
%14 = shl i32 %13, 1
%15 = lshr i32 %7, %14
%16 = and i32 %15, 3
ret i32 %16
}

LLVM IR (-O2):
define i32 @FC(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 1
%5 = and i32 %4, 14
%6 = and i32 %1, 1
%7 = or i32 %5, %6
%8 = shl nuw nsw i32 %7, 1
%9 = lshr i32 %2, %8
%10 = and i32 %9, 3
ret i32 %10
}
/* Type definitions */
struct iter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct iter *);
void iter_dispose(struct iter *i) { free(i); }


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

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

LLVM IR (-O2):
%struct.iter = type { i32 }
define void @iter_dispose(%struct.iter* nocapture %0) {
%2 = tail call i32 @free(%struct.iter* %0)
ret void
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int offset(int /*<<< orphan*/, int, int, int);
int play_attack_defend_n(int, int /*<<< orphan*/, int, int, int, int);
int autohelperowl_attackpat262(struct pattern *patt, int transformation,
                               int move, int color, int action) {
  int a;
  (void)patt;
  (void)color;
  (void)action;
  a = offset(0, -1, move, transformation);
  return play_attack_defend_n(color, 0, 2, move, a, move);
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat262>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1040 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x10(%rbp),%r9d
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <play_attack_defend_n@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat262>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %esi,%ecx
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1040 <offset@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x2,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
mov    %ebp,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <play_attack_defend_n@plt>

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat262(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 0, i32 -1, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %9
%19 = load i32, i32* %8
%20 = load i32, i32* %11
%21 = load i32, i32* %8
%22 = call i32 @play_attack_defend_n(i32 %18, i32 0, i32 2, i32 %19, i32 %20, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat262(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 0, i32 -1, i32 %2, i32 %1)
%7 = tail call i32 @play_attack_defend_n(i32 %3, i32 0, i32 2, i32 %2, i32 %6, i32 %2)
ret i32 %7
}
void XcmsSetWhiteAdjustProc() {}


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

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

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

LLVM IR (-O2):
define void @XcmsSetWhiteAdjustProc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char *, char *, int /*<<< orphan*/);
int startsWith(char *str, char *prefix) {
  return strncmp(str, prefix, strlen(prefix)) == 0;
}


x86 assembly (clang, -O0):
<startsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @startsWith(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 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printString(char const *, int, int);
void sb_printString(char const s[], int x, int y) {
  printString(s, x + 27, y + 9);
}


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

x86 assembly (clang, -O2):
<sb_printString>:
add    $0x1b,%esi
add    $0x9,%edx
jmp    1030 <printString@plt>

LLVM IR (-O0):
define void @sb_printString(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 = add nsw i32 %8, 27
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 9
%12 = call i32 @printString(i8* %7, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @sb_printString(i8* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 27
%5 = add nsw i32 %2, 9
%6 = tail call i32 @printString(i8* %0, i32 %4, i32 %5)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
struct TYPE_4__ {
  TYPE_1__ xcolormap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcolormap_type(void *_p, int _v) {
  ((XEvent *)_p)->xcolormap.type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xcolormap_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xcolormap_type(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 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcolormap_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write(int, char *, int);
__attribute__((noreturn)) void usage(void) {
  write(1,
        "DESCRIPTION:  Simple X toolbar for minimalistic"
        " window managers.\n"
        "USAGE: xstatus [-d DELAY][-f FILE][-h]\n"
        "\t-d DELAY\tSet delay between status updates,"
        " in seconds.\n"
        "\t-f FILE\t\tSet FILE to be continuously polled and"
        " displayed.\n"
        "\t-h\t\tPrint this usage information.\n"
        "Copyright 2017, Jeffrey E. Bedard <jefbed@gmail.com>\n"
        "Project page:  https://github.com/jefbed/xstatus\n",
        sizeof("DESCRIPTION:  Simple X toolbar for minimalistic"
               " window managers.\n"
               "USAGE: xstatus [-d DELAY][-f FILE][-h]\n"
               "\t-d DELAY\tSet delay between status updates,"
               " in seconds.\n"
               "\t-f FILE\t\tSet FILE to be continuously polled and"
               " displayed.\n"
               "\t-h\t\tPrint this usage information.\n"
               "Copyright 2017, Jeffrey E. Bedard <jefbed@gmail.com>\n"
               "Project page:  https://github.com/jefbed/xstatus\n"));
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xed0(%rip),%rsi
mov    $0x166,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [358 x i8] c"DESCRIPTION: Simple X toolbar for minimalistic window managers.\0AUSAGE: xstatus [-d DELAY][-f FILE][-h]\0A\09-d DELAY\09Set delay between status updates, in seconds.\0A\09-f FILE\09\09Set FILE to be continuously polled and displayed.\0A\09-h\09\09Print this usage information.\0ACopyright 2017, Jeffrey E. Bedard <jefbed@gmail.com>\0AProject page: https://github.com/jefbed/xstatus\0A\00"
define void @usage() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([358 x i8], [358 x i8]* @.str, i64 0, i64 0), i32 358)
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [358 x i8] c"DESCRIPTION: Simple X toolbar for minimalistic window managers.\0AUSAGE: xstatus [-d DELAY][-f FILE][-h]\0A\09-d DELAY\09Set delay between status updates, in seconds.\0A\09-f FILE\09\09Set FILE to be continuously polled and displayed.\0A\09-h\09\09Print this usage information.\0ACopyright 2017, Jeffrey E. Bedard <jefbed@gmail.com>\0AProject page: https://github.com/jefbed/xstatus\0A\00"
define void @usage() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([358 x i8], [358 x i8]* @.str, i64 0, i64 0), i32 358)
%2 = tail call i32 @exit(i32 1)
unreachable
}
int foo(char x[]) { x[0] = 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movb   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @foo(i8* nocapture writeonly %0) {
store i8 1, i8* %0
ret i32 undef
}
void Init_WMOPS_counter(void) {}


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

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

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

LLVM IR (-O2):
define void @Init_WMOPS_counter() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XColormapEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XColormapEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XColormapEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XColormapEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XColormapEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XColormapEvent>:
test   %rdi,%rdi
je     112a <free_XColormapEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XColormapEvent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XColormapEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
void sdb_init_sqlite3(void) { ; }


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

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

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

LLVM IR (-O2):
define void @sdb_init_sqlite3() {
ret void
}
unsigned char f88(unsigned char x, unsigned 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 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
}
void caa(int a, int b, int c) {}


x86 assembly (clang, -O0):
<caa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @caa(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
ret void
}

LLVM IR (-O2):
define void @caa(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ output_byte(int);
void emit_fpop(void) {
  assem_debug("fpop");
  output_byte(0xdd);
  output_byte(0xd8);
}


x86 assembly (clang, -O0):
<emit_fpop>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xdd,%edi
call   1040 <output_byte@plt>
mov    $0xd8,%edi
call   1040 <output_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fpop>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xdd,%edi
call   1040 <output_byte@plt>
mov    $0xd8,%edi
pop    %rax
jmp    1040 <output_byte@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"fpop\00"
define void @emit_fpop() {
%1 = call i32 @assem_debug(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_byte(i32 221)
%3 = call i32 @output_byte(i32 216)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"fpop\00"
define void @emit_fpop() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_byte(i32 221)
%3 = tail call i32 @output_byte(i32 216)
ret void
}
void android_joypad_poll(void) {}


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

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

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

LLVM IR (-O2):
define void @android_joypad_poll() {
ret void
}
void cafebabe_constant_info_string_deinit(
    struct cafebabe_constant_info_string *str) {}


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

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

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

LLVM IR (-O2):
%struct.cafebabe_constant_info_string = type opaque
define void @cafebabe_constant_info_string_deinit(%struct.cafebabe_constant_info_string* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ console_puts(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void console_cur_down(int n) {
  char buf[32] = "\033[B";
  if (n)
    snprintf(buf, sizeof(buf), "\033[%dB", n);
  console_puts(buf);
}


x86 assembly (clang, -O0):
<console_cur_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec5(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1179 <console_cur_down+0x59>
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x20,%esi
lea    0xeac(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <console_puts@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_cur_down>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
test   %edi,%edi
je     1155 <console_cur_down+0x35>
mov    %edi,%ecx
lea    0xed8(%rip),%rdx
mov    %rsp,%rdi
mov    $0x20,%esi
call   1040 <snprintf@plt>
mov    %rsp,%rdi
call   1030 <console_puts@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.console_cur_down.buf = [32 x i8] c"\1B[B\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [6 x i8] c"\1B[%dB\00"
define void @console_cur_down(i32 %0) {
%2 = alloca i32
%3 = alloca [32 x i8]
store i32 %0, i32* %2
%4 = bitcast [32 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 @snprintf(i8* %8, i32 32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%13 = call i32 @console_puts(i8* %12)
ret void
}

LLVM IR (-O2):
@__const.console_cur_down.buf = [32 x i8] c"\1B[B\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [6 x i8] c"\1B[%dB\00"
define void @console_cur_down(i32 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @snprintf(i8* %3, i32 32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %1
%8 = call i32 @console_puts(i8* %3)
ret void
}
const char *pathconN_nm3_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathconN_nm3_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <pathconN_nm3_name_out+0x2b>
jmp    111a <pathconN_nm3_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <pathconN_nm3_name_out+0x3b>
jmp    114b <pathconN_nm3_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathconN_nm3_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathconN_nm3_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm3_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathconN_nm3_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathconN_nm3_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int a, b;
  a = -3 - -3;
  b = -3 - -(-3);
  printf("a = %d b = %d", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffffa,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecd(%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
xor    %esi,%esi
mov    $0xfffffffa,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"a = %d b = %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0, i32 -6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t h264avcc_get_profile(const uint8_t *p) { return p[1]; }


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

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

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

LLVM IR (-O2):
define i32 @h264avcc_get_profile(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
ret i32 %3
}
int cable_get_accessory_type(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @cable_get_accessory_type() {
ret i32 0
}

LLVM IR (-O2):
define i32 @cable_get_accessory_type() {
ret i32 0
}
/* Variables and functions */
char *_dup_str_n(char const *, size_t);
extern char *cfustring_dup_c_str_n(const char *str, size_t n) {
  return _dup_str_n(str, n);
}


x86 assembly (clang, -O0):
<cfustring_dup_c_str_n>:
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 <_dup_str_n@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfustring_dup_c_str_n>:
jmp    1030 <_dup_str_n@plt>

LLVM IR (-O0):
define i8* @cfustring_dup_c_str_n(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 i8* @_dup_str_n(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @cfustring_dup_c_str_n(i8* %0, i64 %1) {
%3 = tail call i8* @_dup_str_n(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ M68NTfix();
int /*<<< orphan*/ Sync();
void StateRestore(int version) {
  Sync();
  M68NTfix();
}


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

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

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

LLVM IR (-O2):
define void @StateRestore(i32 %0) {
%2 = tail call i32 (...) @Sync()
%3 = tail call i32 (...) @M68NTfix()
ret void
}
void DoNothing() { ; }


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

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

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

LLVM IR (-O2):
define void @DoNothing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ z80_ed_45_retn();
void z80_ed_75_retn(void) { z80_ed_45_retn(); }


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

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

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

LLVM IR (-O2):
define void @z80_ed_75_retn() {
%1 = tail call i32 (...) @z80_ed_45_retn()
ret void
}
int rangeIntersection(int start1, int end1, int start2, int end2) {
  int s = ((start1) < (start2) ? (start2) : (start1));
  int e = ((end1) > (end2) ? (end2) : (end1));
  return e - s;
}


x86 assembly (clang, -O0):
<rangeIntersection>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1127 <rangeIntersection+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    112d <rangeIntersection+0x2d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    114a <rangeIntersection+0x4a>
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1150 <rangeIntersection+0x50>
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rangeIntersection>:
mov    %esi,%eax
cmp    %edx,%edi
cmovl  %edx,%edi
cmp    %ecx,%esi
cmovg  %ecx,%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @rangeIntersection(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %4
%15 = load i32, i32* %7
br label %18
16: ; preds = %4
%17 = load i32, i32* %5
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
store i32 %19, i32* %9
%20 = load i32, i32* %6
%21 = load i32, i32* %8
%22 = icmp sgt i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = load i32, i32* %8
br label %27
25: ; preds = %18
%26 = load i32, i32* %6
br label %27
27: ; preds = %25, %23
%28 = phi i32 [ %24, %23 ], [ %26, %25 ]
store i32 %28, i32* %10
%29 = load i32, i32* %10
%30 = load i32, i32* %9
%31 = sub nsw i32 %29, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @rangeIntersection(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = icmp sgt i32 %1, %3
%8 = select i1 %7, i32 %3, i32 %1
%9 = sub nsw i32 %8, %6
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ do_qemu_set_log(int, int);
void qemu_set_log(int log_flags) { do_qemu_set_log(log_flags, false); }


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

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

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

LLVM IR (-O2):
define void @qemu_set_log(i32 %0) {
%2 = tail call i32 @do_qemu_set_log(i32 %0, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strdup(const char *s) {
  if (!s)
    return NULL;
  size_t len = strlen(s);
  char *r = (char *)malloc(len);
  if (!r) {
    return NULL;
  }
  strncpy(r, s, len);
  return r;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    119f <strdup+0x6f>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1186 <strdup+0x56>
movq   $0x0,-0x8(%rbp)
jmp    119f <strdup+0x6f>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1165 <strdup+0x35>
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %rax,%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     1165 <strdup+0x35>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
jmp    1167 <strdup+0x37>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @strncpy(i8* %6, i8* %0, i64 %4)
br label %10
10: ; preds = %8, %3, %1
%11 = phi i8* [ null, %1 ], [ %6, %8 ], [ null, %3 ]
ret i8* %11
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", getpid()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int slength(char *v) { return strlen(v); }


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

x86 assembly (clang, -O2):
<slength>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @slength(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Type definitions */
struct spwd {
  int /*<<< orphan*/ sp_pwdp;
};

/* Variables and functions */
struct spwd *getspnam(char *);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
void main() {
  struct spwd *spw;
  spw = getspnam("");
  puts(spw->sp_pwdp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <getspnam@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <getspnam@plt>
mov    (%rax),%edi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.spwd = type { i32 }
@.str = [1 x i8] zeroinitializer
define void @main() {
%1 = alloca %struct.spwd*
%2 = call %struct.spwd* @getspnam(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store %struct.spwd* %2, %struct.spwd** %1
%3 = load %struct.spwd*, %struct.spwd** %1
%4 = getelementptr inbounds %struct.spwd, %struct.spwd* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @puts(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.spwd = type { i32 }
@.str = [1 x i8] zeroinitializer
define void @main() {
%1 = tail call %struct.spwd* @getspnam(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = getelementptr inbounds %struct.spwd, %struct.spwd* %1, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @puts(i32 %3)
ret void
}
int sgnCmp(float a, float b) { return a * b >= 0; }


x86 assembly (clang, -O0):
<sgnCmp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgnCmp>:
mulss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @sgnCmp(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 = fmul float %5, %6
%8 = fcmp oge float %7, 0.000000e+00
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @sgnCmp(float %0, float %1) {
%3 = fmul float %0, %1
%4 = fcmp oge float %3, 0.000000e+00
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ u_char_width(int /*<<< orphan*/);
int /*<<< orphan*/ u_str_get_char(unsigned char const *, long *);
unsigned int u_str_width(const unsigned char *str) {
  long i = 0, w = 0;
  while (str[i])
    w += u_char_width(u_str_get_char(str, &i));
  return w;
}


x86 assembly (clang, -O0):
<u_str_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116f <u_str_width+0x4f>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <u_str_get_char@plt>
mov    %eax,%edi
call   1030 <u_char_width@plt>
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    113c <u_str_width+0x1c>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_str_width>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
cmpb   $0x0,(%rdi)
je     1173 <u_str_width+0x53>
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0x8(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <u_str_get_char@plt>
mov    %eax,%edi
call   1030 <u_char_width@plt>
add    %rax,%rbx
mov    0x8(%rsp),%rax
cmpb   $0x0,(%r14,%rax,1)
jne    1150 <u_str_width+0x30>
jmp    1175 <u_str_width+0x55>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @u_str_width(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %1, %6
%7 = phi i64 [ %10, %6 ], [ 0, %1 ]
%8 = call i32 @u_str_get_char(i8* %0, i64* %2)
%9 = call i64 @u_char_width(i32 %8)
%10 = add nsw i64 %9, %7
%11 = load i64, i64* %2
%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 %6
15: ; preds = %6
%16 = trunc i64 %10 to i32
br label %17
17: ; preds = %15, %1
%18 = phi i32 [ 0, %1 ], [ %16, %15 ]
ret i32 %18
}
void vc0321_shutdown(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @vc0321_shutdown(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Variables and functions */
int execv(const char *file, char *const argv[], ...) {}


x86 assembly (clang, -O0):
<execv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @execv(i8* nocapture readnone %0, i8** nocapture readnone %1, ...) {
ret i32 undef
}
int compare_int_ptr(const void *p1, const void *p2) {
  int v1 = *((int *)p1);
  int v2 = *((int *)p2);
  if (v1 < v2)
    return -1;
  if (v1 > v2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compare_int_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <compare_int_ptr+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <compare_int_ptr+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <compare_int_ptr+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <compare_int_ptr+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int_ptr>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_int_ptr(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}