xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_66(void) {
  if (*(uint32_t *)0x10000130ul == 0x8ul) {
    if (*(uint32_t *)0x10000134ul == 0x0ul) {
      return true;
    }
    if (*(uint32_t *)0x10000134ul == 0x1ul) {
      return true;
    }
    if (*(uint32_t *)0x10000134ul == 0x2ul) {
      return true;
    }
    if (*(uint32_t *)0x10000134ul == 0x3ul) {
      return true;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<errata_66>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0x8,%rax
jne    1193 <errata_66+0x93>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_66+0x34>
movl   $0x1,-0x4(%rbp)
jmp    119a <errata_66+0x9a>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x1,%rax
jne    1152 <errata_66+0x52>
movl   $0x1,-0x4(%rbp)
jmp    119a <errata_66+0x9a>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x2,%rax
jne    1170 <errata_66+0x70>
movl   $0x1,-0x4(%rbp)
jmp    119a <errata_66+0x9a>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x3,%rax
jne    118e <errata_66+0x8e>
movl   $0x1,-0x4(%rbp)
jmp    119a <errata_66+0x9a>
jmp    1193 <errata_66+0x93>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_66>:
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @errata_66() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void die(char *msg) {
  printf("%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
int main() {
  malloc(100);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @malloc(i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ paddle_close();
void sigint(int sig) {
  paddle_close();
  exit(-1);
}


x86 assembly (clang, -O0):
<sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <paddle_close@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigint>:
push   %rax
xor    %eax,%eax
call   1030 <paddle_close@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @paddle_close()
%4 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @sigint(i32 %0) {
%2 = tail call i32 (...) @paddle_close()
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("what?\?!\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"what??!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int atoi(char *str) {
  int r = 0;
  for (int i = 0; str[i] != '\0'; ++i)
    r = r * 10 + str[i] - '0';
  return r;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <atoi+0x51>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <atoi+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <atoi+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <atoi+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i64 [ %14, %6 ], [ 0, %1 ]
%8 = phi i8 [ %16, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = sext i8 %8 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = add nuw nsw i64 %7, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %4, label %6
}
/* Type definitions */
struct sigaction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ notify_client();
int /*<<< orphan*/ setup_server_signals(struct sigaction *);
int /*<<< orphan*/ wait_for_signal(struct sigaction *);
void server_once(int operation) {
  struct sigaction signal_action;
  setup_server_signals(&signal_action);
  if (operation == 0x0) {
    wait_for_signal(&signal_action);
  } else {
    notify_client();
  }
}


x86 assembly (clang, -O0):
<server_once>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <setup_server_signals@plt>
cmpl   $0x0,-0x4(%rbp)
jne    115c <server_once+0x2c>
lea    -0x8(%rbp),%rdi
call   1040 <wait_for_signal@plt>
jmp    1163 <server_once+0x33>
mov    $0x0,%al
call   1030 <notify_client@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<server_once>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%rdi
call   1050 <setup_server_signals@plt>
test   %ebx,%ebx
je     114e <server_once+0x1e>
xor    %eax,%eax
call   1030 <notify_client@plt>
jmp    1158 <server_once+0x28>
lea    0x8(%rsp),%rdi
call   1040 <wait_for_signal@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
define void @server_once(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sigaction
store i32 %0, i32* %2
%4 = call i32 @setup_server_signals(%struct.sigaction* %3)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @wait_for_signal(%struct.sigaction* %3)
br label %11
9: ; preds = %1
%10 = call i32 (...) @notify_client()
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
define void @server_once(i32 %0) {
%2 = alloca %struct.sigaction
%3 = bitcast %struct.sigaction* %2 to i8*
%4 = call i32 @setup_server_signals(%struct.sigaction* %2)
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @wait_for_signal(%struct.sigaction* %2)
br label %10
8: ; preds = %1
%9 = call i32 (...) @notify_client()
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void comm_abort(void) { abort(); }


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

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

LLVM IR (-O0):
define void @comm_abort() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @comm_abort() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_dialog_hide_i(char const *);
void roadmap_crossing_cancel(const char *name, void *data) {
  roadmap_dialog_hide_i(name);
}


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

x86 assembly (clang, -O2):
<roadmap_crossing_cancel>:
jmp    1030 <roadmap_dialog_hide_i@plt>

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

LLVM IR (-O2):
define void @roadmap_crossing_cancel(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @roadmap_dialog_hide_i(i8* %0)
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
scalar_t__ mktime(struct tm *);
long long timetots(struct tm *t) { return (long long)mktime(t) - 1262304000; }


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

x86 assembly (clang, -O2):
<timetots>:
push   %rax
call   1030 <mktime@plt>
add    $0xffffffffb4c2c500,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i64 @timetots(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = call i64 @mktime(%struct.tm* %3)
%5 = sub nsw i64 %4, 1262304000
ret i64 %5
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i64 @timetots(%struct.tm* nocapture %0) {
%2 = tail call i64 @mktime(%struct.tm* %0)
%3 = add nsw i64 %2, -1262304000
ret i64 %3
}
int ndisc_snoop_init(struct hostapd_data *hapd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.hostapd_data = type opaque
define i32 @ndisc_snoop_init(%struct.hostapd_data* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
size_t read(int, void *, size_t);
void read_or_die(int fd, void *buf, size_t count) {
  ssize_t sz = read(fd, buf, count);
  if (sz != count)
    exit(2);
}


x86 assembly (clang, -O0):
<read_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     115f <read_or_die+0x3f>
mov    $0x2,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_or_die>:
push   %rbx
mov    %rdx,%rbx
call   1030 <read@plt>
cmp    %rbx,%rax
jne    1130 <read_or_die+0x10>
pop    %rbx
ret
mov    $0x2,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @read_or_die(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @read(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @exit(i32 2)
unreachable
8: ; preds = %3
ret void
}
float wrapf(float x, float a, float b) {
  if (x > b)
    x = a;
  else if (x < a)
    x = b;
  return x;
}


x86 assembly (clang, -O0):
<wrapf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1131 <wrapf+0x31>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <wrapf+0x53>
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    114e <wrapf+0x4e>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <wrapf+0x53>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapf>:
ucomiss %xmm2,%xmm0
jbe    1109 <wrapf+0x9>
movaps %xmm1,%xmm0
ret
ucomiss %xmm0,%xmm1
jbe    1111 <wrapf+0x11>
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @wrapf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fcmp ogt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
store float %11, float* %4
br label %19
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %5
%15 = fcmp olt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
store float %17, float* %4
br label %18
18: ; preds = %16, %12
br label %19
19: ; preds = %18, %10
%20 = load float, float* %4
ret float %20
}

LLVM IR (-O2):
define float @wrapf(float %0, float %1, float %2) {
%4 = fcmp ogt float %0, %2
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = fcmp olt float %0, %1
br i1 %6, label %7, label %8
7: ; preds = %5
br label %8
8: ; preds = %3, %5, %7
%9 = phi float [ %2, %7 ], [ %0, %5 ], [ %1, %3 ]
ret float %9
}
int bar(int a) {
  if (a & ~3)
    return a;
  return a & 3;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffffffc,%eax
cmp    $0x0,%eax
je     1121 <bar+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112a <bar+0x2a>
mov    -0x8(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
ret i32 %0
}
/* Variables and functions */
int getVarintSize(size_t size) {
  if (size < 0xfd) {
    return 1;
  } else if (size <= 0xffff) {
    return 3;
  } else if (size <= 0xffffffff) {
    return 5;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<getVarintSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0xfd,-0x10(%rbp)
jae    1122 <getVarintSize+0x22>
movl   $0x1,-0x4(%rbp)
jmp    115e <getVarintSize+0x5e>
cmpq   $0xffff,-0x10(%rbp)
ja     113c <getVarintSize+0x3c>
movl   $0x3,-0x4(%rbp)
jmp    115e <getVarintSize+0x5e>
mov    $0xffffffff,%eax
cmp    %rax,-0x10(%rbp)
ja     1157 <getVarintSize+0x57>
movl   $0x5,-0x4(%rbp)
jmp    115e <getVarintSize+0x5e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getVarintSize>:
mov    $0x1,%eax
cmp    $0xfd,%rdi
jb     1128 <getVarintSize+0x28>
mov    $0x3,%eax
cmp    $0x10000,%rdi
jb     1128 <getVarintSize+0x28>
shr    $0x20,%rdi
neg    %rdi
sbb    %eax,%eax
or     $0x5,%eax
ret

LLVM IR (-O0):
define i32 @getVarintSize(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ult i64 %4, 253
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %16
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp ule i64 %8, 65535
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 3, i32* %2
br label %16
11: ; preds = %7
%12 = load i64, i64* %3
%13 = icmp ule i64 %12, 4294967295
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 5, i32* %2
br label %16
15: ; preds = %11
store i32 -1, i32* %2
br label %16
16: ; preds = %15, %14, %10, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @getVarintSize(i64 %0) {
%2 = icmp ult i64 %0, 253
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i64 %0, 65536
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ult i64 %0, 4294967296
%7 = select i1 %6, i32 5, i32 -1
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ 1, %1 ], [ 3, %3 ], [ %7, %5 ]
ret i32 %9
}
/* Variables and functions */
int cons_getc();
int sys_cgetc(void) { return cons_getc(); }


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

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

LLVM IR (-O0):
define i32 @sys_cgetc() {
%1 = call i32 (...) @cons_getc()
ret i32 %1
}

LLVM IR (-O2):
define i32 @sys_cgetc() {
%1 = tail call i32 (...) @cons_getc()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ pawns_able_to_capture_east(int, int, int);
void pawns_able_to_capture_east_test(void **state) {
  assert_int_equal(0x0000000004000000ul,
                   pawns_able_to_capture_east(0x000000000C10E300ul,
                                              0x00E3140800000000ul, 0));
  assert_int_equal(0x0000000800000000ul,
                   pawns_able_to_capture_east(0x0000100800000000ul,
                                              0x0000000018000000ul, 1));
}


x86 assembly (clang, -O0):
<pawns_able_to_capture_east_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc10e300,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <pawns_able_to_capture_east@plt>
mov    %eax,%esi
mov    $0x4000000,%edi
call   1040 <assert_int_equal@plt>
xor    %edi,%edi
mov    $0x18000000,%esi
mov    $0x1,%edx
call   1030 <pawns_able_to_capture_east@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pawns_able_to_capture_east_test>:
push   %rax
mov    $0xc10e300,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <pawns_able_to_capture_east@plt>
mov    $0x4000000,%edi
mov    %eax,%esi
call   1040 <assert_int_equal@plt>
xor    %edi,%edi
mov    $0x18000000,%esi
mov    $0x1,%edx
call   1030 <pawns_able_to_capture_east@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @pawns_able_to_capture_east_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @pawns_able_to_capture_east(i32 202433280, i32 0, i32 0)
%4 = call i32 @assert_int_equal(i32 67108864, i32 %3)
%5 = call i32 @pawns_able_to_capture_east(i32 0, i32 402653184, i32 1)
%6 = call i32 @assert_int_equal(i32 0, i32 %5)
ret void
}

LLVM IR (-O2):
define void @pawns_able_to_capture_east_test(i8** nocapture readnone %0) {
%2 = tail call i32 @pawns_able_to_capture_east(i32 202433280, i32 0, i32 0)
%3 = tail call i32 @assert_int_equal(i32 67108864, i32 %2)
%4 = tail call i32 @pawns_able_to_capture_east(i32 0, i32 402653184, i32 1)
%5 = tail call i32 @assert_int_equal(i32 0, i32 %4)
ret void
}
int sc_strcpy(char *T, char *S) {
  int walker = 0;
  if (!T || !S)
    return 0;
  while (*S)
    *T++ = *S++;
  *T = *S;
  return 1;
}


x86 assembly (clang, -O0):
<sc_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1129 <sc_strcpy+0x29>
cmpq   $0x0,-0x18(%rbp)
jne    1135 <sc_strcpy+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1181 <sc_strcpy+0x81>
jmp    113a <sc_strcpy+0x3a>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116e <sc_strcpy+0x6e>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    113a <sc_strcpy+0x3a>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_strcpy>:
xor    %eax,%eax
test   %rdi,%rdi
je     1139 <sc_strcpy+0x39>
test   %rsi,%rsi
je     1139 <sc_strcpy+0x39>
mov    (%rsi),%al
test   %al,%al
je     1131 <sc_strcpy+0x31>
add    $0x1,%rsi
cs nopw 0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1120 <sc_strcpy+0x20>
movb   $0x0,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @sc_strcpy(i8* writeonly %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %19
6: ; preds = %2
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6, %9
%10 = phi i8 [ %15, %9 ], [ %7, %6 ]
%11 = phi i8* [ %13, %9 ], [ %1, %6 ]
%12 = phi i8* [ %14, %9 ], [ %0, %6 ]
%13 = getelementptr inbounds i8, i8* %11, i64 1
%14 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %10, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %6
%18 = phi i8* [ %0, %6 ], [ %14, %9 ]
store i8 0, i8* %18
br label %19
19: ; preds = %2, %17
%20 = phi i32 [ 1, %17 ], [ 0, %2 ]
ret i32 %20
}
int test_imm_1Cint8_mem(signed char *val) {
  return ((*val) & (-0x1C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Cint8_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, -28
%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_1Cint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -28
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void Delay(void) {
  int i;
  for (i = 0; i < 1000000; i++) {
    i++;
    i--;
  }
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jge    1138 <Delay+0x38>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <Delay+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Delay() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1000000
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
br label %10
10: ; preds = %5
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
ret void
}

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

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createOrExpression(struct memorycontainer *expression1,
                   struct memorycontainer *expression2) {
  return createExpression(0x0003, expression1, expression2);
}


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

x86 assembly (clang, -O2):
<createOrExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x3,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createOrExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 3, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createOrExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 3, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
/* Variables and functions */
int /*<<< orphan*/ afree(void *);
void *amalloc(int);
main() {
  void *p;
  p = amalloc(11);
  afree(p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xb,%edi
call   1030 <amalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <afree@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = call i8* @amalloc(i32 11)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @afree(i8* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @amalloc(i32 11)
%2 = tail call i32 @afree(i8* %1)
ret i32 0
}
int test_imm_A4int64_lowword_mem(long long *val) {
  return ((*val) & (0xA4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A4int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 164
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int f243(int *);
int f244(int *p) { return f243(p); }


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

x86 assembly (clang, -O2):
<f244>:
jmp    1030 <f243@plt>

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

LLVM IR (-O2):
define i32 @f244(i32* %0) {
%2 = tail call i32 @f243(i32* %0)
ret i32 %2
}
void swap(int *arr, int i, int j) {
  int t = arr[i];
  arr[i] = arr[j];
  arr[j] = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
const char *perf_get_title(void) {
  return "Measure file system read and write speed";
}


x86 assembly (clang, -O0):
<perf_get_title>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_get_title>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Measure file system read and write speed\00"
define i8* @perf_get_title() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [41 x i8] c"Measure file system read and write speed\00"
define i8* @perf_get_title() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}
int constrain(int x, int a, int b) {
  int res;
  if (x <= b && x >= a)
    res = x;
  if (x > b)
    res = b;
  if (x < a)
    res = a;
  return (res);
}


x86 assembly (clang, -O0):
<constrain>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     112b <constrain+0x2b>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     112b <constrain+0x2b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113d <constrain+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114f <constrain+0x4f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<constrain>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @constrain(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = icmp slt i32 %0, %1
%6 = select i1 %4, i32 %2, i32 %0
%7 = select i1 %5, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ read_data();
int /*<<< orphan*/ scan_y();
int /*<<< orphan*/ write_flush_all();
int /*<<< orphan*/ write_header();
int /*<<< orphan*/ write_init();
int main(void) {
  write_init();
  read_data();
  write_header();
  scan_y();
  write_flush_all();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <write_init@plt>
mov    $0x0,%al
call   1030 <read_data@plt>
mov    $0x0,%al
call   1070 <write_header@plt>
mov    $0x0,%al
call   1040 <scan_y@plt>
mov    $0x0,%al
call   1060 <write_flush_all@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <write_init@plt>
xor    %eax,%eax
call   1030 <read_data@plt>
xor    %eax,%eax
call   1070 <write_header@plt>
xor    %eax,%eax
call   1040 <scan_y@plt>
xor    %eax,%eax
call   1060 <write_flush_all@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @write_init()
%3 = call i32 (...) @read_data()
%4 = call i32 (...) @write_header()
%5 = call i32 (...) @scan_y()
%6 = call i32 (...) @write_flush_all()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @write_init()
%2 = tail call i32 (...) @read_data()
%3 = tail call i32 (...) @write_header()
%4 = tail call i32 (...) @scan_y()
%5 = tail call i32 (...) @write_flush_all()
ret i32 0
}
__attribute__((noipa, optimize("Ofast"))) int f2(float x) {
  return __builtin_sqrtf(x) < 0x1.2dd3d0p-65f;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111f <f2+0xf>
sqrtss %xmm0,%xmm0
jmp    1124 <f2+0x14>
call   1030 <sqrtf@plt>
movss  0xed4(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrtf(float %3)
%5 = fcmp olt float %4, 0x3BE2DD3D00000000
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f2(float %0) {
%2 = tail call float @sqrtf(float %0)
%3 = fcmp olt float %2, 0x3BE2DD3D00000000
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct server_list {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_copy(struct genlist *);
struct server_list *server_list_copy(const struct server_list *plist) {
  return ((struct server_list *)(genlist_copy(((struct genlist *)(plist)))));
}


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

x86 assembly (clang, -O2):
<server_list_copy>:
jmp    1030 <genlist_copy@plt>

LLVM IR (-O0):
%struct.server_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.server_list* @server_list_copy(%struct.server_list* %0) {
%2 = alloca %struct.server_list*
store %struct.server_list* %0, %struct.server_list** %2
%3 = load %struct.server_list*, %struct.server_list** %2
%4 = bitcast %struct.server_list* %3 to %struct.genlist*
%5 = call i64 @genlist_copy(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.server_list*
ret %struct.server_list* %6
}

LLVM IR (-O2):
%struct.server_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.server_list* @server_list_copy(%struct.server_list* %0) {
%2 = bitcast %struct.server_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_copy(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.server_list*
ret %struct.server_list* %4
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char const *);
void cleanup_dbginit(void *arg) { unlink((const char *)arg); }


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

x86 assembly (clang, -O2):
<cleanup_dbginit>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @cleanup_dbginit(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
int isPalindromeIterative(char *input, int length) {
  int start = 0, end = length - 1;
  while (start < end)
    if (input[start++] != input[end--])
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<isPalindromeIterative>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    116c <isPalindromeIterative+0x6c>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x1c(%rbp),%edx
mov    %edx,%esi
add    $0xffffffff,%esi
mov    %esi,-0x1c(%rbp)
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1167 <isPalindromeIterative+0x67>
movl   $0x0,-0x4(%rbp)
jmp    1173 <isPalindromeIterative+0x73>
jmp    111b <isPalindromeIterative+0x1b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindromeIterative>:
movslq %esi,%rax
add    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
nopl   0x0(%rax)
cmp    %rax,%rcx
jge    112c <isPalindromeIterative+0x2c>
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
lea    -0x1(%rax),%rsi
cmp    (%rdi,%rax,1),%dl
mov    %rsi,%rax
je     1110 <isPalindromeIterative+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isPalindromeIterative(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %9, %2
%5 = phi i64 [ %7, %9 ], [ %3, %2 ]
%6 = phi i64 [ %10, %9 ], [ 0, %2 ]
%7 = add nsw i64 %5, -1
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = add nuw nsw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %6
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %7
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %4, %9
%17 = phi i32 [ 0, %9 ], [ 1, %4 ]
ret i32 %17
}
void fb_console_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @fb_console_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
char *reg(int, int);
void tohcol(int ic) {
  if (ic <= 0)
    printf("\\h'|0'");
  else
    printf("\\h'(|\\n(%2su+|\\n(%2su)/2u'", reg(ic, 0), reg(ic - 1, 2));
}


x86 assembly (clang, -O0):
<tohcol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1148 <tohcol+0x28>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117b <tohcol+0x5b>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <reg@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    $0x2,%esi
call   1040 <reg@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tohcol>:
test   %edi,%edi
jle    115e <tohcol+0x3e>
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %esi,%esi
call   1040 <reg@plt>
mov    %rax,%r14
add    $0xffffffff,%ebx
mov    %ebx,%edi
mov    $0x2,%esi
call   1040 <reg@plt>
lea    0xebd(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\\h'|0'\00"
@.str.1 = [27 x i8] c"\\h'(|\\n(%2su+|\\n(%2su)/2u'\00"
define void @tohcol(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %14
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i8* @reg(i32 %8, i32 0)
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1
%12 = call i8* @reg(i32 %11, i32 2)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* %12)
br label %14
14: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\\h'|0'\00"
@.str.1 = [27 x i8] c"\\h'(|\\n(%2su+|\\n(%2su)/2u'\00"
define void @tohcol(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
5: ; preds = %1
%6 = tail call i8* @reg(i32 %0, i32 0)
%7 = add nsw i32 %0, -1
%8 = tail call i8* @reg(i32 %7, i32 2)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %8)
br label %10
10: ; preds = %5, %3
ret void
}
unsigned int f58(unsigned int x, long int y) {
  return (x << (8 * sizeof(unsigned int) - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f58>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f58>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f58(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = sub i64 32, %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %5, %8
%10 = load i32, i32* %3
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = lshr i32 %10, %12
%14 = xor i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f58(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = sub i32 32, %3
%5 = shl i32 %0, %4
%6 = lshr i32 %0, %3
%7 = xor i32 %5, %6
ret i32 %7
}