xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void cli_print_prefix(const char *str, int len) {
  for (int i = 0; i < len; i++) {
    printf("%c", *str++);
  }
}


x86 assembly (clang, -O0):
<cli_print_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <cli_print_prefix+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <cli_print_prefix+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_print_prefix>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <cli_print_prefix+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <cli_print_prefix+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @cli_print_prefix(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, %1
br i1 %13, label %4, label %5
}
/* Variables and functions */
int getchar();
void incomment() {
  int c, d;
  c = getchar();
  d = getchar();
  while (c != '*' || d != '/') {
    c = d;
    d = getchar();
  }
}


x86 assembly (clang, -O0):
<incomment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x2a,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1145 <incomment+0x35>
cmpl   $0x2f,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1155 <incomment+0x45>
jmp    116a <incomment+0x5a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    112c <incomment+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<incomment>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
nopl   0x0(%rax,%rax,1)
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x2a,%ebx
jne    1120 <incomment+0x10>
cmp    $0x2f,%eax
jne    1120 <incomment+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @incomment() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 42
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 47
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = load i32, i32* %2
store i32 %14, i32* %1
%15 = call i32 (...) @getchar()
store i32 %15, i32* %2
br label %5
16: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @incomment() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %1, 42
%4 = icmp ne i32 %2, 47
%5 = or i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = phi i32 [ %8, %6 ], [ %2, %0 ]
%8 = tail call i32 (...) @getchar()
%9 = icmp ne i32 %7, 42
%10 = icmp ne i32 %8, 47
%11 = or i1 %9, %10
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perrordie(char *);
char *strndup(char const *, size_t);
char *safe_strndup(const char *s, size_t n) {
  char *r = strndup(s, n);
  if (r == NULL)
    perrordie("strndup");
  return r;
}


x86 assembly (clang, -O0):
<safe_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strndup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <safe_strndup+0x38>
lea    0xead(%rip),%rdi
call   1040 <perrordie@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_strndup>:
push   %rbx
call   1030 <strndup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <safe_strndup+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <perrordie@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"strndup\00"
define noalias i8* @safe_strndup(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @strndup(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perrordie(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int uid_t;
struct passwd {
  int pw_uid;
};

/* Variables and functions */
int /*<<< orphan*/ getlogin();
struct passwd *getpwnam(int /*<<< orphan*/);
uid_t getuid(void) {
  struct passwd *p;
  p = getpwnam(getlogin());
  return p ? p->pw_uid : 1;
}


x86 assembly (clang, -O0):
<getuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getlogin@plt>
mov    %eax,%edi
call   1030 <getpwnam@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <getuid+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    1160 <getuid+0x40>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1160 <getuid+0x40>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getuid>:
push   %rax
xor    %eax,%eax
call   1040 <getlogin@plt>
mov    %eax,%edi
call   1030 <getpwnam@plt>
test   %rax,%rax
je     1138 <getuid+0x18>
mov    (%rax),%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i32 @getuid() {
%1 = alloca %struct.passwd*
%2 = call i32 (...) @getlogin()
%3 = call %struct.passwd* @getpwnam(i32 %2)
store %struct.passwd* %3, %struct.passwd** %1
%4 = load %struct.passwd*, %struct.passwd** %1
%5 = icmp ne %struct.passwd* %4, null
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load %struct.passwd*, %struct.passwd** %1
%8 = getelementptr inbounds %struct.passwd, %struct.passwd* %7, i32 0, i32 0
%9 = load i32, i32* %8
br label %11
10: ; preds = %0
br label %11
11: ; preds = %10, %6
%12 = phi i32 [ %9, %6 ], [ 1, %10 ]
ret i32 %12
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i32 @getuid() {
%1 = tail call i32 (...) @getlogin()
%2 = tail call %struct.passwd* @getpwnam(i32 %1)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i32, i32* %5
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ %6, %4 ], [ 1, %0 ]
ret i32 %8
}
/* Variables and functions */
char *Malloc(scalar_t__);
char *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *Strdup(const char *str) {
  char *result;
  if (str == NULL)
    return NULL;
  else
    result = Malloc(strlen(str) + 1);
  return strcpy(result, str);
}


x86 assembly (clang, -O0):
<Strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <Strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    117e <Strdup+0x4e>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1030 <Malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <Strdup+0x2a>
mov    %rdi,%rbx
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1030 <Malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
jmp    115d <Strdup+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @Strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %17
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = call i8* @Malloc(i64 %11)
store i8* %12, i8** %4
br label %13
13: ; preds = %8
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = call i8* @strcpy(i8* %14, i8* %15)
store i8* %16, i8** %2
br label %17
17: ; preds = %13, %7
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @Strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @Malloc(i64 %5)
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
double light_convert_density(struct device *in, double start, double width) {
  double ratio = 0.0;
  return ratio;
}


x86 assembly (clang, -O0):
<light_convert_density>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<light_convert_density>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
%struct.device = type opaque
define double @light_convert_density(%struct.device* %0, double %1, double %2) {
%4 = alloca %struct.device*
%5 = alloca double
%6 = alloca double
%7 = alloca double
store %struct.device* %0, %struct.device** %4
store double %1, double* %5
store double %2, double* %6
store double 0.000000e+00, double* %7
%8 = load double, double* %7
ret double %8
}

LLVM IR (-O2):
%struct.device = type opaque
define double @light_convert_density(%struct.device* nocapture readnone %0, double %1, double %2) {
ret double 0.000000e+00
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t nats_GetVersionNumber(void) { return ((1 << 16) | (5 << 8) | 0); }


x86 assembly (clang, -O0):
<nats_GetVersionNumber>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10500,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @nats_GetVersionNumber() {
ret i32 66816
}

LLVM IR (-O2):
define i32 @nats_GetVersionNumber() {
ret i32 66816
}
/* Type definitions */
typedef int /*<<< orphan*/ frame;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int, int);
void grow(int depth) {
  volatile char frame[4096];
  memset((char *)frame, 0xff, sizeof(frame));
  if (depth > 1)
    grow(depth - 1);
}


x86 assembly (clang, -O0):
<grow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x1010(%rbp),%rdi
mov    $0xff,%esi
mov    $0x1000,%edx
call   1040 <memset@plt>
cmpl   $0x1,-0x4(%rbp)
jle    1159 <grow+0x39>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <grow@plt>
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grow>:
push   %rbx
sub    $0x1000,%rsp
mov    %edi,%ebx
mov    %rsp,%rdi
mov    $0xff,%esi
mov    $0x1000,%edx
call   1040 <memset@plt>
cmp    $0x2,%ebx
jl     114b <grow+0x2b>
add    $0xffffffff,%ebx
mov    %ebx,%edi
call   1030 <grow@plt>
add    $0x1000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @grow(i32 %0) {
%2 = alloca i32
%3 = alloca [4096 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 255, i32 4096)
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 1
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @grow(i32 %0) {
%2 = alloca [4096 x i8]
%3 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 255, i32 4096)
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = add nsw i32 %0, -1
br label %8
8: ; preds = %6, %1
ret void
}
long long szsu() { return 0xffff0000ffff7fffLL; }


x86 assembly (clang, -O0):
<szsu>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff0000ffff7fff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<szsu>:
movabs $0xffff0000ffff7fff,%rax
ret

LLVM IR (-O0):
define i64 @szsu() {
ret i64 -281470681776129
}

LLVM IR (-O2):
define i64 @szsu() {
ret i64 -281470681776129
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ x54x_in(int, void *);
uint8_t x54x_read(uint32_t port, void *priv) {
  return (x54x_in(port & 3, priv));
}


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

x86 assembly (clang, -O2):
<x54x_read>:
and    $0x3,%edi
jmp    1030 <x54x_in@plt>

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

LLVM IR (-O2):
define i32 @x54x_read(i32 %0, i8* %1) {
%3 = and i32 %0, 3
%4 = tail call i32 @x54x_in(i32 %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ assert(int);
int main(int argc, char **argv) {
  assert(add(42, 1337) == 1379);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2a,%edi
mov    $0x539,%esi
call   1030 <add@plt>
cmp    $0x563,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
mov    $0x539,%esi
call   1030 <add@plt>
xor    %edi,%edi
cmp    $0x563,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @add(i32 42, i32 1337)
%7 = icmp eq i32 %6, 1379
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 42, i32 1337)
%4 = icmp eq i32 %3, 1379
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i32 0
}
/* Variables and functions */
int ENOSYS;
int hwconfig_sub(const char *opt, const char *subopt) { return -ENOSYS; }


x86 assembly (clang, -O0):
<hwconfig_sub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hwconfig_sub>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @hwconfig_sub(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @hwconfig_sub(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
size_t anna_size_round(size_t v) {
  v--;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  v++;
  return v;
}


x86 assembly (clang, -O0):
<anna_size_round>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<anna_size_round>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rdx
shr    $0x8,%rdx
or     %rcx,%rdx
mov    %rdx,%rax
shr    $0x10,%rax
or     %rdx,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @anna_size_round(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, -1
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 1
%7 = load i64, i64* %2
%8 = or i64 %7, %6
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = lshr i64 %9, 2
%11 = load i64, i64* %2
%12 = or i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = lshr i64 %13, 4
%15 = load i64, i64* %2
%16 = or i64 %15, %14
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = lshr i64 %17, 8
%19 = load i64, i64* %2
%20 = or i64 %19, %18
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = lshr i64 %21, 16
%23 = load i64, i64* %2
%24 = or i64 %23, %22
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = add i64 %25, 1
store i64 %26, i64* %2
%27 = load i64, i64* %2
ret i64 %27
}

LLVM IR (-O2):
define i64 @anna_size_round(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = add i64 %12, 1
ret i64 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_or_si128(int /*<<< orphan*/, int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_set1_epi32(int);
int /*<<< orphan*/ _mm_srli_epi32(int /*<<< orphan*/, int);
__m128 random_bits_to_uniform_1_2(__m128i random_bits) {
  const __m128i SP_MASK = _mm_set1_epi32(0x3F800000);
  return (__m128)_mm_or_si128(_mm_srli_epi32(random_bits, 9), SP_MASK);
}


x86 assembly (clang, -O0):
<random_bits_to_uniform_1_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3f800000,%edi
call   1030 <_mm_set1_epi32@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x9,%esi
call   1050 <_mm_srli_epi32@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
call   1040 <_mm_or_si128@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_bits_to_uniform_1_2>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x3f800000,%edi
call   1030 <_mm_set1_epi32@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x9,%esi
call   1050 <_mm_srli_epi32@plt>
mov    %eax,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_mm_or_si128@plt>

LLVM IR (-O0):
define i32 @random_bits_to_uniform_1_2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @_mm_set1_epi32(i32 1065353216)
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = call i32 @_mm_srli_epi32(i32 %5, i32 9)
%7 = load i32, i32* %3
%8 = call i32 @_mm_or_si128(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @random_bits_to_uniform_1_2(i32 %0) {
%2 = tail call i32 @_mm_set1_epi32(i32 1065353216)
%3 = tail call i32 @_mm_srli_epi32(i32 %0, i32 9)
%4 = tail call i32 @_mm_or_si128(i32 %3, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int sockresolve(char const *, char const *, int /*<<< orphan*/ *,
                int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/,
                int);
int tcpresolve(const char *hostname, const char *service, uint32_t *ip,
               uint16_t *port, int passive) {
  return sockresolve(hostname, service, ip, port, AF_INET, SOCK_STREAM,
                     passive);
}


x86 assembly (clang, -O0):
<tcpresolve>:
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    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    0x2ea5(%rip),%rax
mov    (%rax),%r8d
mov    0x2e8b(%rip),%rax
mov    (%rax),%r9d
mov    -0x24(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <sockresolve@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpresolve>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%r10d
mov    0x2eb6(%rip),%rax
mov    (%rax),%r9d
mov    %r8d,(%rsp)
mov    %r10d,%r8d
call   1030 <sockresolve@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @tcpresolve(i8* %0, i8* %1, i32* %2, i32* %3, i32 %4) {
%6 = load i32, i32* @AF_INET
%7 = load i32, i32* @SOCK_STREAM
%8 = tail call i32 @sockresolve(i8* %0, i8* %1, i32* %2, i32* %3, i32 %6, i32 %7, i32 %4)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pot(int base, int exp) {
  if (exp == 0)
    return 1;
  else if (exp == 1)
    return base;
  printf("oi\n");
  return base * pot(base, exp - 1);
}


x86 assembly (clang, -O0):
<pot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1144 <pot+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1189 <pot+0x69>
cmpl   $0x1,-0xc(%rbp)
jne    1159 <pot+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <pot+0x69>
jmp    115e <pot+0x3e>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <pot@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pot>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%r15d
mov    $0x1,%ebx
lea    0xed8(%rip),%r14
test   %ebp,%ebp
je     1148 <pot+0x38>
nopl   0x0(%rax)
cmp    $0x1,%ebp
je     114e <pot+0x3e>
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebp
imul   %r15d,%ebx
test   %ebp,%ebp
jne    1130 <pot+0x20>
mov    $0x1,%r15d
imul   %ebx,%r15d
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@str = [3 x i8] c"oi\00"
define i32 @pot(i32 %0, i32 %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i32 [ 1, %2 ], [ %9, %6 ]
%5 = phi i32 [ %1, %2 ], [ %8, %6 ]
switch i32 %5, label %6 [
i32 0, label %10
i32 1, label %11
]
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%8 = add nsw i32 %5, -1
%9 = mul nsw i32 %4, %0
br label %3
10: ; preds = %3
br label %11
11: ; preds = %3, %10
%12 = phi i32 [ 1, %10 ], [ %0, %3 ]
%13 = mul nsw i32 %12, %4
ret i32 %13
}
/* Type definitions */
typedef scalar_t__ off_t;
typedef scalar_t__ expect;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ lseek(int, scalar_t__, int);
scalar_t__ readchar(int);
void check_lseek(int fd, off_t offset, int whence, off_t expect) {
  assert(lseek(fd, offset, whence) == expect);
  assert(readchar(fd) == ((expect) + 32));
}


x86 assembly (clang, -O0):
<check_lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <lseek@plt>
cmp    -0x20(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
call   1030 <readchar@plt>
mov    -0x20(%rbp),%rcx
add    $0x20,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_lseek>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edi,%ebp
call   1040 <lseek@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
call   1050 <assert@plt>
mov    %ebp,%edi
call   1030 <readchar@plt>
add    $0x20,%rbx
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <assert@plt>

LLVM IR (-O0):
define void @check_lseek(i32 %0, i64 %1, i32 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32
%8 = alloca i64
store i32 %0, i32* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i64, i64* %6
%11 = load i32, i32* %7
%12 = call i64 @lseek(i32 %9, i64 %10, i32 %11)
%13 = load i64, i64* %8
%14 = icmp eq i64 %12, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %5
%18 = call i64 @readchar(i32 %17)
%19 = load i64, i64* %8
%20 = add nsw i64 %19, 32
%21 = icmp eq i64 %18, %20
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
ret void
}

LLVM IR (-O2):
define void @check_lseek(i32 %0, i64 %1, i32 %2, i64 %3) {
%5 = tail call i64 @lseek(i32 %0, i64 %1, i32 %2)
%6 = icmp eq i64 %5, %3
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i64 @readchar(i32 %0)
%10 = add nsw i64 %3, 32
%11 = icmp eq i64 %9, %10
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
ret void
}
/* Type definitions */
struct fsm {
  int dummy;
};

/* Variables and functions */
struct fsm *fsm_concat(struct fsm *, struct fsm *);
struct fsm *fsm_universal();
struct fsm *fsm_contains(struct fsm *net) {
  struct fsm *net2;
  net2 = fsm_concat(fsm_concat(fsm_universal(), net), fsm_universal());
  return (net2);
}


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

x86 assembly (clang, -O2):
<fsm_contains>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <fsm_universal@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <fsm_concat@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <fsm_universal@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <fsm_concat@plt>

LLVM IR (-O0):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_contains(%struct.fsm* %0) {
%2 = alloca %struct.fsm*
%3 = alloca %struct.fsm*
store %struct.fsm* %0, %struct.fsm** %2
%4 = call %struct.fsm* (...) @fsm_universal()
%5 = load %struct.fsm*, %struct.fsm** %2
%6 = call %struct.fsm* @fsm_concat(%struct.fsm* %4, %struct.fsm* %5)
%7 = call %struct.fsm* (...) @fsm_universal()
%8 = call %struct.fsm* @fsm_concat(%struct.fsm* %6, %struct.fsm* %7)
store %struct.fsm* %8, %struct.fsm** %3
%9 = load %struct.fsm*, %struct.fsm** %3
ret %struct.fsm* %9
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_contains(%struct.fsm* %0) {
%2 = tail call %struct.fsm* (...) @fsm_universal()
%3 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %2, %struct.fsm* %0)
%4 = tail call %struct.fsm* (...) @fsm_universal()
%5 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %3, %struct.fsm* %4)
ret %struct.fsm* %5
}
/* Variables and functions */
int /*<<< orphan*/ rm_trailing_chars(char *, char *);
void chomp(char *str) { rm_trailing_chars(str, "\r\n"); }


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

x86 assembly (clang, -O2):
<chomp>:
lea    0xee9(%rip),%rsi
jmp    1030 <rm_trailing_chars@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @chomp(i8* %0) {
%2 = tail call i32 @rm_trailing_chars(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
int get_bit_num(int bitmask) {
  int bit = 0;
  if (bitmask == 0)
    return 0;
  while (bitmask > 0) {
    if (bitmask & 1 == 0)
      bit++;
    else
      break;
    bitmask >>= 1;
  }
  return bit;
}


x86 assembly (clang, -O0):
<get_bit_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <get_bit_num+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1169 <get_bit_num+0x69>
jmp    1129 <get_bit_num+0x29>
cmpl   $0x0,-0x8(%rbp)
jle    1163 <get_bit_num+0x63>
mov    -0x8(%rbp),%eax
and    $0x0,%eax
cmp    $0x0,%eax
je     1150 <get_bit_num+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <get_bit_num+0x55>
jmp    1163 <get_bit_num+0x63>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <get_bit_num+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_bit_num(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_split_spaces_strv() {
  printf("NOT IMPLEMENTED:"
         "pa_split_spaces_strv"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"NOT IMPLEMENTED:pa_split_spaces_strv\0A\00"
define i32 @pa_split_spaces_strv() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_split_spaces_strv\00"
define i32 @pa_split_spaces_strv() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char const *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
FILE *fopena(char *path, char *name, const char *mode) {
  char wholename[200];
  strcpy(wholename, path);
  strcat(wholename, name);
  FILE *pointer;
  pointer = fopen(wholename, mode);
  return pointer;
}


x86 assembly (clang, -O0):
<fopena>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xe0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0xe0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0xe8(%rbp)
mov    -0xe8(%rbp),%rax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopena>:
push   %r15
push   %r14
push   %rbx
sub    $0xd0,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <fopen@plt>
add    $0xd0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @fopena(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [200 x i8]
%8 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%13 = load i8*, i8** %5
%14 = call i32 @strcat(i8* %12, i8* %13)
%15 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%16 = load i8*, i8** %6
%17 = call i32* @fopen(i8* %15, i8* %16)
store i32* %17, i32** %8
%18 = load i32*, i32** %8
ret i32* %18
}

LLVM IR (-O2):
define noalias i32* @fopena(i8* %0, i8* %1, i8* nocapture %2) {
%4 = alloca [200 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%6 = call i32 @strcpy(i8* %5, i8* %0)
%7 = call i32 @strcat(i8* %5, i8* %1)
%8 = call i32* @fopen(i8* %5, i8* %2)
ret i32* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int askValue() {
  int value;
  printf("Enter a value : ");
  scanf("%d", &value);
  return value;
}


x86 assembly (clang, -O0):
<askValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<askValue>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a value : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @askValue() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a value : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @askValue() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
int main() {
  for (1; 2; 3) {
    456;
  }
  for (;;) {
    789;
  }
  for (; 0;) {
    987;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    111a <main+0x1a>
jmp    1124 <main+0x24>
jmp    111f <main+0x1f>
jmp    110b <main+0xb>
jmp    1129 <main+0x29>
jmp    1129 <main+0x29>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %4, %0
br i1 true, label %3, label %5
3: ; preds = %2
br label %4
4: ; preds = %3
br label %2
5: ; preds = %2
br label %6
6: ; preds = %6, %5
br label %6
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
int fchdir(int fd) {
  ;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @fchdir(i32 %0) {
ret i32 -1
}
/* Variables and functions */
void init_fatal_signals(void) {
  static bool fatal_signals_initialized = false;
  if (!fatal_signals_initialized) {
    fatal_signals_initialized = true;
  }
}


x86 assembly (clang, -O0):
<init_fatal_signals>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f19(%rip)
jne    111b <init_fatal_signals+0x1b>
movl   $0x1,0x2f09(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_fatal_signals>:
cmpb   $0x0,0x2f1d(%rip)
jne    1110 <init_fatal_signals+0x10>
movb   $0x1,0x2f14(%rip)
ret

LLVM IR (-O0):
@init_fatal_signals.fatal_signals_initialized = internal global i32 0
define void @init_fatal_signals() {
%1 = load i32, i32* @init_fatal_signals.fatal_signals_initialized
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
store i32 1, i32* @init_fatal_signals.fatal_signals_initialized
br label %4
4: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@init_fatal_signals.fatal_signals_initialized = internal unnamed_addr global i1 false
define void @init_fatal_signals() {
%1 = load i1, i1* @init_fatal_signals.fatal_signals_initialized
br i1 %1, label %3, label %2
2: ; preds = %0
store i1 true, i1* @init_fatal_signals.fatal_signals_initialized
br label %3
3: ; preds = %2, %0
ret void
}
double RadiansToDegrees(const double radians) {
  return ((double)(180.0 * radians /
                   3.14159265358979323846264338327950288419716939937510));
}


x86 assembly (clang, -O0):
<RadiansToDegrees>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<RadiansToDegrees>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @RadiansToDegrees(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 1.800000e+02, %3
%5 = fdiv double %4, 0x400921FB54442D18
ret double %5
}

LLVM IR (-O2):
define double @RadiansToDegrees(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = fdiv double %2, 0x400921FB54442D18
ret double %3
}
double foo(double x) { return x + 1.75; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.750000e+00
ret double %4
}

LLVM IR (-O2):
define double @foo(double %0) {
%2 = fadd double %0, 1.750000e+00
ret double %2
}
void setx(int *x, int *y) { *y = *x; }


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

x86 assembly (clang, -O2):
<setx>:
mov    (%rdi),%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @setx(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("tesy 0xFFF");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"tesy 0xFFF\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"tesy 0xFFF\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double foo(double x) { return x * x / 3.0; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mulsd  %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = fdiv double %5, 3.000000e+00
ret double %6
}

LLVM IR (-O2):
define double @foo(double %0) {
%2 = fmul double %0, %0
%3 = fdiv double %2, 3.000000e+00
ret double %3
}
/* Variables and functions */
int ap_do_command_only(int, int);
int ap_stop(int session) { return (ap_do_command_only(session, 0xcc01)); }


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

x86 assembly (clang, -O2):
<ap_stop>:
mov    $0xcc01,%esi
jmp    1030 <ap_do_command_only@plt>

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

LLVM IR (-O2):
define i32 @ap_stop(i32 %0) {
%2 = tail call i32 @ap_do_command_only(i32 %0, i32 52225)
ret i32 %2
}
void RTTestIValueF(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestIValueF() {
ret void
}
int pt_compare_min(const char *a, const char *b) {
  unsigned int _a = *(unsigned int *)a;
  unsigned int _b = *(unsigned int *)b;
  if (_a < _b)
    return -1;
  else if (_a > _b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<pt_compare_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jae    1136 <pt_compare_min+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <pt_compare_min+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jbe    114e <pt_compare_min+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <pt_compare_min+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pt_compare_min>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @pt_compare_min(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ult i32 %4, %6
%8 = icmp ugt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void SSMR3PutSel(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutSel() {
ret void
}