xunge/DecIR huggingface dataset:
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
long tm_normalize(struct tm *);
long int tm_diffseconds(struct tm debut, struct tm fin) {
  return tm_normalize(&fin) - tm_normalize(&debut);
}


x86 assembly (clang, -O0):
<tm_diffseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <tm_normalize@plt>
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <tm_normalize@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tm_diffseconds>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0x8(%rsp)
mov    %esi,(%rsp)
mov    %rsp,%rdi
call   1030 <tm_normalize@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%rdi
call   1030 <tm_normalize@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i64 @tm_diffseconds(i32 %0, i32 %1) {
%3 = alloca %struct.tm
%4 = alloca %struct.tm
%5 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
store i32 %1, i32* %6
%7 = call i64 @tm_normalize(%struct.tm* %4)
%8 = call i64 @tm_normalize(%struct.tm* %3)
%9 = sub nsw i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i64 @tm_diffseconds(i32 %0, i32 %1) {
%3 = alloca %struct.tm
%4 = alloca %struct.tm
%5 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
store i32 %1, i32* %6
%7 = call i64 @tm_normalize(%struct.tm* %4)
%8 = call i64 @tm_normalize(%struct.tm* %3)
%9 = sub nsw i64 %7, %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFD;
scalar_t__ fcntl(int, int /*<<< orphan*/);
scalar_t__ strtol(char const *, int /*<<< orphan*/ *, int);
int util_getfd(const char *fdstr) {
  int fd;
  if (fdstr == NULL)
    return -1;
  fd = (int)strtol(fdstr, NULL, 10);
  if (fcntl(fd, F_GETFD) < 0)
    return -1;
  return fd;
}


x86 assembly (clang, -O0):
<util_getfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <util_getfd+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <util_getfd+0x65>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
cmp    $0x0,%rax
jge    117f <util_getfd+0x5f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <util_getfd+0x65>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_getfd>:
test   %rdi,%rdi
je     1152 <util_getfd+0x32>
push   %rbx
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,%rbx
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1030 <fcntl@plt>
test   %rax,%rax
mov    $0xffffffff,%eax
cmovns %ebx,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@F_GETFD = global i32 0
define i32 @util_getfd(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
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 i32 -1, i32* %2
br label %19
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strtol(i8* %9, i32* null, i32 10)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* @F_GETFD
%14 = call i64 @fcntl(i32 %12, i32 %13)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %8
store i32 -1, i32* %2
br label %19
17: ; preds = %8
%18 = load i32, i32* %4
store i32 %18, i32* %2
br label %19
19: ; preds = %17, %16, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@F_GETFD = global i32 0
define i32 @util_getfd(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%5 = trunc i64 %4 to i32
%6 = load i32, i32* @F_GETFD
%7 = tail call i64 @fcntl(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
%9 = select i1 %8, i32 -1, i32 %5
br label %10
10: ; preds = %3, %1
%11 = phi i32 [ -1, %1 ], [ %9, %3 ]
ret i32 %11
}
void odp_sync_stores(void) { __asm__ __volatile__("sfence\n" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @odp_sync_stores() {
tail call void asm sideeffect "sfence\0A", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int test_imm_0Buint8_reg(unsigned char val) {
  return ((val) & (-0x0B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Buint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xfffffff5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_0Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -11
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int c, nl;
  nl = 0;
  while ((c = getchar()) != EOF)
    if (c == '\n')
      ++nl;
  printf("%d\n", nl);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     1167 <main+0x47>
cmpl   $0xa,-0x8(%rbp)
jne    1162 <main+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb4(%rip),%r14
cmp    (%r14),%eax
je     1156 <main+0x36>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stderr;
int usage(void) {
  fprintf(stderr,
          "Usage: igzip_semi_dynamic [options] <infile>\n"
          "  -h        help\n"
          "  -v        (don't) validate output by inflate and compare\n"
          "  -t <type> 1:stateless 0:(default)stateful\n"
          "  -c <size> chunk size default=%d\n"
          "  -s <size> sample size default=%d\n"
          "  -o <file> output file\n",
          (512 * 1024), (32 * 1024));
  exit(0);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [259 x i8] c"Usage: igzip_semi_dynamic [options] <infile>\0A -h help\0A -v (don't) validate output by inflate and compare\0A -t <type> 1:stateless 0:(default)stateful\0A -c <size> chunk size default=%d\0A -s <size> sample size default=%d\0A -o <file> output file\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([259 x i8], [259 x i8]* @.str, i64 0, i64 0), i32 524288, i32 32768)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [259 x i8] c"Usage: igzip_semi_dynamic [options] <infile>\0A -h help\0A -v (don't) validate output by inflate and compare\0A -t <type> 1:stateless 0:(default)stateful\0A -c <size> chunk size default=%d\0A -s <size> sample size default=%d\0A -o <file> output file\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([259 x i8], [259 x i8]* @.str, i64 0, i64 0), i32 524288, i32 32768)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ f();
int main() {
  int y;
  int *p;
  y = 10;
  f();
  y += 7;
  y = y & 10;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    -0x8(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xa,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
%4 = call i32 (...) @f()
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 7
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = and i32 %7, 10
store i32 %8, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 0
}
/* Variables and functions */
bool nrf51_errata_72(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_72() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void b8put(uint32_t x, char *ptr) {
  int digit;
  *--ptr = 0;
  while (x) {
    digit = x & 7;
    x /= 8;
    *--ptr = '0' + digit;
  }
}


x86 assembly (clang, -O0):
<b8put>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,-0x1(%rax)
cmpl   $0x0,-0x4(%rbp)
je     115e <b8put+0x5e>
mov    -0x4(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
jmp    111e <b8put+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b8put>:
movb   $0x0,-0x1(%rsi)
test   %edi,%edi
je     1133 <b8put+0x33>
add    $0xfffffffffffffffe,%rsi
nopl   0x0(%rax)
lea    0x7(%rdi),%eax
test   %edi,%edi
mov    %edi,%ecx
cmovs  %eax,%ecx
sar    $0x3,%ecx
and    $0x7,%dil
or     $0x30,%dil
mov    %dil,(%rsi)
add    $0xffffffffffffffff,%rsi
mov    %ecx,%edi
cmp    $0xe,%eax
ja     1110 <b8put+0x10>
ret

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

LLVM IR (-O2):
define void @b8put(i32 %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 -1
store i8 0, i8* %3
%4 = icmp eq i32 %0, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %0, %2 ]
%7 = phi i8* [ %12, %5 ], [ %3, %2 ]
%8 = sdiv i32 %6, 8
%9 = trunc i32 %6 to i8
%10 = and i8 %9, 7
%11 = or i8 %10, 48
%12 = getelementptr inbounds i8, i8* %7, i64 -1
store i8 %11, i8* %12
%13 = add i32 %6, 7
%14 = icmp ult i32 %13, 15
br i1 %14, label %15, label %5
15: ; preds = %5, %2
ret void
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_timetzfunc1(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_timetzfunc1() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_timetzfunc1() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ conditional(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ printf(char *);
int ifFile(FILE *fp, char *err, int errlen) {
  printf("[if (");
  if (conditional(fp, err, errlen))
    return 1;
  printf(")]\n");
  return 0;
}


x86 assembly (clang, -O0):
<ifFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <conditional@plt>
cmp    $0x0,%rax
je     1165 <ifFile+0x45>
movl   $0x1,-0x4(%rbp)
jmp    1178 <ifFile+0x58>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifFile>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1050 <conditional@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1172 <ifFile+0x42>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"[if (\00"
@str = [3 x i8] c")]\00"
define i32 @ifFile(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i64 @conditional(i32* %0, i8* %1, i32 %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %10
}
void w1() {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<w1>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <w1+0x9>
jmp    1109 <w1+0x9>

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

LLVM IR (-O0):
define void @w1() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @w1() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int ed25519_verify(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
                   int /*<<< orphan*/ const *, size_t);
bool eddsa_verify(const uint8_t sig[64], const uint8_t pub[32],
                  const uint8_t *data, size_t len) {
  return ed25519_verify(sig, pub, data, len);
}


x86 assembly (clang, -O0):
<eddsa_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <ed25519_verify@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eddsa_verify>:
jmp    1030 <ed25519_verify@plt>

LLVM IR (-O0):
define i32 @eddsa_verify(i32* %0, i32* %1, i32* %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i64
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i64 %3, i64* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load i64, i64* %8
%13 = call i32 @ed25519_verify(i32* %9, i32* %10, i32* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @eddsa_verify(i32* %0, i32* %1, i32* %2, i64 %3) {
%5 = tail call i32 @ed25519_verify(i32* %0, i32* %1, i32* %2, i64 %3)
ret i32 %5
}
void sigint_handler(int sig) { return; }


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

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

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

LLVM IR (-O2):
define void @sigint_handler(i32 %0) {
ret void
}
void message(subject, name) char *subject, *name;
{ message_1("", subject, name); }


x86 assembly (clang, -O0):
<message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <message_1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
xor    %eax,%eax
jmp    1030 <message_1@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @message(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 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @message_1 to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @message(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @message_1 to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int distancia_subcadena(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char *str1 = "casa";
  char *str2 = "caso";
  printf("%d\n", distancia_subcadena(str1, str2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <distancia_subcadena@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1040 <distancia_subcadena@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"casa\00"
@.str.1 = [5 x i8] c"caso\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @distancia_subcadena(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int f379(int *);
int f380(int *p) { return f379(p); }


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

x86 assembly (clang, -O2):
<f380>:
jmp    1030 <f379@plt>

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

LLVM IR (-O2):
define i32 @f380(i32* %0) {
%2 = tail call i32 @f379(i32* %0)
ret i32 %2
}
void av_hash_final_b64() {}


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

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

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

LLVM IR (-O2):
define void @av_hash_final_b64() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SSD1780_send_cmd_with_val(int, unsigned char);
void KaDisp_move_window_to_page(unsigned char page_n) {
  SSD1780_send_cmd_with_val(0xD3, (page_n * 8) & 0x3F);
}


x86 assembly (clang, -O0):
<KaDisp_move_window_to_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x3,%eax
and    $0x3f,%eax
mov    $0xd3,%edi
movzbl %al,%esi
call   1030 <SSD1780_send_cmd_with_val@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KaDisp_move_window_to_page>:
shl    $0x3,%dil
and    $0x38,%dil
movzbl %dil,%esi
mov    $0xd3,%edi
jmp    1030 <SSD1780_send_cmd_with_val@plt>

LLVM IR (-O0):
define void @KaDisp_move_window_to_page(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = mul nsw i32 %4, 8
%6 = and i32 %5, 63
%7 = trunc i32 %6 to i8
%8 = call i32 @SSD1780_send_cmd_with_val(i32 211, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @KaDisp_move_window_to_page(i8 zeroext %0) {
%2 = shl i8 %0, 3
%3 = and i8 %2, 56
%4 = tail call i32 @SSD1780_send_cmd_with_val(i32 211, i8 zeroext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ head(char *);
int /*<<< orphan*/ tail(char *);
void strip(char *buf) {
  head(buf);
  tail(buf);
}


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

x86 assembly (clang, -O2):
<strip>:
push   %rbx
mov    %rdi,%rbx
call   1040 <head@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <tail@plt>

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

LLVM IR (-O2):
define void @strip(i8* %0) {
%2 = tail call i32 @head(i8* %0)
%3 = tail call i32 @tail(i8* %0)
ret void
}
void logic(void) {
  int x = 0;
  x = 1 || 1;
  x = 1 && 1;
  x = !1;
}


x86 assembly (clang, -O0):
<logic>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @logic() {
ret void
}
/* Variables and functions */
char *hydrology_library_get_datatype_units(char *, char *);
char *hydrology_library_get_flow_units(char *application_name) {
  return hydrology_library_get_datatype_units(application_name, "flow");
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"flow\00"
define i8* @hydrology_library_get_flow_units(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @hydrology_library_get_datatype_units(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"flow\00"
define i8* @hydrology_library_get_flow_units(i8* %0) {
%2 = tail call i8* @hydrology_library_get_datatype_units(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int RAND_MAX;
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
double randomDouble() {
  static bool initialized = false;
  if (!initialized) {
    srand(time(NULL));
    initialized = true;
  }
  return (double)(rand() - 1) / (RAND_MAX - 1);
}


x86 assembly (clang, -O0):
<randomDouble>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f01(%rip)
jne    115b <randomDouble+0x2b>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x1,0x2ee1(%rip)
mov    $0x0,%al
call   1050 <rand@plt>
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomDouble>:
push   %rax
cmpb   $0x0,0x2f04(%rip)
jne    114f <randomDouble+0x1f>
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movb   $0x1,0x2eed(%rip)
xor    %eax,%eax
call   1050 <rand@plt>
add    $0xffffffff,%eax
cvtsi2sd %eax,%xmm0
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
add    $0xffffffff,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@randomDouble.initialized = internal global i32 0
@RAND_MAX = global i32 0
define double @randomDouble() {
%1 = load i32, i32* @randomDouble.initialized
%2 = icmp ne i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
store i32 1, i32* @randomDouble.initialized
br label %6
6: ; preds = %3, %0
%7 = call i32 (...) @rand()
%8 = sub nsw i32 %7, 1
%9 = sitofp i32 %8 to double
%10 = load i32, i32* @RAND_MAX
%11 = sub nsw i32 %10, 1
%12 = sitofp i32 %11 to double
%13 = fdiv double %9, %12
ret double %13
}

LLVM IR (-O2):
@randomDouble.initialized = internal unnamed_addr global i1 false
@RAND_MAX = global i32 0
define double @randomDouble() {
%1 = load i1, i1* @randomDouble.initialized
br i1 %1, label %5, label %2
2: ; preds = %0
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
store i1 true, i1* @randomDouble.initialized
br label %5
5: ; preds = %2, %0
%6 = tail call i32 (...) @rand()
%7 = add nsw i32 %6, -1
%8 = sitofp i32 %7 to double
%9 = load i32, i32* @RAND_MAX
%10 = add nsw i32 %9, -1
%11 = sitofp i32 %10 to double
%12 = fdiv double %8, %11
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(int argc, char *argv[]) {
  char a1 = 0;
  char a2 = 0;
#pragma omp sections shared(a1, a2)
  {
#pragma omp section
    { a1 = 1; }
#pragma omp section
    { a2 = 1; }
  }
  if (!a1 || !a2)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movb   $0x1,-0x11(%rbp)
movb   $0x1,-0x12(%rbp)
cmpb   $0x0,-0x11(%rbp)
je     114a <main+0x3a>
cmpb   $0x0,-0x12(%rbp)
jne    1151 <main+0x41>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ stdscr;
int smit_init() {
  initscr();
  noecho();
  keypad(stdscr, TRUE);
  curs_set(0);
  return 0;
}


x86 assembly (clang, -O0):
<smit_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x0,%al
call   1050 <noecho@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
call   1030 <keypad@plt>
xor    %edi,%edi
call   1060 <curs_set@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smit_init>:
push   %rax
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1050 <noecho@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
call   1030 <keypad@plt>
xor    %edi,%edi
call   1060 <curs_set@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define i32 @smit_init() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @noecho()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = call i32 @keypad(i32 %3, i32 %4)
%6 = call i32 @curs_set(i32 0)
ret i32 0
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define i32 @smit_init() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @TRUE
%5 = tail call i32 @keypad(i32 %3, i32 %4)
%6 = tail call i32 @curs_set(i32 0)
ret i32 0
}
int do_731() { return 731; }


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

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

LLVM IR (-O0):
define i32 @do_731() {
ret i32 731
}

LLVM IR (-O2):
define i32 @do_731() {
ret i32 731
}
int len(char *s) {
  int i;
  for (i = 0; s[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <len+0x37>
jmp    1129 <len+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
struct Value {
  int dummy;
};
struct ParseState {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ grab_frame();
void Cvcap(struct ParseState *Parser, struct Value *ReturnValue,
           struct Value **Param, int NumArgs) {
  grab_frame();
}


x86 assembly (clang, -O0):
<Cvcap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <grab_frame@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ParseState = type { i32 }
%struct.Value = type { i32 }
define void @Cvcap(%struct.ParseState* %0, %struct.Value* %1, %struct.Value** %2, i32 %3) {
%5 = alloca %struct.ParseState*
%6 = alloca %struct.Value*
%7 = alloca %struct.Value**
%8 = alloca i32
store %struct.ParseState* %0, %struct.ParseState** %5
store %struct.Value* %1, %struct.Value** %6
store %struct.Value** %2, %struct.Value*** %7
store i32 %3, i32* %8
%9 = call i32 (...) @grab_frame()
ret void
}

LLVM IR (-O2):
%struct.ParseState = type { i32 }
%struct.Value = type { i32 }
define void @Cvcap(%struct.ParseState* nocapture readnone %0, %struct.Value* nocapture readnone %1, %struct.Value** nocapture readnone %2, i32 %3) {
%5 = tail call i32 (...) @grab_frame()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void get_time_str(char *timestr, int len) {
  time_t now;
  time(&now);
  strftime(timestr, len, "%Y%m%d%H%M%S", localtime(&now));
}


x86 assembly (clang, -O0):
<get_time_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <time@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    %eax,%ecx
lea    0xe91(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_str>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xea7(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%ecx
call   1050 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%Y%m%d%H%M%S\00"
define void @get_time_str(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 @time(i32* %5)
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @localtime(i32* %5)
%10 = call i32 @strftime(i8* %7, i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%Y%m%d%H%M%S\00"
define void @get_time_str(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @time(i32* %3)
%6 = call i32 @localtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
int rand();
int slRandomLevel(void) {
  int level = 1;
  while ((rand() & 0xFFFF) < (0.5 * 0xFFFF))
    level += 1;
  return (level < 8) ? level : 8;
}


x86 assembly (clang, -O0):
<slRandomLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xec9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    114f <slRandomLevel+0x3f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <slRandomLevel+0xf>
cmpl   $0x8,-0x4(%rbp)
jge    1164 <slRandomLevel+0x54>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <slRandomLevel+0x61>
mov    $0x8,%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <slRandomLevel+0x61>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slRandomLevel>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <rand@plt>
add    $0x1,%ebx
test   $0x8000,%eax
je     1120 <slRandomLevel+0x10>
cmp    $0x8,%ebx
mov    $0x8,%eax
cmovb  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @slRandomLevel() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %7, %0
%3 = call i32 (...) @rand()
%4 = and i32 %3, 65535
%5 = sitofp i32 %4 to double
%6 = fcmp olt double %5, 3.276750e+04
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 8
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %1
br label %16
15: ; preds = %10
br label %16
16: ; preds = %15, %13
%17 = phi i32 [ %14, %13 ], [ 8, %15 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @slRandomLevel() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @rand()
%4 = and i32 %3, 32768
%5 = icmp eq i32 %4, 0
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %1, label %7
7: ; preds = %1
%8 = icmp ult i32 %2, 8
%9 = select i1 %8, i32 %2, i32 8
ret i32 %9
}
char *http_skip_break(char *ptr) {
  while (*ptr == '\r' || *ptr == '\n')
    ptr++;
  return ptr;
}


x86 assembly (clang, -O0):
<http_skip_break>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x9(%rbp)
je     112d <http_skip_break+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <http_skip_break+0x3d>
jmp    114e <http_skip_break+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <http_skip_break+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_skip_break>:
mov    %rdi,%rax
jmp    1114 <http_skip_break+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0xd,%cl
je     1110 <http_skip_break+0x10>
cmp    $0xa,%cl
je     1110 <http_skip_break+0x10>
ret

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

LLVM IR (-O2):
define i8* @http_skip_break(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 13, label %5
i8 10, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
int ReturnMixed(int value) {
  if (value == 1) {
    return 1;
  }
}


x86 assembly (clang, -O0):
<ReturnMixed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1118 <ReturnMixed+0x18>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ReturnMixed(i32 %0) {
ret i32 1
}
void loop_broke(void) {}


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

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

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

LLVM IR (-O2):
define void @loop_broke() {
ret void
}
void *square(void *val) {
  int *i = malloc(4), j = *((int *)val);
  *i = j * j;
  return i;
}


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    (%rbx),%ecx
imul   %ecx,%ecx
mov    %ecx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @square(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i8* @malloc(i64 4)
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = load i32*, i32** %3
store i32 %12, i32* %13
%14 = load i32*, i32** %3
%15 = bitcast i32* %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @square(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%3 = bitcast i8* %2 to i32*
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, %5
store i32 %6, i32* %3
ret i8* %2
}
extern int _read(int file_UNUSED __attribute__((__unused__)),
                 char *ptr_UNUSED __attribute__((__unused__)),
                 int len_UNUSED __attribute__((__unused__))) {
  return 0;
}


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @_read(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
int daysSince1582(int year) {
  return (year - 1583) * 365 + (year - 1581) / 4 - (year - 1501) / 100 +
         (year - 1201) / 400;
}


x86 assembly (clang, -O0):
<daysSince1582>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x62f,%eax
imul   $0x16d,%eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x62d,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x5dd,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x4b1,%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<daysSince1582>:
imul   $0x16d,%edi,%eax
lea    -0x62d(%rdi),%ecx
lea    -0x62a(%rdi),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
sar    $0x2,%edx
add    %eax,%edx
lea    -0x5dd(%rdi),%eax
cltq
imul   $0xffffffffae147ae1,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
add    %edx,%eax
add    $0xfffffb4f,%edi
movslq %edi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
add    %ecx,%eax
add    $0xfff72efd,%eax
ret

LLVM IR (-O0):
define i32 @daysSince1582(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1583
%5 = mul nsw i32 %4, 365
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1581
%8 = sdiv i32 %7, 4
%9 = add nsw i32 %5, %8
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1501
%12 = sdiv i32 %11, 100
%13 = sub nsw i32 %9, %12
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 1201
%16 = sdiv i32 %15, 400
%17 = add nsw i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @daysSince1582(i32 %0) {
%2 = mul i32 %0, 365
%3 = add i32 %2, -577795
%4 = add nsw i32 %0, -1581
%5 = sdiv i32 %4, 4
%6 = add nsw i32 %3, %5
%7 = add nsw i32 %0, -1501
%8 = sdiv i32 %7, -100
%9 = add i32 %6, %8
%10 = add nsw i32 %0, -1201
%11 = sdiv i32 %10, 400
%12 = add nsw i32 %9, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ test(char **);
int main() {
  char mykeys[8][3];
  while (1) {
    test(mykeys);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <test@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <test@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x [3 x i8]]
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = getelementptr inbounds [8 x [3 x i8]], [8 x [3 x i8]]* %2, i64 0, i64 0
%5 = bitcast [3 x i8]* %4 to i8**
%6 = call i32 @test(i8** %5)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [8 x [3 x i8]]
%2 = getelementptr inbounds [8 x [3 x i8]], [8 x [3 x i8]]* %1, i64 0, i64 0, i64 0
%3 = bitcast [8 x [3 x i8]]* %1 to i8**
br label %4
4: ; preds = %4, %0
%5 = call i32 @test(i8** %3)
br label %4
}