xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int strcmp(char const *, char const *);
int strcoll_l(const char *s1, const char *s2, locale_t loc) {
  (void)(loc);
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<strcoll_l>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @strcoll_l(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %4
}
char f1() {
  char *s = "abcd";
  char c = s[4];
  return s[5] + c;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x5(%rax),%eax
movsbl -0x9(%rbp),%ecx
add    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"abcd\00"
define signext i8 @f1() {
%1 = alloca i8*
%2 = alloca i8
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 4
%5 = load i8, i8* %4
store i8 %5, i8* %2
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 5
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = add nsw i32 %9, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @f1() {
ret i8 0
}
reg0indreg1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if (r0 <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movsbl -0x5(%rbp),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jg     113d <reg0indreg1+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <reg0indreg1+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0indreg1>:
movsbl %dil,%ecx
movsbl (%r9),%edx
xor    %eax,%eax
cmp    %edx,%ecx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @reg0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture %5) {
%7 = shl i32 %0, 24
%8 = ashr exact i32 %7, 24
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %8, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printn(int n) { printf("%d\n", n); }


x86 assembly (clang, -O0):
<printn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printn>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @printn(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dwrite_ascfile(char const *, double const, double const,
                                  int const, double const *);
void dwrite_ascfile_c_(const char *name, const double *t0, const double *dt,
                       const int *n, const double *data) {
  dwrite_ascfile(name, *t0, *dt, *n, data);
}


x86 assembly (clang, -O0):
<dwrite_ascfile_c_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rdx
call   1030 <dwrite_ascfile@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwrite_ascfile_c_>:
movsd  (%rsi),%xmm0
movsd  (%rdx),%xmm1
mov    (%rcx),%esi
mov    %r8,%rdx
jmp    1030 <dwrite_ascfile@plt>

LLVM IR (-O0):
define void @dwrite_ascfile_c_(i8* %0, double* %1, double* %2, i32* %3, double* %4) {
%6 = alloca i8*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32*
%10 = alloca double*
store i8* %0, i8** %6
store double* %1, double** %7
store double* %2, double** %8
store i32* %3, i32** %9
store double* %4, double** %10
%11 = load i8*, i8** %6
%12 = load double*, double** %7
%13 = load double, double* %12
%14 = load double*, double** %8
%15 = load double, double* %14
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = load double*, double** %10
%19 = call i32 @dwrite_ascfile(i8* %11, double %13, double %15, i32 %17, double* %18)
ret void
}

LLVM IR (-O2):
define void @dwrite_ascfile_c_(i8* %0, double* nocapture %1, double* nocapture %2, i32* nocapture %3, double* %4) {
%6 = load double, double* %1
%7 = load double, double* %2
%8 = load i32, i32* %3
%9 = tail call i32 @dwrite_ascfile(i8* %0, double %6, double %7, i32 %8, double* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int sub(int, int, int);
int main(void) {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("%d\n", sub(100000000, a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x5f5e100,%edi
call   1050 <sub@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
mov    $0x5f5e100,%edi
call   1050 <sub@plt>
lea    0xea8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @sub(i32 100000000, i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int GetItemIndex(int);
int SearchItem(int ID) {
  for (int i = 0; i < 90; i++) {
    if (GetItemIndex(i) == ID)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<SearchItem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5a,-0xc(%rbp)
jge    115b <SearchItem+0x4b>
mov    -0xc(%rbp),%edi
call   1030 <GetItemIndex@plt>
cmp    -0x8(%rbp),%eax
jne    1148 <SearchItem+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <SearchItem+0x52>
jmp    114d <SearchItem+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <SearchItem+0x12>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SearchItem>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <GetItemIndex@plt>
cmp    %ebp,%eax
je     1138 <SearchItem+0x28>
add    $0x1,%ebx
cmp    $0x5a,%ebx
jne    1120 <SearchItem+0x10>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @SearchItem(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 90
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %4
%10 = call i32 @GetItemIndex(i32 %9)
%11 = load i32, i32* %3
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %20
15: ; preds = %8
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
store i32 -1, i32* %2
br label %20
20: ; preds = %19, %13
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @SearchItem(i32 %0) {
br label %2
2: ; preds = %1, %6
%3 = phi i32 [ 0, %1 ], [ %7, %6 ]
%4 = tail call i32 @GetItemIndex(i32 %3)
%5 = icmp eq i32 %4, %0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 90
br i1 %8, label %9, label %2
9: ; preds = %2, %6
%10 = phi i32 [ %3, %2 ], [ -1, %6 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
void sigpipe_handle_clients(int ignore) {
  signal(SIGPIPE, sigpipe_handle_clients);
  printf("Got a SIGPIPE; continuing.\n");
}


x86 assembly (clang, -O0):
<sigpipe_handle_clients>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    0x2ead(%rip),%rsi
call   1040 <signal@plt>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigpipe_handle_clients>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rsi
call   1040 <signal@plt>
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@.str = [28 x i8] c"Got a SIGPIPE; continuing.\0A\00"
define void @sigpipe_handle_clients(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGPIPE
%4 = call i32 @signal(i32 %3, void (i32)* @sigpipe_handle_clients)
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@str = [27 x i8] c"Got a SIGPIPE; continuing.\00"
define void @sigpipe_handle_clients(i32 %0) {
%2 = load i32, i32* @SIGPIPE
%3 = tail call i32 @signal(i32 %2, void (i32)* @sigpipe_handle_clients)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
int main(int argc, char *argv[]) {
  printf("each message is %d bytes\n", GetMessageSize());
  unsigned char random[4096];
  RandStr(random);
  printf("random string:\n%s\n", random);
  WaitFor(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <GetMessageSize@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1010(%rbp),%rdi
mov    $0x0,%al
call   1060 <RandStr@plt>
lea    -0x1010(%rbp),%rsi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <WaitFor@plt>
xor    %eax,%eax
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1000,%rsp
xor    %eax,%eax
call   1050 <GetMessageSize@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <RandStr@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <WaitFor@plt>
xor    %eax,%eax
add    $0x1000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"each message is %d bytes\0A\00"
@.str.1 = [19 x i8] c"random string:\0A%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [4096 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (...) @GetMessageSize()
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @RandStr to i32 (i8*, ...)*)(i8* %8)
%10 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 (i32, ...) bitcast (i32 (...)* @WaitFor to i32 (i32, ...)*)(i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"each message is %d bytes\0A\00"
@.str.1 = [19 x i8] c"random string:\0A%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4096 x i8]
%4 = tail call i32 (...) @GetMessageSize()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @RandStr to i32 (i8*, ...)*)(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%9 = call i32 (i32, ...) bitcast (i32 (...)* @WaitFor to i32 (i32, ...)*)(i32 1)
ret i32 0
}
void foo064() {}


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

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

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

LLVM IR (-O2):
define void @foo064() {
ret void
}
void swap(struct ListNode **node1, struct ListNode **node2) {
  struct ListNode *tmp = *node1;
  *node1 = *node2;
  *node2 = tmp;
}


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

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

LLVM IR (-O0):
%struct.ListNode = type opaque
define void @swap(%struct.ListNode** %0, %struct.ListNode** %1) {
%3 = alloca %struct.ListNode**
%4 = alloca %struct.ListNode**
%5 = alloca %struct.ListNode*
store %struct.ListNode** %0, %struct.ListNode*** %3
store %struct.ListNode** %1, %struct.ListNode*** %4
%6 = load %struct.ListNode**, %struct.ListNode*** %3
%7 = load %struct.ListNode*, %struct.ListNode** %6
store %struct.ListNode* %7, %struct.ListNode** %5
%8 = load %struct.ListNode**, %struct.ListNode*** %4
%9 = load %struct.ListNode*, %struct.ListNode** %8
%10 = load %struct.ListNode**, %struct.ListNode*** %3
store %struct.ListNode* %9, %struct.ListNode** %10
%11 = load %struct.ListNode*, %struct.ListNode** %5
%12 = load %struct.ListNode**, %struct.ListNode*** %4
store %struct.ListNode* %11, %struct.ListNode** %12
ret void
}

LLVM IR (-O2):
%struct.ListNode = type opaque
define void @swap(%struct.ListNode** nocapture %0, %struct.ListNode** nocapture %1) {
%3 = load %struct.ListNode*, %struct.ListNode** %0
%4 = load %struct.ListNode*, %struct.ListNode** %1
store %struct.ListNode* %4, %struct.ListNode** %0
store %struct.ListNode* %3, %struct.ListNode** %1
ret void
}
/* Variables and functions */
double libm_pow(double, double);
double cubr(double r) {
  if (r < 0.0)
    return -(libm_pow(-r, 1.0 / 3.0));
  else
    return libm_pow(r, 1.0 / 3.0);
}


x86 assembly (clang, -O0):
<cubr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1175 <cubr+0x65>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeb1(%rip),%xmm1
call   1030 <libm_pow@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118c <cubr+0x7c>
movsd  -0x10(%rbp),%xmm0
movsd  0xe7e(%rip),%xmm1
call   1030 <libm_pow@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubr>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    113a <cubr+0x2a>
xorpd  0xeed(%rip),%xmm0
movsd  0xed5(%rip),%xmm1
call   1030 <libm_pow@plt>
xorpd  0xed8(%rip),%xmm0
pop    %rax
ret
movsd  0xebe(%rip),%xmm1
pop    %rax
jmp    1030 <libm_pow@plt>

LLVM IR (-O0):
define double @cubr(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
%9 = call double @libm_pow(double %8, double 0x3FD5555555555555)
%10 = fneg double %9
store double %10, double* %2
br label %14
11: ; preds = %1
%12 = load double, double* %3
%13 = call double @libm_pow(double %12, double 0x3FD5555555555555)
store double %13, double* %2
br label %14
14: ; preds = %11, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @cubr(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fneg double %0
%5 = tail call double @libm_pow(double %4, double 0x3FD5555555555555)
%6 = fneg double %5
br label %9
7: ; preds = %1
%8 = tail call double @libm_pow(double %0, double 0x3FD5555555555555)
br label %9
9: ; preds = %7, %3
%10 = phi double [ %6, %3 ], [ %8, %7 ]
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int RAND_bytes(int /*<<< orphan*/ *, int);
int32_t _plat__GetEntropy(uint8_t *entropy, uint32_t amount) {
  if (RAND_bytes(entropy, amount) != 1) {
    return -1;
  }
  return amount;
}


x86 assembly (clang, -O0):
<_plat__GetEntropy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <RAND_bytes@plt>
cmp    $0x1,%eax
je     1140 <_plat__GetEntropy+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1146 <_plat__GetEntropy+0x36>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_plat__GetEntropy>:
push   %rbx
mov    %esi,%ebx
call   1030 <RAND_bytes@plt>
cmp    $0x1,%eax
mov    $0xffffffff,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_plat__GetEntropy(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** %4
%7 = load i32, i32* %5
%8 = call i32 @RAND_bytes(i32* %6, i32 %7)
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %10
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @_plat__GetEntropy(i32* %0, i32 %1) {
%3 = tail call i32 @RAND_bytes(i32* %0, i32 %1)
%4 = icmp eq i32 %3, 1
%5 = select i1 %4, i32 %1, i32 -1
ret i32 %5
}
/* Variables and functions */
int rx_byte();
int rx_word() { return rx_byte() | (rx_byte() << 8); }


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

x86 assembly (clang, -O2):
<rx_word>:
push   %rbx
xor    %eax,%eax
call   1030 <rx_byte@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rx_byte@plt>
shl    $0x8,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rx_word() {
%1 = call i32 (...) @rx_byte()
%2 = call i32 (...) @rx_byte()
%3 = shl i32 %2, 8
%4 = or i32 %1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @rx_word() {
%1 = tail call i32 (...) @rx_byte()
%2 = tail call i32 (...) @rx_byte()
%3 = shl i32 %2, 8
%4 = or i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 3, j = i - 2;
  switch (i - 2) {
  case 1:
    j++;
  case 2:
    j++;
  case 0:
    j++;
    break;
  default:
    j = 0;
  }
  printf("%d", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,-0x10(%rbp)
je     1177 <main+0x67>
jmp    1143 <main+0x33>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1165 <main+0x55>
jmp    1154 <main+0x44>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     116e <main+0x5e>
jmp    1185 <main+0x75>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118c <main+0x7c>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double x;
  scanf("%lf", &x);
  if (x < 0)
    x = -x;
  printf("%.2lf\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    116e <main+0x4e>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    114c <main+0x2c>
xorpd  0xeb9(%rip),%xmm0
movlpd %xmm0,(%rsp)
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load double, double* %2
%8 = fneg double %7
store double %8, double* %2
br label %9
9: ; preds = %6, %0
%10 = load double, double* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = fneg double %4
store double %7, double* %1
br label %8
8: ; preds = %6, %0
%9 = phi double [ %7, %6 ], [ %4, %0 ]
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TOSH_run_next_task();
void TOSH_run_task() {
  for (;;)
    TOSH_run_next_task();
}


x86 assembly (clang, -O0):
<TOSH_run_task>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <TOSH_run_task+0x9>
mov    $0x0,%al
call   1030 <TOSH_run_next_task@plt>
jmp    1119 <TOSH_run_task+0x9>

x86 assembly (clang, -O2):
<TOSH_run_task>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <TOSH_run_next_task@plt>
jmp    1120 <TOSH_run_task+0x10>

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

LLVM IR (-O2):
define void @TOSH_run_task() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @TOSH_run_next_task()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void udpClose(int udpSocket) { close(udpSocket); }


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

x86 assembly (clang, -O2):
<udpClose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @udpClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_coord_parms_deps(int);
int /*<<< orphan*/ set_coord_parms_nodeps(int);
void set_coord_parms(int defcoordlocal) {
  set_coord_parms_nodeps(defcoordlocal);
  set_coord_parms_deps(defcoordlocal);
}


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

x86 assembly (clang, -O2):
<set_coord_parms>:
push   %rbx
mov    %edi,%ebx
call   1040 <set_coord_parms_nodeps@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <set_coord_parms_deps@plt>

LLVM IR (-O0):
define void @set_coord_parms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @set_coord_parms_nodeps(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @set_coord_parms_deps(i32 %5)
ret void
}

LLVM IR (-O2):
define void @set_coord_parms(i32 %0) {
%2 = tail call i32 @set_coord_parms_nodeps(i32 %0)
%3 = tail call i32 @set_coord_parms_deps(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void errm(char *program) {
  fprintf(stderr, "%s: memory allocation error\n", program);
  exit(-1);
}


x86 assembly (clang, -O0):
<errm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errm>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"%s: memory allocation error\0A\00"
define void @errm(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: trx [-o outfile] [-m maxlen] [-a align] [-b offset] "
                  "[-f file] [-f file [-f file]]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [90 x i8] c"Usage: trx [-o outfile] [-m maxlen] [-a align] [-b offset] [-f file] [-f file [-f file]]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [90 x i8] c"Usage: trx [-o outfile] [-m maxlen] [-a align] [-b offset] [-f file] [-f file [-f file]]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fatal_error_with_errno(char *);
int pclose(int /*<<< orphan*/ *);
void xpclose(void *fp) {
  if (fp && pclose((FILE *)fp) == -1)
    fatal_error_with_errno("Failed to close pipe to output file");
}


x86 assembly (clang, -O0):
<xpclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1155 <xpclose+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <pclose@plt>
cmp    $0xffffffff,%eax
jne    1155 <xpclose+0x35>
lea    0xeb0(%rip),%rdi
call   1040 <fatal_error_with_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xpclose>:
test   %rdi,%rdi
je     1135 <xpclose+0x15>
push   %rax
call   1030 <pclose@plt>
cmp    $0xffffffff,%eax
lea    0x8(%rsp),%rsp
je     1136 <xpclose+0x16>
ret
lea    0xec3(%rip),%rdi
jmp    1040 <fatal_error_with_errno@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Failed to close pipe to output file\00"
define void @xpclose(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = call i32 @pclose(i32* %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %5, %1
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Failed to close pipe to output file\00"
define void @xpclose(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @pclose(i32* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void pmu_set_sleep_radio() {
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (14 << 9) | (14 << 5) | (1)));
  delay(200);
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (14 << 9) | (14 << 5) | (1)));
  delay(200);
  mbus_remote_register_write(
      0x6, 0x17, ((3 << 14) | (0 << 13) | (2 << 9) | (3 << 5) | (1)));
  delay(200);
}


x86 assembly (clang, -O0):
<pmu_set_sleep_radio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xddc1,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xddc1,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc461,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_set_sleep_radio>:
push   %rax
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xddc1,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xddc1,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xc461,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @pmu_set_sleep_radio() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56769)
%2 = call i32 @delay(i32 200)
%3 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56769)
%4 = call i32 @delay(i32 200)
%5 = call i32 @mbus_remote_register_write(i32 6, i32 23, i32 50273)
%6 = call i32 @delay(i32 200)
ret void
}

LLVM IR (-O2):
define void @pmu_set_sleep_radio() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56769)
%2 = tail call i32 @delay(i32 200)
%3 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56769)
%4 = tail call i32 @delay(i32 200)
%5 = tail call i32 @mbus_remote_register_write(i32 6, i32 23, i32 50273)
%6 = tail call i32 @delay(i32 200)
ret void
}
int main() {
  double val = 1 + 2.0;
  return (int)val;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 3.000000e+00, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ inc_only(unsigned char);
int /*<<< orphan*/ write_only(unsigned char);
void inc_write(unsigned char what) {
  inc_only(what);
  write_only(what);
}


x86 assembly (clang, -O0):
<inc_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <inc_only@plt>
movzbl -0x1(%rbp),%edi
call   1040 <write_only@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_write>:
push   %rbx
mov    %edi,%ebx
call   1030 <inc_only@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <write_only@plt>

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

LLVM IR (-O2):
define void @inc_write(i8 zeroext %0) {
%2 = tail call i32 @inc_only(i8 zeroext %0)
%3 = tail call i32 @write_only(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets2(char *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int getpwd(char *buf, int nbuf) {
  memset(buf, 0, nbuf);
  gets2(buf, nbuf);
  if (buf[0] == 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<getpwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <gets2@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1165 <getpwd+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <getpwd+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpwd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <gets2@plt>
cmpb   $0x1,(%rbx)
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getpwd(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
%4 = tail call i32 @gets2(i8* %0, i32 %1)
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
%7 = sext i1 %6 to i32
ret i32 %7
}
unsigned char read_di(int n) { return ((n % 2) == 0); }


x86 assembly (clang, -O0):
<read_di>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_di>:
mov    %edi,%eax
not    %al
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @read_di(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @read_di(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = and i8 %2, 1
%4 = xor i8 %3, 1
ret i8 %4
}
int hsh_string_compare(const void *key1, const void *key2) {
  if (!key1 || !key2)
    err_internal(__FUNCTION__,
                 "String-valued keys may not be NULL: key1=%p, key2=%p\n", key1,
                 key2);
  return strcmp((const char *)key1, (const char *)key2);
}


x86 assembly (clang, -O0):
<hsh_string_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <hsh_string_compare+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    1163 <hsh_string_compare+0x43>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeab(%rip),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x0,%al
call   1030 <err_internal@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hsh_string_compare>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
je     1134 <hsh_string_compare+0x14>
test   %r14,%r14
jne    114f <hsh_string_compare+0x2f>
lea    0xec5(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <err_internal@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcmp@plt>

LLVM IR (-O0):
@__FUNCTION__.hsh_string_compare = [19 x i8] c"hsh_string_compare\00"
@.str = [54 x i8] c"String-valued keys may not be NULL: key1=%p, key2=%p\0A\00"
define i32 @hsh_string_compare(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %7, %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @err_internal to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.hsh_string_compare, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
br label %14
14: ; preds = %10, %7
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = call i32 @strcmp(i8* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
@__FUNCTION__.hsh_string_compare = [19 x i8] c"hsh_string_compare\00"
@.str = [54 x i8] c"String-valued keys may not be NULL: key1=%p, key2=%p\0A\00"
define i32 @hsh_string_compare(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @err_internal to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.hsh_string_compare, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %8
8: ; preds = %2, %6
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %9
}
/* Variables and functions */
int exponent(double);
scalar_t__ mantissa(double);
scalar_t__ sign(double);
int isinf(double d) {
  if (exponent(d) == (0x7ffull << 52) && mantissa(d) == 0)
    return sign(d) ? -1 : 1;
  return 0;
}


x86 assembly (clang, -O0):
<isinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <exponent@plt>
cltq
movabs $0x7ff0000000000000,%rcx
cmp    %rcx,%rax
jne    1196 <isinf+0x66>
movsd  -0x10(%rbp),%xmm0
call   1050 <mantissa@plt>
cmp    $0x0,%rax
jne    1196 <isinf+0x66>
movsd  -0x10(%rbp),%xmm0
call   1030 <sign@plt>
mov    %rax,%rdx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    119d <isinf+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinf>:
push   %rax
call   1030 <exponent@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isinf(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i32 @exponent(double %4)
%6 = sext i32 %5 to i64
%7 = icmp eq i64 %6, 9218868437227405312
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load double, double* %3
%10 = call i64 @mantissa(double %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load double, double* %3
%14 = call i64 @sign(double %13)
%15 = icmp ne i64 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 -1, i32 1
store i32 %17, i32* %2
br label %19
18: ; preds = %8, %1
store i32 0, i32* %2
br label %19
19: ; preds = %18, %12
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @isinf(double %0) {
%2 = tail call i32 @exponent(double %0)
ret i32 0
}
/* Variables and functions */
unsigned long partial_crc32_one(int /*<<< orphan*/, unsigned long);
unsigned long partial_crc32(const char *s, unsigned long crc) {
  while (*s) {
    crc = partial_crc32_one(*s++, crc);
  }
  return crc;
}


x86 assembly (clang, -O0):
<partial_crc32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1151 <partial_crc32+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <partial_crc32_one@plt>
mov    %rax,-0x10(%rbp)
jmp    1120 <partial_crc32+0x10>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<partial_crc32>:
push   %rbx
mov    %rsi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1146 <partial_crc32+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%edi
mov    %rax,%rsi
call   1030 <partial_crc32_one@plt>
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <partial_crc32+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @partial_crc32(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = phi i64 [ %11, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = sext i8 %6 to i32
%11 = tail call i64 @partial_crc32_one(i32 %10, i64 %7)
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
%15 = phi i64 [ %1, %2 ], [ %11, %5 ]
ret i64 %15
}