xunge/DecIR huggingface dataset:
void INT_Excep_MTU6_TGIA6(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU6_TGIA6() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RevoCalibrationHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void RevoCalibrationUpdated() { UAVObjUpdated(RevoCalibrationHandle()); }


x86 assembly (clang, -O0):
<RevoCalibrationUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <RevoCalibrationHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RevoCalibrationUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <RevoCalibrationHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @RevoCalibrationUpdated() {
%1 = call i32 (...) @RevoCalibrationHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @RevoCalibrationUpdated() {
%1 = tail call i32 (...) @RevoCalibrationHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
int test_imm_3Dint32_reg(int val) { return ((val) & (0x3D << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_3Dint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x3d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Dint32_reg>:
test   $0x3d,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Dint32_reg(i32 %0) {
%2 = and i32 %0, 61
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void task_io_accounting_init(struct task_io_accounting *ioac) {}


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

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

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

LLVM IR (-O2):
%struct.task_io_accounting = type opaque
define void @task_io_accounting_init(%struct.task_io_accounting* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  char abjad;
  int nilai;
  short int angka;
  long int dana_hibah;
  unsigned short int berat_badan;
  unsigned long int anggaran_daerah;
  unsigned int harga_buku;
  float hasil;
  double panjang;
  long double lebar;
  system("PAUSE");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"PAUSE\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
%8 = alloca i16
%9 = alloca i64
%10 = alloca i16
%11 = alloca i64
%12 = alloca i32
%13 = alloca float
%14 = alloca double
%15 = alloca x86_fp80
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"PAUSE\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char);
char *ltrim(char *str) {
  while (isspace(*str))
    str++;
  return str;
}


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

x86 assembly (clang, -O2):
<ltrim>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <ltrim+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ltrim(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 = call i64 @isspace(i8 signext %5)
%7 = icmp ne i64 %6, 0
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* @ltrim(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_header(void) { printf("Content-Type: text/html\n\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Content-Type: text/html\0A\0A\00"
define void @print_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Content-Type: text/html\0A\00"
define void @print_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ dlclose(void *);
int dynload_close(void *handle) { return dlclose(handle) == 0; }


x86 assembly (clang, -O0):
<dynload_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <dlclose@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynload_close>:
push   %rax
call   1030 <dlclose@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dynload_close(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @dlclose(i8* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @dynload_close(i8* %0) {
%2 = tail call i64 @dlclose(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tester() { printf("tester in action\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"tester in action\0A\00"
define void @tester() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"tester in action\00"
define void @tester() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
int bitor_funktion(int var1, int var2) { return (var1 | var2); }


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

x86 assembly (clang, -O2):
<bitor_funktion>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @bitor_funktion(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 = or i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bitor_funktion(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
int Tcl_CommandComplete(cmd)
char *cmd;
{
  char *p;
  if (*cmd == 0) {
    return 1;
  }
  p = ScriptEnd(cmd, cmd + strlen(cmd), 0);
  return (*p != 0);
}


x86 assembly (clang, -O0):
<Tcl_CommandComplete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1148 <Tcl_CommandComplete+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1190 <Tcl_CommandComplete+0x70>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdi
add    %rax,%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <ScriptEnd@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tcl_CommandComplete>:
push   %rbx
cmpb   $0x0,(%rdi)
je     114b <Tcl_CommandComplete+0x2b>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    (%rax,%rbx,1),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <ScriptEnd@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
setne  %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Tcl_CommandComplete(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%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 = %1
store i32 1, i32* %2
br label %24
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %3
%14 = call i64 @strlen(i8* %13)
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @ScriptEnd to i32 (i8*, i8*, i32, ...)*)(i8* %11, i8* %15, i32 0)
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %4
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i32
store i32 %23, i32* %2
br label %24
24: ; preds = %10, %9
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @Tcl_CommandComplete(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = tail call i64 @strlen(i8* %0)
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @ScriptEnd to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %6, i32 0)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %1, %4
%14 = phi i32 [ %12, %4 ], [ 1, %1 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ plazaui_async_cmd_clear();
void interrupt_handler(int signum) { plazaui_async_cmd_clear(); }


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

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

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

LLVM IR (-O2):
define void @interrupt_handler(i32 %0) {
%2 = tail call i32 (...) @plazaui_async_cmd_clear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void dropData() {
  int a = 0x1234;
  int *p = &a;
  char *p1 = &a;
  printf("p = %x\n", *p);
  printf("p = %x\n", *p1);
}


x86 assembly (clang, -O0):
<dropData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1234,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
lea    0xec4(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
lea    0xeb1(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dropData>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x34,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x34,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"p = %x\0A\00"
define void @dropData() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i8*
store i32 4660, i32* %1
store i32* %1, i32** %2
%4 = bitcast i32* %1 to i8*
store i8* %4, i8** %3
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = trunc i32 %6 to i8
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"p = %x\0A\00"
define void @dropData() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext 52)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext 52)
ret void
}
/* Variables and functions */
void send_statistics(const char *action, const char *action_result,
                     const char *action_data) {
  (void)action;
  (void)action_result;
  (void)action_data;
  return;
}


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

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

LLVM IR (-O0):
define void @send_statistics(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
define void @send_statistics(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 0; i <= 256; i++) {
    printf("%d - %c\n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x101,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d - %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 257
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, scalar_t__,
                           char *);
int /*<<< orphan*/ stderr;
char *strerror(scalar_t__);
void ordie(char *info) {
  if (errno != 0) {
    fprintf(stderr, "%s [errno=%d]: %s\n", info, errno, strerror(errno));
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<ordie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
cmpq   $0x0,(%rax)
je     11a6 <ordie+0x76>
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e70(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e62(%rip),%rax
mov    (%rax),%rdi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    %rax,%r8
lea    0xe6d(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ordie>:
push   %rbp
push   %r14
push   %rbx
mov    0x2e9d(%rip),%rax
mov    (%rax),%rbx
test   %rbx,%rbx
jne    1148 <ordie+0x18>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rdi,%r14
mov    0x2e8e(%rip),%rax
mov    (%rax),%ebp
mov    %rbx,%rdi
call   1050 <strerror@plt>
lea    0xe9d(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    %rax,%r8
call   1030 <fprintf@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@stderr = global i32 0
@.str = [19 x i8] c"%s [errno=%d]: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @ordie(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = load i64, i64* @errno
%9 = load i64, i64* @errno
%10 = call i8* @strerror(i64 %9)
%11 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %7, i64 %8, i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@stderr = global i32 0
@.str = [19 x i8] c"%s [errno=%d]: %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @ordie(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i8* @strerror(i64 %2)
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %2, i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ errno;
int close(int fd) {
  errno = EBADF;
  return -1;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EBADF = global i32 0
@errno = global i32 0
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EBADF
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
define i32 @close(i32 %0) {
%2 = load i32, i32* @EBADF
store i32 %2, i32* @errno
ret i32 -1
}
unsigned long compute_value(unsigned long value) { return value / 3; }


x86 assembly (clang, -O0):
<compute_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_value>:
mov    %rdi,%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
mov    %rdx,%rax
shr    %rax
ret

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

LLVM IR (-O2):
define i64 @compute_value(i64 %0) {
%2 = udiv i64 %0, 3
ret i64 %2
}
unsigned int gf2_matrix_times(mat, vec)
unsigned int *mat;
unsigned int vec;
{
  unsigned int sum;
  sum = 0;
  while (vec) {
    if (vec & 1)
      sum ^= *mat;
    vec >>= 1;
    mat++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<gf2_matrix_times>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1151 <gf2_matrix_times+0x51>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1137 <gf2_matrix_times+0x37>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <gf2_matrix_times+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf2_matrix_times>:
xor    %eax,%eax
test   %esi,%esi
jne    111f <gf2_matrix_times+0x1f>
ret
nopw   0x0(%rax,%rax,1)
mov    %esi,%ecx
shr    %ecx
add    $0x4,%rdi
cmp    $0x1,%esi
mov    %ecx,%esi
jbe    1106 <gf2_matrix_times+0x6>
test   $0x1,%sil
je     1110 <gf2_matrix_times+0x10>
xor    (%rdi),%eax
jmp    1110 <gf2_matrix_times+0x10>

LLVM IR (-O0):
define i32 @gf2_matrix_times(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 = %18, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = load i32, i32* %5
%17 = xor i32 %16, %15
store i32 %17, i32* %5
br label %18
18: ; preds = %13, %9
%19 = load i32, i32* %4
%20 = lshr i32 %19, 1
store i32 %20, i32* %4
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %3
br label %6
23: ; preds = %6
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @gf2_matrix_times(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %18, label %4
4: ; preds = %2, %13
%5 = phi i32 [ %14, %13 ], [ 0, %2 ]
%6 = phi i32 [ %15, %13 ], [ %1, %2 ]
%7 = phi i32* [ %16, %13 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = load i32, i32* %7
%12 = xor i32 %11, %5
br label %13
13: ; preds = %10, %4
%14 = phi i32 [ %12, %10 ], [ %5, %4 ]
%15 = lshr i32 %6, 1
%16 = getelementptr inbounds i32, i32* %7, i64 1
%17 = icmp ult i32 %6, 2
br i1 %17, label %18, label %4
18: ; preds = %13, %2
%19 = phi i32 [ 0, %2 ], [ %14, %13 ]
ret i32 %19
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t num, size_t size) {
  void *ptr = malloc(num * size);
  if (ptr) {
    memset(ptr, 0, num * size);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <calloc+0x41>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = mul i64 %14, %15
%17 = call i32 @memset(i8* %13, i32 0, i64 %16)
br label %18
18: ; preds = %12, %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
double __builtin_fabs(double const);
double __builtin_fmax(double const, double const);
int /*<<< orphan*/ printf(char *, double const, double const);
int main() {
  const double negval = -1.0;
  const double nanval = 0.0 / 0.0;
  const double val = __builtin_fmax(negval, nanval);
  const double absval = __builtin_fabs(val);
  printf("fabs(%.16e) = %.16e\n", val, absval);
  return absval >= 0 ? 0 : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee4(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecf(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movaps 0xeae(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
mov    $0x1,%eax
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
cmovae %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"fabs(%.16e) = %.16e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store double -1.000000e+00, double* %2
store double 0x7FF8000000000000, double* %3
%6 = call double @llvm.maxnum.f64(double -1.000000e+00, double 0x7FF8000000000000)
store double %6, double* %4
%7 = load double, double* %4
%8 = call double @llvm.fabs.f64(double %7)
store double %8, double* %5
%9 = load double, double* %4
%10 = load double, double* %5
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %9, double %10)
%12 = load double, double* %5
%13 = fcmp oge double %12, 0.000000e+00
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 1
ret i32 %15
}

LLVM IR (-O2):
@.str = [21 x i8] c"fabs(%.16e) = %.16e\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double -1.000000e+00, double 1.000000e+00)
ret i32 0
}
/* Variables and functions */
void swapi(int *v, size_t j, size_t i) {
  int temp = v[j];
  v[j] = v[i];
  v[i] = temp;
}


x86 assembly (clang, -O0):
<swapi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapi>:
mov    (%rdi,%rsi,4),%eax
mov    (%rdi,%rdx,4),%ecx
mov    %ecx,(%rdi,%rsi,4)
mov    %eax,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swapi(i32* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 %2
%7 = load i32, i32* %6
store i32 %7, i32* %4
store i32 %5, i32* %6
ret void
}
int cheat_search(int array[], int n, int key) {
  return key >= 0 && key < n ? key : -1;
}


x86 assembly (clang, -O0):
<cheat_search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     112f <cheat_search+0x2f>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    112f <cheat_search+0x2f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    113c <cheat_search+0x3c>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113c <cheat_search+0x3c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cheat_search>:
cmp    %esi,%edx
mov    $0xffffffff,%eax
cmovl  %edx,%eax
mov    $0xffffffff,%ecx
test   %edx,%edx
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cheat_search(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, -1
%5 = icmp slt i32 %2, %1
%6 = and i1 %4, %5
%7 = select i1 %6, i32 %2, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ stdscr;
void get_terminal_dim_bcircle(int *w, int *h) {
  getmaxyx(stdscr, *h, *w);
  clear();
}


x86 assembly (clang, -O0):
<get_terminal_dim_bcircle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
call   1030 <getmaxyx@plt>
mov    $0x0,%al
call   1040 <clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_terminal_dim_bcircle>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    (%rsi),%esi
mov    (%rdi),%edx
mov    %eax,%edi
call   1030 <getmaxyx@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <clear@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @get_terminal_dim_bcircle(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @stdscr
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @getmaxyx(i32 %5, i32 %7, i32 %9)
%11 = call i32 (...) @clear()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @get_terminal_dim_bcircle(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* @stdscr
%4 = load i32, i32* %1
%5 = load i32, i32* %0
%6 = tail call i32 @getmaxyx(i32 %3, i32 %4, i32 %5)
%7 = tail call i32 (...) @clear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_iff_list();
int /*<<< orphan*/ sleep(int);
int main() {
  print_iff_list();
  sleep(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <print_iff_list@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <print_iff_list@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @print_iff_list()
%3 = call i32 @sleep(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_iff_list()
%2 = tail call i32 @sleep(i32 2)
ret i32 0
}
void rop3_192_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = T & S;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_192_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_192_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_192_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = and i32 %9, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %7
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = and i32 %15, %18
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = xor i32 %21, -1
%23 = and i32 %19, %22
%24 = load i8*, i8** %4
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = and i32 %26, %28
%30 = or i32 %23, %29
%31 = load i8*, i8** %4
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = and i32 %33, %35
%37 = or i32 %30, %36
%38 = trunc i32 %37 to i8
%39 = load i8*, i8** %4
store i8 %38, i8* %39
ret void
}

LLVM IR (-O2):
define void @rop3_192_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
void smp_send_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @smp_send_stop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ w_passed_pawns(int, int);
void w_passed_pawns_test(void **state) {
  assert_int_equal(0x0000000000000800ul,
                   w_passed_pawns(0x0000000000001800ul, 0x0020000000000000ul));
}


x86 assembly (clang, -O0):
<w_passed_pawns_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1800,%edi
xor    %esi,%esi
call   1040 <w_passed_pawns@plt>
mov    %eax,%esi
mov    $0x800,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_passed_pawns_test>:
push   %rax
mov    $0x1800,%edi
xor    %esi,%esi
call   1040 <w_passed_pawns@plt>
mov    $0x800,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @w_passed_pawns_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @w_passed_pawns(i32 6144, i32 0)
%4 = call i32 @assert_int_equal(i32 2048, i32 %3)
ret void
}

LLVM IR (-O2):
define void @w_passed_pawns_test(i8** nocapture readnone %0) {
%2 = tail call i32 @w_passed_pawns(i32 6144, i32 0)
%3 = tail call i32 @assert_int_equal(i32 2048, i32 %2)
ret void
}
strarrlen(const char *strarr[]) {
  long i = 0;
  while (strarr[i])
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<strarrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1134 <strarrlen+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strarrlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strarrlen(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw nsw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ CreateWin44();
void createwin() { CreateWin44(); }


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

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

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

LLVM IR (-O2):
define void @createwin() {
%1 = tail call i32 (...) @CreateWin44()
ret void
}
/* Variables and functions */
float cosf(float);
float intr_wrap_026(float p1) { return cosf(p1); }


x86 assembly (clang, -O0):
<intr_wrap_026>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cosf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_026>:
jmp    1030 <cosf@plt>

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

LLVM IR (-O2):
define float @intr_wrap_026(float %0) {
%2 = tail call float @cosf(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fwrite(int *, int, int, int /*<<< orphan*/ *);
int fputc(int character, FILE *stream) {
  if (fwrite(&character, sizeof(char), 1, stream) != 1)
    return EOF;
  return character;
}


x86 assembly (clang, -O0):
<fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
cmp    $0x1,%eax
je     114d <fputc+0x3d>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fputc+0x43>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
cmp    $0x1,%eax
je     113f <fputc+0x2f>
mov    0x2ea9(%rip),%rbx
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fputc(i32 %0, i32* nocapture %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 1, i32 1, i32* %1)
%5 = icmp eq i32 %4, 1
%6 = load i32, i32* %3
%7 = load i32, i32* @EOF
%8 = select i1 %5, i32 %6, i32 %7
ret i32 %8
}
/* Variables and functions */
void *a8(int);
void *a7(int x) { return (((x >> 7) & 1) ? a8(x) : a8(x)); }


x86 assembly (clang, -O0):
<a7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x7,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <a7+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <a8@plt>
mov    %rax,-0x10(%rbp)
jmp    114a <a7+0x3a>
mov    -0x4(%rbp),%edi
call   1030 <a8@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a7>:
jmp    1030 <a8@plt>

LLVM IR (-O0):
define i8* @a7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 7
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i8* @a8(i32 %8)
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i8* @a8(i32 %11)
br label %13
13: ; preds = %10, %7
%14 = phi i8* [ %9, %7 ], [ %12, %10 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @a7(i32 %0) {
%2 = tail call i8* @a8(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScaled(double, double, double);
int /*<<< orphan*/ glTranslated(int /*<<< orphan*/, double, int /*<<< orphan*/);
int /*<<< orphan*/ glutSolidCube(double);
void tableLeg(double thick, double len) {
  glPushMatrix();
  glTranslated(0, len / 2, 0);
  glScaled(thick, len, thick);
  glutSolidCube(1.0);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<tableLeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1060 <glPushMatrix@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe92(%rip),%xmm1
divsd  %xmm1,%xmm0
xor    %esi,%esi
mov    %esi,%edi
call   1070 <glTranslated@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
call   1050 <glScaled@plt>
movsd  0xe61(%rip),%xmm0
call   1030 <glutSolidCube@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tableLeg>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1060 <glPushMatrix@plt>
movsd  0xe91(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glTranslated@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movaps %xmm0,%xmm2
call   1050 <glScaled@plt>
movsd  0xe6e(%rip),%xmm0
call   1030 <glutSolidCube@plt>
xor    %eax,%eax
add    $0x18,%rsp
jmp    1040 <glPopMatrix@plt>

LLVM IR (-O0):
define void @tableLeg(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 (...) @glPushMatrix()
%6 = load double, double* %4
%7 = fdiv double %6, 2.000000e+00
%8 = call i32 @glTranslated(i32 0, double %7, i32 0)
%9 = load double, double* %3
%10 = load double, double* %4
%11 = load double, double* %3
%12 = call i32 @glScaled(double %9, double %10, double %11)
%13 = call i32 @glutSolidCube(double 1.000000e+00)
%14 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @tableLeg(double %0, double %1) {
%3 = tail call i32 (...) @glPushMatrix()
%4 = fmul double %1, 5.000000e-01
%5 = tail call i32 @glTranslated(i32 0, double %4, i32 0)
%6 = tail call i32 @glScaled(double %0, double %1, double %0)
%7 = tail call i32 @glutSolidCube(double 1.000000e+00)
%8 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Variables and functions */
int base_len(char *);
char *base_name(char *);
int strip_trailing_slashes(char *path) {
  char *base = base_name(path);
  char *base_lim = base + base_len(base);
  int had_slash = *base_lim;
  *base_lim = '\0';
  return had_slash;
}


x86 assembly (clang, -O0):
<strip_trailing_slashes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <base_name@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <base_len@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_trailing_slashes>:
push   %rbx
call   1040 <base_name@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <base_len@plt>
movslq %eax,%rcx
movsbl (%rbx,%rcx,1),%eax
movb   $0x0,(%rbx,%rcx,1)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @strip_trailing_slashes(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @base_name(i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @base_len(i8* %9)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
store i32 %15, i32* %5
%16 = load i8*, i8** %4
store i8 0, i8* %16
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @strip_trailing_slashes(i8* %0) {
%2 = tail call i8* @base_name(i8* %0)
%3 = tail call i32 @base_len(i8* %2)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %2, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
store i8 0, i8* %5
ret i32 %7
}
/* Type definitions */
typedef long uint32_t;

/* Variables and functions */
long eflags_read();
int /*<<< orphan*/ eflags_write(long);
int has_cpuid(void) {
  uint32_t old_eflg;
  uint32_t new_eflg;
  old_eflg = eflags_read();
  new_eflg = old_eflg ^ (1L << 21);
  eflags_write(new_eflg);
  new_eflg = eflags_read();
  return (new_eflg != old_eflg);
}


x86 assembly (clang, -O0):
<has_cpuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <eflags_read@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0x200000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <eflags_write@plt>
mov    $0x0,%al
call   1030 <eflags_read@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_cpuid>:
push   %rbx
xor    %eax,%eax
call   1030 <eflags_read@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    $0x200000,%rdi
call   1040 <eflags_write@plt>
xor    %eax,%eax
call   1030 <eflags_read@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @has_cpuid() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @eflags_read()
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = xor i64 %4, 2097152
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = call i32 @eflags_write(i64 %6)
%8 = call i64 (...) @eflags_read()
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = load i64, i64* %1
%11 = icmp ne i64 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @has_cpuid() {
%1 = tail call i64 (...) @eflags_read()
%2 = xor i64 %1, 2097152
%3 = tail call i32 @eflags_write(i64 %2)
%4 = tail call i64 (...) @eflags_read()
%5 = icmp ne i64 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}