xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sigchld_handler(void) {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<sigchld_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <sigchld_handler+0x9>
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    113f <sigchld_handler+0x2f>
jmp    1119 <sigchld_handler+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld_handler>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <sigchld_handler+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @sigchld_handler() {
br label %1
1: ; preds = %5, %0
%2 = load i32, i32* @WNOHANG
%3 = call i64 @waitpid(i32 -1, i32* null, i32 %2)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @sigchld_handler() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @WNOHANG
%3 = tail call i64 @waitpid(i32 -1, i32* null, i32 %2)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
ret void
}
/* Type definitions */
typedef int color;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void SetFcolor(unsigned short int color) {
  SendChar((0XEE) & 0xFF);
  SendChar((0x41) & 0xFF);
  SendChar(((color) >> 8) & 0xFF);
  SendChar((color)&0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<SetFcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x41,%edi
call   1030 <SendChar@plt>
movzwl -0x2(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
movzwl -0x2(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetFcolor>:
push   %rbx
mov    %edi,%ebx
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x41,%edi
call   1030 <SendChar@plt>
mov    %ebx,%edi
shr    $0x8,%edi
call   1030 <SendChar@plt>
movzbl %bl,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
pop    %rbx
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @SetFcolor(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 @SendChar(i32 238)
%4 = call i32 @SendChar(i32 65)
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 @SendChar(i32 %8)
%10 = load i16, i16* %2
%11 = zext i16 %10 to i32
%12 = and i32 %11, 255
%13 = call i32 @SendChar(i32 %12)
%14 = call i32 @SendChar(i32 255)
%15 = call i32 @SendChar(i32 252)
%16 = call i32 @SendChar(i32 255)
%17 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @SetFcolor(i16 zeroext %0) {
%2 = tail call i32 @SendChar(i32 238)
%3 = tail call i32 @SendChar(i32 65)
%4 = zext i16 %0 to i32
%5 = lshr i32 %4, 8
%6 = tail call i32 @SendChar(i32 %5)
%7 = and i32 %4, 255
%8 = tail call i32 @SendChar(i32 %7)
%9 = tail call i32 @SendChar(i32 255)
%10 = tail call i32 @SendChar(i32 252)
%11 = tail call i32 @SendChar(i32 255)
%12 = tail call i32 @SendChar(i32 255)
ret void
}
/* Type definitions */
struct group {
  char *gr_name;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
struct group *getgrgid(int /*<<< orphan*/);
char *get_Groupname(gid_t gid) {
  struct group *grp = getgrgid(gid);
  return grp->gr_name;
}


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

x86 assembly (clang, -O2):
<get_Groupname>:
push   %rax
call   1030 <getgrgid@plt>
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.group = type { i8* }
define i8* @get_Groupname(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.group*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.group* @getgrgid(i32 %4)
store %struct.group* %5, %struct.group** %3
%6 = load %struct.group*, %struct.group** %3
%7 = getelementptr inbounds %struct.group, %struct.group* %6, i32 0, i32 0
%8 = load i8*, i8** %7
ret i8* %8
}

LLVM IR (-O2):
%struct.group = type { i8* }
define i8* @get_Groupname(i32 %0) {
%2 = tail call %struct.group* @getgrgid(i32 %0)
%3 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%4 = load i8*, i8** %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void SendPassword(char *s) {
  char *TmpPtr = s;
  SendChar(20);
  while (*TmpPtr)
    SendChar(*TmpPtr++);
  SendChar(17);
  SendChar(13);
  SendChar(10);
}


x86 assembly (clang, -O0):
<SendPassword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x14,%edi
call   1030 <SendChar@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <SendPassword+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <SendChar@plt>
jmp    112e <SendPassword+0x1e>
mov    $0x11,%edi
call   1030 <SendChar@plt>
mov    $0xd,%edi
call   1030 <SendChar@plt>
mov    $0xa,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SendPassword>:
push   %rbx
mov    %rdi,%rbx
mov    $0x14,%edi
call   1030 <SendChar@plt>
mov    (%rbx),%al
test   %al,%al
je     1143 <SendPassword+0x33>
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <SendChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <SendPassword+0x20>
mov    $0x11,%edi
call   1030 <SendChar@plt>
mov    $0xd,%edi
call   1030 <SendChar@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <SendChar@plt>

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

LLVM IR (-O2):
define void @SendPassword(i8* nocapture %0) {
%2 = tail call i32 @SendChar(i32 20)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %11, %5 ], [ %3, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @SendChar(i32 %9)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = tail call i32 @SendChar(i32 17)
%15 = tail call i32 @SendChar(i32 13)
%16 = tail call i32 @SendChar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void printError(char *msg) { write(2, msg, strlen(msg)); }


x86 assembly (clang, -O0):
<printError>:
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   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printError>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @printError(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 i32 @write(i32 2, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @printError(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
void main() {
  int a;
  a = 23;
  if (a == 23)
    a = 10;
  else
    a = 19;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x17,-0x4(%rbp)
cmpl   $0x17,-0x4(%rbp)
jne    1121 <main+0x21>
movl   $0xa,-0x4(%rbp)
jmp    1128 <main+0x28>
movl   $0x13,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 23, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 23
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 10, i32* %1
br label %6
5: ; preds = %0
store i32 19, i32* %1
br label %6
6: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Type definitions */
struct fix_tag_classifier {
  int dummy;
};

/* Variables and functions */
const struct fix_tag_classifier *get_group_classifier_in_Hop(size_t __tag) {
  (void)__tag;
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.fix_tag_classifier = type { i32 }
define %struct.fix_tag_classifier* @get_group_classifier_in_Hop(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret %struct.fix_tag_classifier* null
}

LLVM IR (-O2):
%struct.fix_tag_classifier = type { i32 }
define noalias %struct.fix_tag_classifier* @get_group_classifier_in_Hop(i64 %0) {
ret %struct.fix_tag_classifier* null
}
/* Type definitions */
struct table_elt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
void remove_from_table(struct table_elt *x, int y) { abort(); }


x86 assembly (clang, -O0):
<remove_from_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<remove_from_table>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.table_elt = type { i32 }
define void @remove_from_table(%struct.table_elt* %0, i32 %1) {
%3 = alloca %struct.table_elt*
%4 = alloca i32
store %struct.table_elt* %0, %struct.table_elt** %3
store i32 %1, i32* %4
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.table_elt = type { i32 }
define void @remove_from_table(%struct.table_elt* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
char *adb_dirstop(char const *);
const char *get_basename(const char *filename) {
  const char *basename = adb_dirstop(filename);
  if (basename) {
    basename++;
    return basename;
  } else {
    return filename;
  }
}


x86 assembly (clang, -O0):
<get_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <adb_dirstop@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114d <get_basename+0x3d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <get_basename+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_basename>:
push   %rbx
mov    %rdi,%rbx
call   1030 <adb_dirstop@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @get_basename(i8* %0) {
%2 = tail call i8* @adb_dirstop(i8* %0)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
bool nrf52_errata_223(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_223() {
ret i32 0
}
int test_imm_4Eint8_mem(signed char *val) {
  return ((*val) & (-0x4E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Eint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffb2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Eint8_mem>:
testb  $0xb2,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Eint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -78
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_4Eint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -78
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fll3(int j, short *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<fll3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movswl (%rcx,%rdx,2),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fll3>:
movswl (%rsi,%rdx,2),%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fll3(i32 %0, i16* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i16*
%6 = alloca i64
store i32 %0, i32* %4
store i16* %1, i16** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i16*, i16** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i16, i16* %8, i64 %9
%11 = load i16, i16* %10
%12 = sext i16 %11 to i32
%13 = add nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @fll3(i32 %0, i16* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i16, i16* %1, i64 %2
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = add nsw i32 %6, %0
ret i32 %7
}
void ramdisk_init() {
  __asm__("mov %%ds,%%bx\n\t"
          "mov %%es,%%dx\n\t"
          "mov $0x10,%%ax\n\t"
          "mov %%ax,%%es\n\t"
          "mov %%ax,%%ds\n\t"
          "cld\n\t"
          "rep\n\t"
          "movsl\n\t"
          "mov %%dx,%%es\n\t"
          "mov %%bx,%%ds\n\t" ::"c"(512000 / 4),
          "D"(0x100000), "S"(0x19000));
}


x86 assembly (clang, -O0):
<ramdisk_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f400,%ecx
mov    $0x100000,%edi
mov    $0x19000,%esi
mov    %ds,%bx
mov    %es,%dx
mov    $0x10,%ax
mov    %eax,%es
mov    %eax,%ds
cld
rep movsl %ds:(%rsi),%es:(%rdi)
mov    %edx,%es
mov    %ebx,%ds
pop    %rbp
ret

x86 assembly (clang, -O2):
<ramdisk_init>:
mov    $0x1f400,%ecx
mov    $0x100000,%edi
mov    $0x19000,%esi
mov    %ds,%bx
mov    %es,%dx
mov    $0x10,%ax
mov    %eax,%es
mov    %eax,%ds
cld
rep movsl %ds:(%rsi),%es:(%rdi)
mov    %edx,%es
mov    %ebx,%ds
ret

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

LLVM IR (-O2):
define void @ramdisk_init() {
tail call void asm sideeffect "mov %ds,%bx\0A\09mov %es,%dx\0A\09mov $$0x10,%ax\0A\09mov %ax,%es\0A\09mov %ax,%ds\0A\09cld\0A\09rep\0A\09movsl\0A\09mov %dx,%es\0A\09mov %bx,%ds\0A\09", "{cx},{di},{si},~{dirflag},~{fpsr},~{flags}"(i32 128000, i32 1048576, i32 102400)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage: fixbrokenfilenames [-d|-r] [-v] [directory]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [52 x i8] c"usage: fixbrokenfilenames [-d|-r] [-v] [directory]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [51 x i8] c"usage: fixbrokenfilenames [-d|-r] [-v] [directory]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
extern void c(void) {}


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

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

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

LLVM IR (-O2):
define void @c() {
ret void
}
void nrerror(char error_text[]) {}


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

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

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

LLVM IR (-O2):
define void @nrerror(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int Kit_TruthWordNum(int);
void Kit_TruthFill(unsigned *pOut, int nVars) {
  int w;
  for (w = Kit_TruthWordNum(nVars) - 1; w >= 0; w--)
    pOut[w] = ~(unsigned)0;
}


x86 assembly (clang, -O0):
<Kit_TruthFill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <Kit_TruthWordNum@plt>
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1154 <Kit_TruthFill+0x44>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <Kit_TruthFill+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kit_TruthFill>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <Kit_TruthWordNum@plt>
test   %eax,%eax
jle    1142 <Kit_TruthFill+0x22>
mov    %eax,%edx
shl    $0x2,%rdx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1030 <memset@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Kit_TruthFill(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @Kit_TruthWordNum(i32 %1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = bitcast i32* %0 to i8*
%7 = zext i32 %3 to i64
%8 = shl nuw nsw i64 %7, 2
br label %9
9: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void EndFunction(FILE *fh) { fprintf(fh, "}\r\n"); }


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

x86 assembly (clang, -O2):
<EndFunction>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"}\0D\0A\00"
define void @EndFunction(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"}\0D\0A\00"
define void @EndFunction(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_log(int, char const *, int, char *);
void roadmap_check_allocated_with_source_line(const char *source, int line,
                                              const void *allocated) {
  if (allocated == NULL) {
    roadmap_log(5, source, line, "no more memory");
  }
}


x86 assembly (clang, -O0):
<roadmap_check_allocated_with_source_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1146 <roadmap_check_allocated_with_source_line+0x36>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x5,%edi
lea    0xebf(%rip),%rcx
call   1030 <roadmap_log@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_check_allocated_with_source_line>:
test   %rdx,%rdx
je     1116 <roadmap_check_allocated_with_source_line+0x6>
ret
mov    %esi,%eax
mov    %rdi,%rsi
lea    0xede(%rip),%rcx
mov    $0x5,%edi
mov    %eax,%edx
jmp    1030 <roadmap_log@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"no more memory\00"
define void @roadmap_check_allocated_with_source_line(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @roadmap_log(i32 5, i8* %10, i32 %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"no more memory\00"
define void @roadmap_check_allocated_with_source_line(i8* %0, i32 %1, i8* readnone %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @roadmap_log(i32 5, i8* %0, i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
long clist_space_available(long requested) { return requested; }


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

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

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

LLVM IR (-O2):
define i64 @clist_space_available(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
scalar_t__ COND_VS();
int /*<<< orphan*/ EA_AY_PI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_svs_8_pi(void) {
  m68ki_write_8(EA_AY_PI_8(), COND_VS() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_svs_8_pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_PI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_VS@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_svs_8_pi>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_PI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_VS@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_svs_8_pi() {
%1 = call i32 (...) @EA_AY_PI_8()
%2 = call i64 (...) @COND_VS()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_svs_8_pi() {
%1 = tail call i32 (...) @EA_AY_PI_8()
%2 = tail call i64 (...) @COND_VS()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_help(char *prog) { printf("%s [-i file] [-o file]\n", prog); }


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

x86 assembly (clang, -O2):
<print_help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"%s [-i file] [-o file]\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"%s [-i file] [-o file]\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ out_bit(int);
void out_bits(int b, int count) {
  int i;
  for (i = 0; i < count; i++)
    out_bit(b);
}


x86 assembly (clang, -O0):
<out_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1147 <out_bits+0x37>
mov    -0x4(%rbp),%edi
call   1030 <out_bit@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <out_bits+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_bits>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112c <out_bits+0x1c>
mov    %esi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <out_bit@plt>
add    $0xffffffff,%ebx
jne    1120 <out_bits+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @out_bits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %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 i32, i32* %3
%12 = call i32 @out_bit(i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @out_bits(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @out_bit(i32 %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int find_char_in_string(char *s, char c) {
  char *p = strchr(s, c);
  return (p) ? (p - s) : -1;
}


x86 assembly (clang, -O0):
<find_char_in_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <find_char_in_string+0x42>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1162 <find_char_in_string+0x52>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1162 <find_char_in_string+0x52>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_char_in_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @find_char_in_string(i8* %0, i8 signext %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
int quan(int val, short *table, int size) {
  int i;
  for (i = 0; i < size; i++)
    if (val < *table++)
      break;
  return (i);
}


x86 assembly (clang, -O0):
<quan>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1156 <quan+0x56>
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x2,%rdx
mov    %rdx,-0x10(%rbp)
movswl (%rcx),%ecx
cmp    %ecx,%eax
jge    1143 <quan+0x43>
jmp    1156 <quan+0x56>
jmp    1148 <quan+0x48>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <quan+0x15>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quan>:
test   %edx,%edx
jle    1121 <quan+0x21>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movswl (%rsi,%rcx,2),%edx
cmp    %edi,%edx
jg     1124 <quan+0x24>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <quan+0x10>
ret
xor    %eax,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @quan(i32 %0, i16* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3, %11
%6 = phi i32 [ %13, %11 ], [ 0, %3 ]
%7 = phi i16* [ %12, %11 ], [ %1, %3 ]
%8 = load i16, i16* %7
%9 = sext i16 %8 to i32
%10 = icmp sgt i32 %9, %0
br i1 %10, label %15, label %11
11: ; preds = %5
%12 = getelementptr inbounds i16, i16* %7, i64 1
%13 = add nuw nsw i32 %6, 1
%14 = icmp eq i32 %13, %2
br i1 %14, label %15, label %5
15: ; preds = %11, %5, %3
%16 = phi i32 [ 0, %3 ], [ %6, %5 ], [ %2, %11 ]
ret i32 %16
}
/* Variables and functions */
int CLOCAL;
int CRTSCTS;
int cFlowControl(int flowcontrol) {
  if (flowcontrol) {
    return (CRTSCTS);
  } else {
    return (CLOCAL);
  }
}


x86 assembly (clang, -O0):
<cFlowControl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1122 <cFlowControl+0x22>
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    112e <cFlowControl+0x2e>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cFlowControl>:
test   %edi,%edi
jne    110e <cFlowControl+0xe>
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@CRTSCTS = global i32 0
@CLOCAL = global i32 0
define i32 @cFlowControl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @CRTSCTS
store i32 %7, i32* %2
br label %10
8: ; preds = %1
%9 = load i32, i32* @CLOCAL
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@CRTSCTS = global i32 0
@CLOCAL = global i32 0
define i32 @cFlowControl(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @CLOCAL
%4 = load i32, i32* @CRTSCTS
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ MHL_HW_Reset();
int /*<<< orphan*/ printk(char *);
void MHD_HW_Reset(void) {
  printk("[SIMG]MHD_HW_Reset == Start == \n");
  MHL_HW_Reset();
  printk("[SIMG] MHD_HW_Reset == End == \n");
}


x86 assembly (clang, -O0):
<MHD_HW_Reset>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printk@plt>
mov    $0x0,%al
call   1040 <MHL_HW_Reset@plt>
lea    0xee3(%rip),%rdi
call   1030 <printk@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MHD_HW_Reset>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
call   1040 <MHL_HW_Reset@plt>
lea    0xee6(%rip),%rdi
pop    %rax
jmp    1030 <printk@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"[SIMG]MHD_HW_Reset == Start == \0A\00"
@.str.1 = [32 x i8] c"[SIMG] MHD_HW_Reset == End == \0A\00"
define void @MHD_HW_Reset() {
%1 = call i32 @printk(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @MHL_HW_Reset()
%3 = call i32 @printk(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"[SIMG]MHD_HW_Reset == Start == \0A\00"
@.str.1 = [32 x i8] c"[SIMG] MHD_HW_Reset == End == \0A\00"
define void @MHD_HW_Reset() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @MHL_HW_Reset()
%3 = tail call i32 @printk(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double glmDotProduct2d(const double v1[2], const double v2[2]) {
  return v1[0] * v2[0] + v1[1] * v2[1];
}


x86 assembly (clang, -O0):
<glmDotProduct2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmDotProduct2d>:
movsd  0x8(%rdi),%xmm1
mulsd  0x8(%rsi),%xmm1
movsd  (%rdi),%xmm0
mulsd  (%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @glmDotProduct2d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
ret double %18
}

LLVM IR (-O2):
define double @glmDotProduct2d(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
ret double %10
}
void srand(unsigned int seed __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @srand(i32 %0) {
ret void
}
/* Variables and functions */
char *getenv(char *);
char *GETENV(char *envstr) {
  char *env = getenv(envstr);
  if (!env)
    return "0";
  else
    return env;
}


x86 assembly (clang, -O0):
<GETENV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1144 <GETENV+0x34>
lea    0xec5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <GETENV+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GETENV>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define i8* @GETENV(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @getenv(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
10: ; preds = %1
%11 = load i8*, i8** %4
store i8* %11, i8** %2
br label %12
12: ; preds = %10, %9
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define i8* @GETENV(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %2
ret i8* %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_read_standard_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(120, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_read_standard_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x78,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_read_standard_Laurent_system>:
mov    $0x78,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syscon_read_standard_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 120, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_read_standard_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 120, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_fast32_t;

/* Variables and functions */
int /*<<< orphan*/ mod_mul(int /*<<< orphan*/, int);
uint_fast32_t mod_mul_x(uint_fast32_t a) { return mod_mul(a, 107374182); }


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

x86 assembly (clang, -O2):
<mod_mul_x>:
mov    $0x6666666,%esi
jmp    1030 <mod_mul@plt>

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

LLVM IR (-O2):
define i32 @mod_mul_x(i32 %0) {
%2 = tail call i32 @mod_mul(i32 %0, i32 107374182)
ret i32 %2
}
/* Variables and functions */
int strlen(char *);
char *tnext(char *p) { return p + strlen(p) + 1; }


x86 assembly (clang, -O0):
<tnext>:
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    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tnext>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @tnext(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 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 1
ret i8* %8
}

LLVM IR (-O2):
define i8* @tnext(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %5
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/ *, int, int /*<<< orphan*/,
            struct timespec const *, int *, int);
int futex(int32_t *uaddr, int op, int32_t val, const struct timespec *timeout,
          int *uaddr2, int val3) {
  return syscall(SYS_futex, uaddr, op, val, timeout, uaddr2, val3);
}


x86 assembly (clang, -O0):
<futex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rdi
mov    (%rdi),%edi
mov    %r9d,(%rsp)
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @futex(i32* %0, i32 %1, i32 %2, %struct.timespec* %3, i32* %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.timespec*
%11 = alloca i32*
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store %struct.timespec* %3, %struct.timespec** %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = load i32, i32* @SYS_futex
%14 = load i32*, i32** %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load %struct.timespec*, %struct.timespec** %10
%18 = load i32*, i32** %11
%19 = load i32, i32* %12
%20 = call i32 @syscall(i32 %13, i32* %14, i32 %15, i32 %16, %struct.timespec* %17, i32* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @futex(i32* %0, i32 %1, i32 %2, %struct.timespec* %3, i32* %4, i32 %5) {
%7 = load i32, i32* @SYS_futex
%8 = tail call i32 @syscall(i32 %7, i32* %0, i32 %1, i32 %2, %struct.timespec* %3, i32* %4, i32 %5)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assertEqual(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ memoryUsage();
int /*<<< orphan*/ serverFree();
void teardown(void) {
  serverFree();
  assertEqual(0, memoryUsage());
}


x86 assembly (clang, -O0):
<teardown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <serverFree@plt>
mov    $0x0,%al
call   1040 <memoryUsage@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1030 <assertEqual@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<teardown>:
push   %rax
xor    %eax,%eax
call   1050 <serverFree@plt>
xor    %eax,%eax
call   1040 <memoryUsage@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assertEqual@plt>

LLVM IR (-O0):
define void @teardown() {
%1 = call i32 (...) @serverFree()
%2 = call i32 (...) @memoryUsage()
%3 = call i32 @assertEqual(i32 0, i32 %2)
ret void
}

LLVM IR (-O2):
define void @teardown() {
%1 = tail call i32 (...) @serverFree()
%2 = tail call i32 (...) @memoryUsage()
%3 = tail call i32 @assertEqual(i32 0, i32 %2)
ret void
}
/* Type definitions */
typedef int u_int8_t;

/* Variables and functions */
int /*<<< orphan*/ SIGTTIN;
scalar_t__ SIG_ERR;
int /*<<< orphan*/ SIG_IGN;
scalar_t__ signal(int /*<<< orphan*/, int /*<<< orphan*/);
u_int8_t __ignore_background_tty_reads() {
  if (signal(SIGTTIN, SIG_IGN) == SIG_ERR) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<__ignore_background_tty_reads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
jne    114b <__ignore_background_tty_reads+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <__ignore_background_tty_reads+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ignore_background_tty_reads>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2ea1(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGTTIN = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
define i32 @__ignore_background_tty_reads() {
%1 = alloca i32
%2 = load i32, i32* @SIGTTIN
%3 = load i32, i32* @SIG_IGN
%4 = call i64 @signal(i32 %2, i32 %3)
%5 = load i64, i64* @SIG_ERR
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@SIGTTIN = global i32 0
@SIG_IGN = global i32 0
@SIG_ERR = global i64 0
define i32 @__ignore_background_tty_reads() {
%1 = load i32, i32* @SIGTTIN
%2 = load i32, i32* @SIG_IGN
%3 = tail call i64 @signal(i32 %1, i32 %2)
%4 = load i64, i64* @SIG_ERR
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  int c;
  if (c)
    exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1130 <main+0x20>
xor    %edi,%edi
call   1030 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}