xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage_and_die(int argc, char **argv) {
  fprintf(stderr, "Usage: %s <mmapped dictionary> <catdlinemaropets>\n",
          argv[0]);
  exit(1);
}


x86 assembly (clang, -O0):
<usage_and_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: %s <mmapped dictionary> <catdlinemaropets>\0A\00"
define void @usage_and_die(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: %s <mmapped dictionary> <catdlinemaropets>\0A\00"
define void @usage_and_die(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x21() {
  Assert_real((isodigit(33) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              170, ("isodigit should be 0 for !"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x21>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xaa,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x21>:
push   %rax
mov    $0x21,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xaa,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for !\00"
define void @t_isodigit_0x21() {
%1 = call i64 @isodigit(i32 33)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for !\00"
define void @t_isodigit_0x21() {
%1 = tail call i64 @isodigit(i32 33)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_9Eint64_highword_reg(long long val) {
  return ((val >> 32) & (0x9E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Eint64_highword_reg>:
movabs $0x9e00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Eint64_highword_reg(i64 %0) {
%2 = and i64 %0, 678604832768
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int protofilter_getbpfinfo(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *);
int SFilter_GetBPFInfo(uint16_t *remote, uint16_t *ethframe, uint32_t *ipaddr,
                       uint16_t *udpport, uint16_t *tcpport) {
  return protofilter_getbpfinfo(remote, ethframe, ipaddr, udpport, tcpport);
}


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

x86 assembly (clang, -O2):
<SFilter_GetBPFInfo>:
jmp    1030 <protofilter_getbpfinfo@plt>

LLVM IR (-O0):
define i32 @SFilter_GetBPFInfo(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @protofilter_getbpfinfo(i32* %11, i32* %12, i32* %13, i32* %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @SFilter_GetBPFInfo(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @protofilter_getbpfinfo(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ newstr(char *);
void create_empty_buffer() { newstr(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @create_empty_buffer() {
%1 = call i32 @newstr(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @create_empty_buffer() {
%1 = tail call i32 @newstr(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
int WriteLink(LinkId, Buffer, Count, Timeout)
int LinkId;
char *Buffer;
unsigned int Count;
int Timeout;
{}


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

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

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

LLVM IR (-O2):
define i32 @WriteLink(i32 %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 undef
}
void testInlineCheckInNestedMacro(int *p) {
  int i = ({
    int j = (((p) != 0) ? *p : 17);
    j;
  });
  (void)i;
  *p = 1;
}


x86 assembly (clang, -O0):
<testInlineCheckInNestedMacro>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1121 <testInlineCheckInNestedMacro+0x21>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
jmp    112e <testInlineCheckInNestedMacro+0x2e>
mov    $0x11,%eax
mov    %eax,-0x18(%rbp)
jmp    112e <testInlineCheckInNestedMacro+0x2e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testInlineCheckInNestedMacro>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @testInlineCheckInNestedMacro(i32* writeonly %0) {
store i32 1, i32* %0
ret void
}
/* Variables and functions */
void *prot_to_real(const void *prot) {
  uintptr_t retval = ((uintptr_t)prot & 0xFFFF0UL) << 12;
  retval |= ((uintptr_t)prot & 0xFUL);
  return (void *)retval;
}


x86 assembly (clang, -O0):
<prot_to_real>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff0,%rax
shl    $0xc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xf,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prot_to_real>:
mov    %edi,%eax
and    $0xffff0,%eax
shl    $0xc,%rax
and    $0xf,%edi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i8* @prot_to_real(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = and i64 %5, 1048560
%7 = shl i64 %6, 12
store i64 %7, i64* %3
%8 = load i8*, i8** %2
%9 = ptrtoint i8* %8 to i64
%10 = and i64 %9, 15
%11 = load i64, i64* %3
%12 = or i64 %11, %10
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = inttoptr i64 %13 to i8*
ret i8* %14
}

LLVM IR (-O2):
define i8* @prot_to_real(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = shl i64 %2, 12
%4 = and i64 %3, 4294901760
%5 = and i64 %2, 15
%6 = or i64 %4, %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void sockerror(char *msg) {
  perror(msg);
  exit(0);
}


x86 assembly (clang, -O0):
<sockerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sockerror>:
push   %rax
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sockerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sockerror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int __builtin_mips_cabs_sf_d(double, double);
int test8(double a, double b) { return __builtin_mips_cabs_sf_d(a, b); }


x86 assembly (clang, -O0):
<test8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__builtin_mips_cabs_sf_d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test8>:
jmp    1030 <__builtin_mips_cabs_sf_d@plt>

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

LLVM IR (-O2):
define i32 @test8(double %0, double %1) {
%3 = tail call i32 @__builtin_mips_cabs_sf_d(double %0, double %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EVM5515_wait(unsigned long);
void EVM5515_waitusec(unsigned long usec) {
  EVM5515_wait((unsigned long)usec * 8);
}


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

x86 assembly (clang, -O2):
<EVM5515_waitusec>:
shl    $0x3,%rdi
jmp    1030 <EVM5515_wait@plt>

LLVM IR (-O0):
define void @EVM5515_waitusec(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 8
%5 = call i32 @EVM5515_wait(i64 %4)
ret void
}

LLVM IR (-O2):
define void @EVM5515_waitusec(i64 %0) {
%2 = shl i64 %0, 3
%3 = tail call i32 @EVM5515_wait(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_delay();
void udelay(int loops) {
  while (loops--)
    io_delay();
}


x86 assembly (clang, -O0):
<udelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113b <udelay+0x2b>
mov    $0x0,%al
call   1030 <io_delay@plt>
jmp    111b <udelay+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udelay>:
push   %rbx
test   %edi,%edi
je     112c <udelay+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <io_delay@plt>
add    $0xffffffff,%ebx
jne    1120 <udelay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @udelay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (...) @io_delay()
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @udelay(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 (...) @io_delay()
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int cc;
  int n1 = 0, n2 = 0, aux;
  do {
    for (cc = 0; cc <= n2; cc++) {
      printf("*");
    }
    printf("\n");
    aux = n2 + n1;
    n1 = n2;
    n2 = aux;
  } while (n2 <= 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     115a <main+0x4a>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jle    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @putchar(i32 42)
%3 = tail call i32 @putchar(i32 10)
br label %1
}
/* Variables and functions */
int syscall1(int);
int getppid() { return syscall1(64); }


x86 assembly (clang, -O0):
<getppid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
call   1030 <syscall1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getppid>:
mov    $0x40,%edi
jmp    1030 <syscall1@plt>

LLVM IR (-O0):
define i32 @getppid() {
%1 = call i32 @syscall1(i32 64)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getppid() {
%1 = tail call i32 @syscall1(i32 64)
ret i32 %1
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t __bswap16(uint16_t __x) { return __x << 8 | __x >> 8; }


x86 assembly (clang, -O0):
<__bswap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bswap16>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @__bswap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @__bswap16(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
unsigned int div_round_up(unsigned int nb, unsigned int div) {
  return (nb / div) + !!(nb % div);
}


x86 assembly (clang, -O0):
<div_round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_round_up>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @div_round_up(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = udiv i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = urem i32 %8, %9
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = add i32 %7, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @div_round_up(i32 %0, i32 %1) {
%3 = udiv i32 %0, %1
%4 = urem i32 %0, %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add i32 %3, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ firc_send(char *, char *);
void end_motd() {
  firc_send("PRIVMSG NickServ :IDENTIFY %s", "---");
  firc_send("JOIN %s", "#SRL");
}


x86 assembly (clang, -O0):
<end_motd>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xefc(%rip),%rsi
call   1030 <firc_send@plt>
lea    0xef4(%rip),%rdi
lea    0xef5(%rip),%rsi
call   1030 <firc_send@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_motd>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xeff(%rip),%rsi
call   1030 <firc_send@plt>
lea    0xef7(%rip),%rdi
lea    0xef8(%rip),%rsi
pop    %rax
jmp    1030 <firc_send@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"PRIVMSG NickServ :IDENTIFY %s\00"
@.str.1 = [4 x i8] c"---\00"
@.str.2 = [8 x i8] c"JOIN %s\00"
@.str.3 = [5 x i8] c"#SRL\00"
define void @end_motd() {
%1 = call i32 @firc_send(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @firc_send(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"PRIVMSG NickServ :IDENTIFY %s\00"
@.str.1 = [4 x i8] c"---\00"
@.str.2 = [8 x i8] c"JOIN %s\00"
@.str.3 = [5 x i8] c"#SRL\00"
define void @end_motd() {
%1 = tail call i32 @firc_send(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @firc_send(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void gtk_tree_model_sort_convert_child_path_to_path() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __lutimes(const char *file, const struct timeval tvp[2]) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__lutimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lutimes>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
define i32 @__lutimes(i8* %0, %struct.timeval* %1) {
%3 = alloca i8*
%4 = alloca %struct.timeval*
store i8* %0, i8** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
define i32 @__lutimes(i8* nocapture readnone %0, %struct.timeval* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
int looks_like_name(const char *word) {}


x86 assembly (clang, -O0):
<looks_like_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @looks_like_name(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
struct ev_loop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ev_run(struct ev_loop *, int);
void ev_loop(struct ev_loop *loop, int flags) { (void)ev_run(loop, flags); }


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

x86 assembly (clang, -O2):
<ev_loop>:
jmp    1030 <ev_run@plt>

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

LLVM IR (-O2):
%struct.ev_loop = type { i32 }
define void @ev_loop(%struct.ev_loop* %0, i32 %1) {
%3 = tail call i32 @ev_run(%struct.ev_loop* %0, i32 %1)
ret void
}
void flight() {}


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

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

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

LLVM IR (-O2):
define void @flight() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello World Again Again!\n");
  printf("Hello World Again!\n");
  printf("Test Git Fetch!\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%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 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Hello World Again Again!\0A\00"
@.str.1 = [20 x i8] c"Hello World Again!\0A\00"
@.str.2 = [17 x i8] c"Test Git Fetch!\0A\00"
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 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Hello World Again Again!\00"
@str.3 = [19 x i8] c"Hello World Again!\00"
@str.4 = [16 x i8] c"Test Git Fetch!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int remove(char const *);
int FIO_remove(const char *path) { return remove(path); }


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

x86 assembly (clang, -O2):
<FIO_remove>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @FIO_remove(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cglognot(void) {
  gen("negl\t%eax");
  gen("sbbl\t%eax,%eax");
  gen("incl\t%eax");
}


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

x86 assembly (clang, -O2):
<cglognot>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <gen@plt>
lea    0xee6(%rip),%rdi
call   1030 <gen@plt>
lea    0xee9(%rip),%rdi
pop    %rax
jmp    1030 <gen@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"negl\09%eax\00"
@.str.1 = [15 x i8] c"sbbl\09%eax,%eax\00"
@.str.2 = [10 x i8] c"incl\09%eax\00"
define void @cglognot() {
%1 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"negl\09%eax\00"
@.str.1 = [15 x i8] c"sbbl\09%eax,%eax\00"
@.str.2 = [10 x i8] c"incl\09%eax\00"
define void @cglognot() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}
__attribute__((always_)) int max(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int ascii_print_literally(void *baton, int c) {
  c &= 0xff;
  return (0x20 <= c && c <= 0x7e);
}


x86 assembly (clang, -O0):
<ascii_print_literally>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
mov    $0x20,%ecx
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     1133 <ascii_print_literally+0x33>
cmpl   $0x7e,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_print_literally>:
movzbl %sil,%ecx
add    $0xffffffe0,%ecx
xor    %eax,%eax
cmp    $0x5f,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @ascii_print_literally(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sle i32 32, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp sle i32 %10, 126
br label %12
12: ; preds = %9, %2
%13 = phi i1 [ false, %2 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @ascii_print_literally(i8* nocapture readnone %0, i32 %1) {
%3 = and i32 %1, 255
%4 = add nsw i32 %3, -32
%5 = icmp ult i32 %4, 95
%6 = zext i1 %5 to i32
ret i32 %6
}
void PriceEdit(void) {}


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

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

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

LLVM IR (-O2):
define void @PriceEdit() {
ret void
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void ns_sleep(int ns) {
  struct timespec req;
  req.tv_sec = 0;
  req.tv_nsec = ns;
  nanosleep(&req, NULL);
}


x86 assembly (clang, -O0):
<ns_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_sleep>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
mov    %edi,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @ns_sleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load i32, i32* %2
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @ns_sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %0, i32* %5
%6 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ str_permutations_aux(char *, size_t, int /*<<< orphan*/);
void str_permutations(char *str, size_t str_sz) {
  str_permutations_aux(str, str_sz, 0);
}


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

x86 assembly (clang, -O2):
<str_permutations>:
xor    %edx,%edx
jmp    1030 <str_permutations_aux@plt>

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

LLVM IR (-O2):
define void @str_permutations(i8* %0, i64 %1) {
%3 = tail call i32 @str_permutations_aux(i8* %0, i64 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void AssertionFailed(char *file, int line) {
  fprintf(stderr, "Assertion failed! file %s, line %d.\n", file, line);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<AssertionFailed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<AssertionFailed>:
push   %rbx
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rbx
mov    (%rbx),%edi
lea    0xeba(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Assertion failed! file %s, line %d.\0A\00"
define void @AssertionFailed(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = load i32, i32* @stderr
%10 = call i32 @fflush(i32 %9)
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Assertion failed! file %s, line %d.\0A\00"
define void @AssertionFailed(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 (...) @abort()
unreachable
}
char nibble_to_hex(char nibble) {
  nibble &= 0xF;
  if (nibble < 10)
    return '0' + nibble;
  else
    return 'A' + nibble - 10;
}


x86 assembly (clang, -O0):
<nibble_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1130 <nibble_to_hex+0x30>
movsbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    113d <nibble_to_hex+0x3d>
movsbl -0x2(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_to_hex>:
and    $0xf,%dil
lea    0x30(%rdi),%eax
lea    0x37(%rdi),%ecx
cmp    $0xa,%dil
movzbl %al,%edx
movzbl %cl,%eax
cmovb  %edx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @nibble_to_hex(i8 signext %0) {
%2 = and i8 %0, 15
%3 = icmp ult i8 %2, 10
%4 = or i8 %2, 48
%5 = add nuw nsw i8 %2, 55
%6 = select i1 %3, i8 %4, i8 %5
ret i8 %6
}
void connectToServer(char *serverName, unsigned int port, char *name) {
  connectToCGS(__FUNCTION__, serverName, port, name);
}


x86 assembly (clang, -O0):
<connectToServer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <connectToCGS@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connectToServer>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
xor    %eax,%eax
jmp    1030 <connectToCGS@plt>

LLVM IR (-O0):
@__FUNCTION__.connectToServer = [16 x i8] c"connectToServer\00"
define void @connectToServer(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @connectToCGS to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.connectToServer, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@__FUNCTION__.connectToServer = [16 x i8] c"connectToServer\00"
define void @connectToServer(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @connectToCGS to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.connectToServer, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void f(void) {
  int a[10];
  int *p = &a[5];
  int *q = p - 1;
  if (q != &a[4])
    link_error();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
lea    -0x30(%rbp),%rcx
add    $0x10,%rcx
cmp    %rcx,%rax
je     114c <f+0x3c>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f() {
%1 = alloca [10 x i32]
%2 = alloca i32*
%3 = alloca i32*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 -1
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%9 = icmp ne i32* %7, %8
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @link_error()
br label %12
12: ; preds = %10, %0
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(int *, int *, int);
void strncpy_bad1() {
  int arr1[10];
  int arr2[20];
  strncpy(arr1, arr2, 44);
}


x86 assembly (clang, -O0):
<strncpy_bad1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x30(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x2c,%edx
call   1030 <strncpy@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_bad1>:
sub    $0x88,%rsp
mov    %rsp,%rdi
lea    0x30(%rsp),%rsi
mov    $0x2c,%edx
call   1030 <strncpy@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @strncpy_bad1() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%5 = call i32 @strncpy(i32* %3, i32* %4, i32 44)
ret void
}

LLVM IR (-O2):
define void @strncpy_bad1() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%7 = call i32 @strncpy(i32* %5, i32* %6, i32 44)
ret void
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, unsigned char);
void fb_enable_cursor() {
  outb(0x3D4, 0x0A);
  unsigned char curstart = inb(0x3D5) & 0x1F;
  outb(0x3D4, 0x0A);
  outb(0x3D5, curstart & ~0x20);
}


x86 assembly (clang, -O0):
<fb_enable_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3d4,%edi
mov    $0xa,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
call   1040 <inb@plt>
and    $0x1f,%eax
mov    %al,-0x1(%rbp)
mov    $0x3d4,%edi
mov    $0xa,%esi
call   1030 <outb@plt>
movzbl -0x1(%rbp),%eax
and    $0xffffffdf,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_enable_cursor>:
push   %rbx
mov    $0x3d4,%edi
mov    $0xa,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
call   1040 <inb@plt>
mov    %eax,%ebx
mov    $0x3d4,%edi
mov    $0xa,%esi
call   1030 <outb@plt>
and    $0x1f,%ebx
mov    $0x3d5,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @fb_enable_cursor() {
%1 = alloca i8
%2 = call i32 @outb(i32 980, i8 zeroext 10)
%3 = call i32 @inb(i32 981)
%4 = and i32 %3, 31
%5 = trunc i32 %4 to i8
store i8 %5, i8* %1
%6 = call i32 @outb(i32 980, i8 zeroext 10)
%7 = load i8, i8* %1
%8 = zext i8 %7 to i32
%9 = and i32 %8, -33
%10 = trunc i32 %9 to i8
%11 = call i32 @outb(i32 981, i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @fb_enable_cursor() {
%1 = tail call i32 @outb(i32 980, i8 zeroext 10)
%2 = tail call i32 @inb(i32 981)
%3 = tail call i32 @outb(i32 980, i8 zeroext 10)
%4 = trunc i32 %2 to i8
%5 = and i8 %4, 31
%6 = tail call i32 @outb(i32 981, i8 zeroext %5)
ret void
}
int __ocl_any_long(long src) { return (src >> (64 - 1)) & 0x1; }


x86 assembly (clang, -O0):
<__ocl_any_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x3f,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_any_long>:
mov    %rdi,%rax
shr    $0x3f,%rax
ret

LLVM IR (-O0):
define i32 @__ocl_any_long(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 63
%5 = and i64 %4, 1
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @__ocl_any_long(i64 %0) {
%2 = lshr i64 %0, 63
%3 = trunc i64 %2 to i32
ret i32 %3
}
int IsNumber(const char *c) {
  return (*c >= '0' && *c <= '9') || (*c == '-' && c[1] >= '0' && c[1] <= '9');
}


x86 assembly (clang, -O0):
<IsNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     112d <IsNumber+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x9(%rbp)
jle    116f <IsNumber+0x6f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0xa(%rbp)
jne    1169 <IsNumber+0x69>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xa(%rbp)
jl     1169 <IsNumber+0x69>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsNumber>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
mov    $0x1,%eax
cmp    $0xa,%dl
jb     1126 <IsNumber+0x26>
xor    %eax,%eax
cmp    $0x2d,%cl
jne    1126 <IsNumber+0x26>
mov    0x1(%rdi),%cl
cmp    $0x30,%cl
jl     1126 <IsNumber+0x26>
xor    %eax,%eax
cmp    $0x3a,%cl
setb   %al
ret

LLVM IR (-O0):
define i32 @IsNumber(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 57
br i1 %11, label %31, label %12
12: ; preds = %7, %1
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 45
br i1 %16, label %17, label %29
17: ; preds = %12
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 48
br i1 %22, label %23, label %29
23: ; preds = %17
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 1
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 57
br label %29
29: ; preds = %23, %17, %12
%30 = phi i1 [ false, %17 ], [ false, %12 ], [ %28, %23 ]
br label %31
31: ; preds = %29, %7
%32 = phi i1 [ true, %7 ], [ %30, %29 ]
%33 = zext i1 %32 to i32
ret i32 %33
}

LLVM IR (-O2):
define i32 @IsNumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = icmp eq i8 %2, 45
br i1 %6, label %7, label %14
7: ; preds = %5
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = icmp sgt i8 %9, 47
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = icmp ult i8 %9, 58
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %1, %5, %7, %11
%15 = phi i32 [ 0, %7 ], [ 0, %5 ], [ %13, %11 ], [ 1, %1 ]
ret i32 %15
}
void led_init() {
  *(volatile unsigned long *)0x56000010 |=
      ((0x01 << (5 * 2)) | (0x01 << (6 * 2)) | (0x01 << (7 * 2)) |
       (0x01 << (8 * 2)));
  *(volatile unsigned long *)0x56000014 = 0x7ff;
}


x86 assembly (clang, -O0):
<led_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56000010,%eax
mov    (%rax),%rcx
or     $0x15400,%rcx
mov    $0x56000010,%eax
mov    %rcx,(%rax)
mov    $0x56000014,%eax
movq   $0x7ff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_init>:
orq    $0x15400,0x56000010
movq   $0x7ff,0x56000014
ret

LLVM IR (-O0):
define void @led_init() {
%1 = load volatile i64, i64* inttoptr (i64 1442840592 to i64*)
%2 = or i64 %1, 87040
store volatile i64 %2, i64* inttoptr (i64 1442840592 to i64*)
store volatile i64 2047, i64* inttoptr (i64 1442840596 to i64*)
ret void
}

LLVM IR (-O2):
define void @led_init() {
%1 = load volatile i64, i64* inttoptr (i64 1442840592 to i64*)
%2 = or i64 %1, 87040
store volatile i64 %2, i64* inttoptr (i64 1442840592 to i64*)
store volatile i64 2047, i64* inttoptr (i64 1442840596 to i64*)
ret void
}
void X509_verify_cert(void) {}


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

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

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

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