xunge/DecIR huggingface dataset:
int re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop)
struct re_pattern_buffer *bufp;
const char *string1, *string2;
int size1, size2;
int pos;
struct re_registers *regs;
int stop;
{
  int result = re_match_2_internal(bufp, string1, size1, string2, size2, pos,
                                   regs, stop);
  return result;
}


x86 assembly (clang, -O0):
<re_match_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%eax
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <re_match_2_internal@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_match_2>:
push   %rax
mov    0x18(%rsp),%r10d
xor    %eax,%eax
push   %r10
push   0x18(%rsp)
call   1030 <re_match_2_internal@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_match_2(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i8* %3, i32 %4, i32 %5, %struct.re_registers* %6, i32 %7) {
%9 = alloca %struct.re_pattern_buffer*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca %struct.re_registers*
%16 = alloca i32
%17 = alloca i32
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %9
store i8* %1, i8** %10
store i32 %2, i32* %11
store i8* %3, i8** %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store %struct.re_registers* %6, %struct.re_registers** %15
store i32 %7, i32* %16
%18 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %9
%19 = load i8*, i8** %10
%20 = load i32, i32* %11
%21 = load i8*, i8** %12
%22 = load i32, i32* %13
%23 = load i32, i32* %14
%24 = load %struct.re_registers*, %struct.re_registers** %15
%25 = load i32, i32* %16
%26 = call i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_match_2_internal to i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %18, i8* %19, i32 %20, i8* %21, i32 %22, i32 %23, %struct.re_registers* %24, i32 %25)
store i32 %26, i32* %17
%27 = load i32, i32* %17
ret i32 %27
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_match_2(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i8* %3, i32 %4, i32 %5, %struct.re_registers* %6, i32 %7) {
%9 = tail call i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_match_2_internal to i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i8* %3, i32 %4, i32 %5, %struct.re_registers* %6, i32 %7)
ret i32 %9
}
char *XmbResetIC() {}


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

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

LLVM IR (-O0):
define i8* @XmbResetIC() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @XmbResetIC() {
ret i8* undef
}
char *http_skip_blank(char *ptr) {
  while (*ptr == ' ')
    ptr++;
  return ptr;
}


x86 assembly (clang, -O0):
<http_skip_blank>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1129 <http_skip_blank+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <http_skip_blank+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_skip_blank>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
je     1110 <http_skip_blank+0x10>
ret

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

LLVM IR (-O2):
define i8* @http_skip_blank(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
void clearArray16(unsigned short array[], int num) {
  int i = 0;
  while (i < num)
    array[i++] = 0;
}


x86 assembly (clang, -O0):
<clearArray16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <clearArray16+0x3b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movw   $0x0,(%rax,%rcx,2)
jmp    1112 <clearArray16+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearArray16>:
test   %esi,%esi
jle    1125 <clearArray16+0x15>
push   %rax
mov    %esi,%edx
add    %rdx,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clearArray16(i16* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i16* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 1
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int EPERM;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int user_add(char *name, char *password) {
  fprintf(stderr, "cannot add new user in single user mode\n");
  return -EPERM;
}


x86 assembly (clang, -O0):
<user_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
mov    0x2e92(%rip),%rcx
sub    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_add>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea3(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"cannot add new user in single user mode\0A\00"
@EPERM = global i32 0
define i32 @user_add(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EPERM
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"cannot add new user in single user mode\0A\00"
@EPERM = global i32 0
define i32 @user_add(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EPERM
%6 = sub nsw i32 0, %5
ret i32 %6
}
char hexdigit(char nybble) {
  if ((0x0 <= nybble) && (nybble <= 0x9)) {
    return '0' + nybble;
  }
  if ((0xA <= nybble) && (nybble <= 0xF)) {
    return 'A' + nybble - 0xA;
  }
  return '?';
}


x86 assembly (clang, -O0):
<hexdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     1134 <hexdigit+0x34>
movsbl -0x2(%rbp),%eax
cmp    $0x9,%eax
jg     1134 <hexdigit+0x34>
movsbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1168 <hexdigit+0x68>
movsbl -0x2(%rbp),%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
jg     1164 <hexdigit+0x64>
movsbl -0x2(%rbp),%eax
cmp    $0xf,%eax
jg     1164 <hexdigit+0x64>
movsbl -0x2(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1168 <hexdigit+0x68>
movb   $0x3f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdigit>:
mov    %edi,%eax
cmp    $0x9,%al
ja     1109 <hexdigit+0x9>
add    $0x30,%al
ret
lea    -0xa(%rax),%ecx
add    $0x37,%al
cmp    $0x6,%cl
movzbl %al,%ecx
mov    $0x3f,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @hexdigit(i8 signext %0) {
%2 = icmp ult i8 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nuw nsw i8 %0, 48
br label %10
5: ; preds = %1
%6 = add i8 %0, -10
%7 = icmp ult i8 %6, 6
%8 = add i8 %0, 55
%9 = select i1 %7, i8 %8, i8 63
br label %10
10: ; preds = %5, %3
%11 = phi i8 [ %4, %3 ], [ %9, %5 ]
ret i8 %11
}
void idebug(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @idebug(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qbbs_logoff();
int /*<<< orphan*/ writeuser(char *);
qbbs_quit() {
  writeuser("Goodbye");
  qbbs_logoff();
}


x86 assembly (clang, -O0):
<qbbs_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <writeuser@plt>
mov    $0x0,%al
call   1040 <qbbs_logoff@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qbbs_quit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <writeuser@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <qbbs_logoff@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Goodbye\00"
define i32 @qbbs_quit() {
%1 = alloca i32
%2 = call i32 @writeuser(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @qbbs_logoff()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"Goodbye\00"
define i32 @qbbs_quit() {
%1 = tail call i32 @writeuser(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @qbbs_logoff()
ret i32 undef
}
/* Variables and functions */
int abs(int);
int cmp(const void *a, const void *b) {
  return abs(*(int *)a) - abs(*(int *)b);
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <abs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
mov    (%rsi),%edx
mov    %edx,%eax
neg    %eax
cmovns %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @abs(i32 %7)
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = call i32 @abs(i32 %11)
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = tail call i32 @llvm.abs.i32(i32 %7, i1 true)
%9 = sub nsw i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int /*<<< orphan*/);
void t_islower_0x00() {
  Assert_real((islower(0) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              5, ("islower should be 0 for 0x00"));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec2(%rip),%rsi
mov    $0x5,%edx
lea    0xf5e(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %edi,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec8(%rip),%rsi
lea    0xf69(%rip),%rcx
mov    $0x5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x00\00"
define void @t_islower_0x00() {
%1 = call i64 @islower(i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x00\00"
define void @t_islower_0x00() {
%1 = tail call i64 @islower(i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void midi_close() {}


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

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

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

LLVM IR (-O2):
define void @midi_close() {
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int hta_string_comp(void *left, void *right) {
  char **l = (char **)left, **r = (char **)right;
  return strcmp(*l, *r);
}


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

x86 assembly (clang, -O2):
<hta_string_comp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @hta_string_comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @hta_string_comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
void ARGBToYJRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToYJRow_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __require_allocated_array(char *);
char *strupr(char *s) {
  __require_allocated_array(s);
  return s;
}


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

x86 assembly (clang, -O2):
<strupr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__require_allocated_array@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
%2 = tail call i32 @__require_allocated_array(i8* %0)
ret i8* %0
}
/* Type definitions */
struct Address {
  int dummy;
};

/* Variables and functions */
size_t address_len(struct Address const *);
struct Address *malloc(size_t);
int /*<<< orphan*/ memcpy(struct Address *, struct Address const *, size_t);
struct Address *copy_address(const struct Address *addr) {
  size_t len = address_len(addr);
  struct Address *new_addr = malloc(len);
  if (new_addr != NULL)
    memcpy(new_addr, addr, len);
  return new_addr;
}


x86 assembly (clang, -O0):
<copy_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <address_len@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1172 <copy_address+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_address>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <address_len@plt>
mov    %rax,%r15
mov    %rax,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115e <copy_address+0x2e>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.Address = type { i32 }
define %struct.Address* @copy_address(%struct.Address* %0) {
%2 = alloca %struct.Address*
%3 = alloca i64
%4 = alloca %struct.Address*
store %struct.Address* %0, %struct.Address** %2
%5 = load %struct.Address*, %struct.Address** %2
%6 = call i64 @address_len(%struct.Address* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = call %struct.Address* @malloc(i64 %7)
store %struct.Address* %8, %struct.Address** %4
%9 = load %struct.Address*, %struct.Address** %4
%10 = icmp ne %struct.Address* %9, null
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load %struct.Address*, %struct.Address** %4
%13 = load %struct.Address*, %struct.Address** %2
%14 = load i64, i64* %3
%15 = call i32 @memcpy(%struct.Address* %12, %struct.Address* %13, i64 %14)
br label %16
16: ; preds = %11, %1
%17 = load %struct.Address*, %struct.Address** %4
ret %struct.Address* %17
}

LLVM IR (-O2):
%struct.Address = type { i32 }
define %struct.Address* @copy_address(%struct.Address* %0) {
%2 = tail call i64 @address_len(%struct.Address* %0)
%3 = tail call %struct.Address* @malloc(i64 %2)
%4 = icmp eq %struct.Address* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @memcpy(%struct.Address* %3, %struct.Address* %0, i64 %2)
br label %7
7: ; preds = %5, %1
ret %struct.Address* %3
}
/* Variables and functions */
void charset_init(bool disable_input, bool disable_output) {
  (void)disable_input;
  (void)disable_output;
}


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

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

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

LLVM IR (-O2):
define void @charset_init(i32 %0, i32 %1) {
ret void
}
void DISPLAYTEXT_new(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_load_ss(void *);
__m128 test_load_ss(void *y) { return _mm_load_ss(y); }


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

x86 assembly (clang, -O2):
<test_load_ss>:
jmp    1030 <_mm_load_ss@plt>

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

LLVM IR (-O2):
define i32 @test_load_ss(i8* %0) {
%2 = tail call i32 @_mm_load_ss(i8* %0)
ret i32 %2
}
/* Variables and functions */
double exp(double);
double __wrap_exp(double x) { return exp(x); }


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

x86 assembly (clang, -O2):
<__wrap_exp>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @__wrap_exp(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ test_oki_adpcm();
int /*<<< orphan*/ test_oki_adpcm_block();
void test_ima_oki_adpcm(void) {
  test_oki_adpcm();
  test_oki_adpcm_block();
}


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

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

LLVM IR (-O0):
define void @test_ima_oki_adpcm() {
%1 = call i32 (...) @test_oki_adpcm()
%2 = call i32 (...) @test_oki_adpcm_block()
ret void
}

LLVM IR (-O2):
define void @test_ima_oki_adpcm() {
%1 = tail call i32 (...) @test_oki_adpcm()
%2 = tail call i32 (...) @test_oki_adpcm_block()
ret void
}
/* Variables and functions */
int rb_scan_args_var_idx(char const *);
int rb_scan_args_trail_idx(const char *fmt) {
  const int idx = rb_scan_args_var_idx(fmt);
  return idx + (fmt[idx] == '*');
}


x86 assembly (clang, -O0):
<rb_scan_args_trail_idx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rb_scan_args_var_idx@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    $0x2a,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_scan_args_trail_idx>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rb_scan_args_var_idx@plt>
cltq
xor    %ecx,%ecx
cmpb   $0x2a,(%rbx,%rax,1)
sete   %cl
add    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rb_scan_args_trail_idx(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @rb_scan_args_var_idx(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 42
%14 = zext i1 %13 to i32
%15 = add nsw i32 %6, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @rb_scan_args_trail_idx(i8* %0) {
%2 = tail call i32 @rb_scan_args_var_idx(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 42
%7 = zext i1 %6 to i32
%8 = add nsw i32 %2, %7
ret i32 %8
}
/* Variables and functions */
char const *add_hash(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
const char *strcache_add(const char *str) { return add_hash(str, strlen(str)); }


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

x86 assembly (clang, -O2):
<strcache_add>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <add_hash@plt>

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

LLVM IR (-O2):
define i8* @strcache_add(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @add_hash(i8* %0, i32 %2)
ret i8* %3
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int sa_family;
};

/* Variables and functions */
#define AF_INET 128
int /*<<< orphan*/ memset(struct sockaddr *, int /*<<< orphan*/, int);
void sock_addrinit(struct sockaddr *addr, int type) {
  switch (type) {
  case AF_INET:
    memset(addr, 0, sizeof(struct sockaddr_in));
    addr->sa_family = type;
    return;
  }
}


x86 assembly (clang, -O0):
<sock_addrinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
jne    114b <sock_addrinit+0x3b>
jmp    1132 <sock_addrinit+0x22>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_addrinit>:
cmp    $0x80,%esi
jne    112f <sock_addrinit+0x1f>
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movl   $0x80,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define void @sock_addrinit(%struct.sockaddr* %0, i32 %1) {
%3 = alloca %struct.sockaddr*
%4 = alloca i32
store %struct.sockaddr* %0, %struct.sockaddr** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %12 [
i32 128, label %6
]
6: ; preds = %2
%7 = load %struct.sockaddr*, %struct.sockaddr** %3
%8 = call i32 @memset(%struct.sockaddr* %7, i32 0, i32 4)
%9 = load i32, i32* %4
%10 = load %struct.sockaddr*, %struct.sockaddr** %3
%11 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %10, i32 0, i32 0
store i32 %9, i32* %11
br label %12
12: ; preds = %6, %2
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define void @sock_addrinit(%struct.sockaddr* %0, i32 %1) {
%3 = icmp eq i32 %1, 128
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @memset(%struct.sockaddr* %0, i32 0, i32 4)
%6 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
store i32 128, i32* %6
br label %7
7: ; preds = %2, %4
ret void
}
void set_le32(void *p, unsigned long n) {
  ((unsigned char *)p)[0] = (unsigned char)n;
  ((unsigned char *)p)[1] = (unsigned char)(n >> 8);
  ((unsigned char *)p)[2] = (unsigned char)(n >> 16);
  ((unsigned char *)p)[3] = (unsigned char)(n >> 24);
}


x86 assembly (clang, -O0):
<set_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @set_le32(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i64, i64* %4
%10 = lshr i64 %9, 8
%11 = trunc i64 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
%14 = load i64, i64* %4
%15 = lshr i64 %14, 16
%16 = trunc i64 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8 %16, i8* %18
%19 = load i64, i64* %4
%20 = lshr i64 %19, 24
%21 = trunc i64 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @set_le32(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
store i8 %3, i8* %0
%4 = lshr i64 %1, 8
%5 = trunc i64 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i64 %1, 16
%8 = trunc i64 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i64 %1, 24
%11 = trunc i64 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
void poke(unsigned int address, unsigned char value) {
  address;
  value;
}


x86 assembly (clang, -O0):
<poke>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @poke(i32 %0, i8 zeroext %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void on_err(char *s) {
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<on_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<on_err>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @on_err(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int unsetenv(char const *);
__attribute__((__weak__, __always___)) int
softboundmpx_unsetenv(const char *name) {
  return unsetenv(name);
}


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

x86 assembly (clang, -O2):
<softboundmpx_unsetenv>:
jmp    1030 <unsetenv@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_unsetenv(i8* %0) {
%2 = tail call i32 @unsetenv(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gdt_init();
int /*<<< orphan*/ idt_init();
int /*<<< orphan*/ pic_init();
int /*<<< orphan*/ tss_init();
void arch_init() {
  gdt_init();
  tss_init();
  pic_init();
  idt_init();
}


x86 assembly (clang, -O0):
<arch_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <gdt_init@plt>
mov    $0x0,%al
call   1040 <tss_init@plt>
mov    $0x0,%al
call   1030 <pic_init@plt>
mov    $0x0,%al
call   1050 <idt_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_init>:
push   %rax
xor    %eax,%eax
call   1060 <gdt_init@plt>
xor    %eax,%eax
call   1040 <tss_init@plt>
xor    %eax,%eax
call   1030 <pic_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <idt_init@plt>

LLVM IR (-O0):
define void @arch_init() {
%1 = call i32 (...) @gdt_init()
%2 = call i32 (...) @tss_init()
%3 = call i32 (...) @pic_init()
%4 = call i32 (...) @idt_init()
ret void
}

LLVM IR (-O2):
define void @arch_init() {
%1 = tail call i32 (...) @gdt_init()
%2 = tail call i32 (...) @tss_init()
%3 = tail call i32 (...) @pic_init()
%4 = tail call i32 (...) @idt_init()
ret void
}
void foo616() {}


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

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

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

LLVM IR (-O2):
define void @foo616() {
ret void
}
/* Type definitions */
typedef union ui_state {
  int dummy;
} ui_state;
typedef union move {
  int dummy;
} move;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void on_worker_reply(union ui_state *state, union move *move) {
  assert("worker reply on main menu?" && 0);
}


x86 assembly (clang, -O0):
<on_worker_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    $0x1,%cl
test   $0x1,%cl
mov    %al,-0x11(%rbp)
jne    1135 <on_worker_reply+0x25>
jmp    113f <on_worker_reply+0x2f>
xor    %eax,%eax
mov    %al,-0x11(%rbp)
jmp    113f <on_worker_reply+0x2f>
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_worker_reply>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
%union.ui_state = type { i32 }
%union.move = type { i32 }
@.str = [27 x i8] c"worker reply on main menu?\00"
define void @on_worker_reply(%union.ui_state* %0, %union.move* %1) {
%3 = alloca %union.ui_state*
%4 = alloca %union.move*
store %union.ui_state* %0, %union.ui_state** %3
store %union.move* %1, %union.move** %4
br i1 true, label %5, label %6
5: ; preds = %2
br label %6
6: ; preds = %5, %2
%7 = phi i1 [ false, %2 ], [ false, %5 ]
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}

LLVM IR (-O2):
%union.ui_state = type { i32 }
%union.move = type { i32 }
define void @on_worker_reply(%union.ui_state* nocapture readnone %0, %union.move* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret void
}
__attribute__((no, noclone)) unsigned short foo8(unsigned short arg) {
  unsigned short ret = 1;
  if (arg + 1 < ((!1) ? -(1 << (sizeof(short) * 8 - 1)) : 0) ||
      arg + 1 > ((!1) ? ((1 << (sizeof(short) * 8 - 1)) - 1)
                      : ((1 << (sizeof(short) * 8)) - 1)))
    return ret;
  arg = arg + 1;
  ret = (unsigned char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo8>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
jl     1133 <foo8+0x33>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0xffff,%eax
jle    1140 <foo8+0x40>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    115e <foo8+0x5e>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movzbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo8>:
inc    %di
mov    $0x1,%eax
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @foo8(i16 zeroext %0) {
%2 = add i16 %0, 1
%3 = icmp eq i16 %0, -1
%4 = select i1 %3, i16 1, i16 %2
ret i16 %4
}
/* Variables and functions */
int rndb();
int rnd_coder(void) {
  return ((((rndb() & 127) * 256 + rndb()) * 256 + rndb()) * 256 + rndb());
}


x86 assembly (clang, -O0):
<rnd_coder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rndb@plt>
and    $0x7f,%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rndb@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rndb@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
shl    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rndb@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd_coder>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <rndb@plt>
mov    %eax,%ebx
and    $0x7f,%ebx
shl    $0x8,%ebx
xor    %eax,%eax
call   1030 <rndb@plt>
mov    %eax,%ebp
add    %ebx,%ebp
shl    $0x8,%ebp
xor    %eax,%eax
call   1030 <rndb@plt>
mov    %eax,%ebx
add    %ebp,%ebx
shl    $0x8,%ebx
xor    %eax,%eax
call   1030 <rndb@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rnd_coder() {
%1 = call i32 (...) @rndb()
%2 = and i32 %1, 127
%3 = mul nsw i32 %2, 256
%4 = call i32 (...) @rndb()
%5 = add nsw i32 %3, %4
%6 = mul nsw i32 %5, 256
%7 = call i32 (...) @rndb()
%8 = add nsw i32 %6, %7
%9 = mul nsw i32 %8, 256
%10 = call i32 (...) @rndb()
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @rnd_coder() {
%1 = tail call i32 (...) @rndb()
%2 = shl i32 %1, 8
%3 = and i32 %2, 32512
%4 = tail call i32 (...) @rndb()
%5 = add nsw i32 %3, %4
%6 = shl nsw i32 %5, 8
%7 = tail call i32 (...) @rndb()
%8 = add nsw i32 %6, %7
%9 = shl nsw i32 %8, 8
%10 = tail call i32 (...) @rndb()
%11 = add nsw i32 %9, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main(int argc, char *argv[]) {
  if (argc > 1) {
    reverse(argv[1]);
    printf("%s\n", argv[1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1161 <main+0x41>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <reverse@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     1143 <main+0x23>
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <reverse@plt>
mov    0x8(%rbx),%rsi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
pop    %rbx
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @reverse(i8* %6)
%8 = load i8*, i8** %5
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %4, %2
ret i32 0
}
int countChars(char *s, char c) {
  return *s == '\0' ? 0 : countChars(s + 1, c) + (*s == c);
}


x86 assembly (clang, -O0):
<countChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113c <countChars+0x2c>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1168 <countChars+0x58>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
movsbl -0x9(%rbp),%esi
call   1030 <countChars@plt>
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
movsbl -0x9(%rbp),%edx
cmp    %edx,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countChars>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <countChars+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <countChars+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @countChars(i8* %0, i8 signext %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* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %23
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %4
%14 = call i32 @countChars(i8* %12, i8 signext %13)
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %17, %19
%21 = zext i1 %20 to i32
%22 = add nsw i32 %14, %21
br label %23
23: ; preds = %10, %9
%24 = phi i32 [ 0, %9 ], [ %22, %10 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @countChars(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i32 [ %12, %5 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = icmp eq i8 %6, %1
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %8, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %16
}
/* Variables and functions */
int hashtab_hash_mode(char *, int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/);
int hashtab_hash(char *key, int nbuck) {
  return hashtab_hash_mode(key, nbuck, 0, 0, 0);
}


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

x86 assembly (clang, -O2):
<hashtab_hash>:
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <hashtab_hash_mode@plt>

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

LLVM IR (-O2):
define i32 @hashtab_hash(i8* %0, i32 %1) {
%3 = tail call i32 @hashtab_hash_mode(i8* %0, i32 %1, i32 0, i32 0, i32 0)
ret i32 %3
}
int ifuncA12345678901234567890(int a, int b) { return a + b + 1; }


x86 assembly (clang, -O0):
<ifuncA12345678901234567890>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifuncA12345678901234567890>:
lea    (%rdi,%rsi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ifuncA12345678901234567890(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @ifuncA12345678901234567890(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = add i32 %3, %1
ret i32 %4
}
void big_delay(void) {
  volatile int count = 1000 * 540;
  while (count--)
    ;
}


x86 assembly (clang, -O0):
<big_delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x83d60,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1124 <big_delay+0x24>
jmp    110b <big_delay+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<big_delay>:
movl   $0x83d60,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
subl   $0x1,-0x4(%rsp)
jae    1110 <big_delay+0x10>
ret

LLVM IR (-O0):
define void @big_delay() {
%1 = alloca i32
store volatile i32 540000, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* %1
%4 = add nsw i32 %3, -1
store volatile i32 %4, i32* %1
%5 = icmp ne i32 %3, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @big_delay() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 540000, i32* %1
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* %1
%5 = add nsw i32 %4, -1
store volatile i32 %5, i32* %1
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_printf_stderr(char *, char const *);
void test_diff_header(const char *left, const char *right) {
  test_printf_stderr("--- %s\n", left);
  test_printf_stderr("+++ %s\n", right);
}


x86 assembly (clang, -O0):
<test_diff_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <test_printf_stderr@plt>
mov    -0x10(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1030 <test_printf_stderr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_diff_header>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <test_printf_stderr@plt>
lea    0xede(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <test_printf_stderr@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"--- %s\0A\00"
@.str.1 = [8 x i8] c"+++ %s\0A\00"
define void @test_diff_header(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 @test_printf_stderr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @test_printf_stderr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"--- %s\0A\00"
@.str.1 = [8 x i8] c"+++ %s\0A\00"
define void @test_diff_header(i8* %0, i8* %1) {
%3 = tail call i32 @test_printf_stderr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @test_printf_stderr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}