xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strtok_r(char *, char *, char **);
int count_lines(char *instring) {
  int counter = 0;
  char *scratch, *txt, *delimiter = "\n";
  while ((txt = strtok_r(!counter ? instring : NULL, delimiter, &scratch)))
    counter++;
  return counter;
}


x86 assembly (clang, -O0):
<count_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xed6(%rip),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1145 <count_lines+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1150 <count_lines+0x40>
xor    %eax,%eax
mov    %rax,-0x30(%rbp)
jmp    1150 <count_lines+0x40>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <strtok_r@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     117d <count_lines+0x6d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <count_lines+0x1e>
mov    -0xc(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_lines>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%ebx
lea    0xed9(%rip),%r15
mov    %rsp,%r12
nopw   0x0(%rax,%rax,1)
cmp    $0x1,%ebx
mov    $0x0,%edi
cmove  %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <strtok_r@plt>
add    $0xffffffff,%ebx
test   %rax,%rax
jne    1130 <count_lines+0x20>
neg    %ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @count_lines(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %10, %4 ]
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* %0, i8* null
%8 = call i8* @strtok_r(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2)
%9 = icmp eq i8* %8, null
%10 = add nuw nsw i32 %5, 1
br i1 %9, label %11, label %4
11: ; preds = %4
ret i32 %5
}
/* Type definitions */
struct in6_addr {
  int dummy;
};
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int AF_INET;
int AF_INET6;
int inet_pton(int, char *, char *);
int isipaddr(char *ip, int ipver) {
  char addr[sizeof(struct in6_addr)];
  int len;
  int af_type;
  af_type = (ipver == 4) ? AF_INET6 : AF_INET;
  len = sizeof(addr);
  if (inet_pton(af_type, ip, addr) == 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isipaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jne    113a <isipaddr+0x2a>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    1146 <isipaddr+0x36>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x4,-0x1c(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <inet_pton@plt>
cmp    $0x1,%eax
jne    1178 <isipaddr+0x68>
movl   $0x1,-0x4(%rbp)
jmp    117f <isipaddr+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isipaddr>:
push   %rax
mov    %rdi,%rax
cmp    $0x4,%esi
jne    1122 <isipaddr+0x12>
mov    0x2ec0(%rip),%rcx
jmp    1129 <isipaddr+0x19>
mov    0x2ebf(%rip),%rcx
mov    (%rcx),%edi
lea    0x4(%rsp),%rdx
mov    %rax,%rsi
call   1030 <inet_pton@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@AF_INET6 = global i32 0
@AF_INET = global i32 0
define i32 @isipaddr(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [4 x i8]
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 4
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* @AF_INET6
br label %15
13: ; preds = %2
%14 = load i32, i32* @AF_INET
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
store i32 %16, i32* %8
store i32 4, i32* %7
%17 = load i32, i32* %8
%18 = load i8*, i8** %4
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%20 = call i32 @inet_pton(i32 %17, i8* %18, i8* %19)
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %23
22: ; preds = %15
store i32 1, i32* %3
br label %24
23: ; preds = %15
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@AF_INET6 = global i32 0
@AF_INET = global i32 0
define i32 @isipaddr(i8* %0, i32 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %1, 4
%6 = load i32, i32* @AF_INET6
%7 = load i32, i32* @AF_INET
%8 = select i1 %5, i32 %6, i32 %7
%9 = call i32 @inet_pton(i32 %8, i8* %0, i8* %4)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
ret i32 %11
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=aml-meson-m400-1 USING_OS_MEMORY=1 API_VERSION=14 "
         "REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri "
         "Jun  7 18:15:38 EDT 2013 BUILD=DEBUG CPU= USING_UMP=1 "
         "USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 "
         "KDIR= MALI_PLATFORM_FILE=platform/meson_platform/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=";
}


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

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

LLVM IR (-O0):
@.str = [426 x i8] c"malidrv: CONFIG=aml-meson-m400-1 USING_OS_MEMORY=1 API_VERSION=14 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri Jun 7 18:15:38 EDT 2013 BUILD=DEBUG CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/meson_platform/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([426 x i8], [426 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [426 x i8] c"malidrv: CONFIG=aml-meson-m400-1 USING_OS_MEMORY=1 API_VERSION=14 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri Jun 7 18:15:38 EDT 2013 BUILD=DEBUG CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/meson_platform/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([426 x i8], [426 x i8]* @.str, i64 0, i64 0)
}
unsigned under(unsigned x) { return (x - 1) & ~x; }


x86 assembly (clang, -O0):
<under>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<under>:
lea    -0x1(%rdi),%eax
not    %edi
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @under(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 1
%5 = load i32, i32* %2
%6 = xor i32 %5, -1
%7 = and i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @under(i32 %0) {
%2 = add i32 %0, -1
%3 = xor i32 %0, -1
%4 = and i32 %2, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_unpack_prim_2_le(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void ivory_serialize_unpack_uint16_le(const uint8_t *src, uint32_t offs,
                                      uint16_t *dst) {
  uint16_t tmp = ivory_serialize_unpack_prim_2_le(src + offs);
  memcpy(dst, &tmp, sizeof(*dst));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_uint16_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <ivory_serialize_unpack_prim_2_le@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_uint16_le>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
call   1030 <ivory_serialize_unpack_prim_2_le@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ivory_serialize_unpack_uint16_le(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = call i32 @ivory_serialize_unpack_prim_2_le(i32* %11)
store i32 %12, i32* %7
%13 = load i32*, i32** %6
%14 = call i32 @memcpy(i32* %13, i32* %7, i32 4)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_unpack_uint16_le(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @ivory_serialize_unpack_prim_2_le(i32* %7)
store i32 %8, i32* %4
%9 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
ret void
}
/* Variables and functions */
int DoVprintf(char const *, char);
int /*<<< orphan*/ Fail(char *, int, int);
int strlen(char const *);
void DoCharTest(const char *formatstr, char param, const char *checkstr) {
  int ret;
  ret = DoVprintf(formatstr, param);
  if (ret != strlen(checkstr)) {
    Fail("Expected vprintf to return %d, got %d.\n", strlen(checkstr), ret);
  }
}


x86 assembly (clang, -O0):
<DoCharTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1040 <DoVprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
je     118c <DoCharTest+0x5c>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
mov    -0x1c(%rbp),%edx
lea    0xe79(%rip),%rdi
call   1050 <Fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCharTest>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
call   1040 <DoVprintf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
jne    1150 <DoCharTest+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <Fail@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Expected vprintf to return %d, got %d.\0A\00"
define void @DoCharTest(i8* %0, i8 signext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %5
%10 = call i32 @DoVprintf(i8* %8, i8 signext %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = icmp ne i32 %11, %13
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i8*, i8** %6
%17 = call i32 @strlen(i8* %16)
%18 = load i32, i32* %7
%19 = call i32 @Fail(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
br label %20
20: ; preds = %15, %3
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Expected vprintf to return %d, got %d.\0A\00"
define void @DoCharTest(i8* %0, i8 signext %1, i8* %2) {
%4 = tail call i32 @DoVprintf(i8* %0, i8 signext %1)
%5 = tail call i32 @strlen(i8* %2)
%6 = icmp eq i32 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i32 @strlen(i8* %2)
%9 = tail call i32 @Fail(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %4)
br label %10
10: ; preds = %7, %3
ret void
}
int x41_process_syn(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x41_process_syn(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int ssl3_accept(int);
int main(void) {
  int s;
  int tmp;
  {
    {
      s = 8464;
      tmp = ssl3_accept(s);
    }
    return (tmp);
  }
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x2110,%edi
jmp    1030 <ssl3_accept@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 8464, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @ssl3_accept(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ssl3_accept(i32 8464)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x9c() {
  Assert_real((isdigit(156) == 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_isdigit.c",
              785, ("isdigit should be 0 for 0x9c"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x9c>:
push   %rax
mov    $0x9c,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x311,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x9c\00"
define void @t_isdigit_0x9c() {
%1 = call i64 @isdigit(i32 156)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 785, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x9c\00"
define void @t_isdigit_0x9c() {
%1 = tail call i64 @isdigit(i32 156)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 785, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int right_child(int parent) {
  int right_child = parent * 2 + 1;
  return right_child;
}


x86 assembly (clang, -O0):
<right_child>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_child>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @right_child(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @right_child(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
double pow(double, double);
double gamma_2_2_to_linear(double value) {
  if (value > 0.04045)
    return pow((value + 0.055) / 1.055, 2.4);
  return value / 12.92;
}


x86 assembly (clang, -O0):
<gamma_2_2_to_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1164 <gamma_2_2_to_linear+0x54>
movsd  0xee4(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    117a <gamma_2_2_to_linear+0x6a>
movsd  -0x10(%rbp),%xmm0
movsd  0xe97(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma_2_2_to_linear>:
ucomisd 0xee8(%rip),%xmm0
jbe    1137 <gamma_2_2_to_linear+0x27>
addsd  0xeee(%rip),%xmm0
divsd  0xeee(%rip),%xmm0
movsd  0xeee(%rip),%xmm1
jmp    1030 <pow@plt>
divsd  0xec9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @gamma_2_2_to_linear(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 4.045000e-02
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fadd double %7, 5.500000e-02
%9 = fdiv double %8, 1.055000e+00
%10 = call double @pow(double %9, double 2.400000e+00)
store double %10, double* %2
br label %14
11: ; preds = %1
%12 = load double, double* %3
%13 = fdiv double %12, 1.292000e+01
store double %13, double* %2
br label %14
14: ; preds = %11, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @gamma_2_2_to_linear(double %0) {
%2 = fcmp ogt double %0, 4.045000e-02
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = fadd double %0, 5.500000e-02
%5 = fdiv double %4, 1.055000e+00
%6 = tail call double @pow(double %5, double 2.400000e+00)
br label %9
7: ; preds = %1
%8 = fdiv double %0, 1.292000e+01
br label %9
9: ; preds = %7, %3
%10 = phi double [ %6, %3 ], [ %8, %7 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ tests_mnt(int /*<<< orphan*/);
void tests_unmount(void) { tests_mnt(0); }


x86 assembly (clang, -O0):
<tests_unmount>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <tests_mnt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tests_unmount>:
xor    %edi,%edi
jmp    1030 <tests_mnt@plt>

LLVM IR (-O0):
define void @tests_unmount() {
%1 = call i32 @tests_mnt(i32 0)
ret void
}

LLVM IR (-O2):
define void @tests_unmount() {
%1 = tail call i32 @tests_mnt(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(size_t);
void *default_alloc(void *ud, void *ptr, size_t sz) {
  if (ptr == NULL) {
    void *p = malloc(sz);
    return p;
  }
  free(ptr);
  return NULL;
}


x86 assembly (clang, -O0):
<default_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1159 <default_alloc+0x39>
mov    -0x20(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <default_alloc+0x4a>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_alloc>:
test   %rsi,%rsi
je     1132 <default_alloc+0x12>
push   %rax
mov    %rsi,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    %rdx,%rdi
jmp    1040 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @default_alloc(i8* nocapture readnone %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i8* @malloc(i64 %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @free(i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %6, %5 ], [ null, %7 ]
ret i8* %10
}
int slice_width(int sig_width, int slice_width, int slice_n) {
  int slices = (sig_width + slice_width - 1) / slice_width;
  int pos_start = sig_width * slice_n / slices;
  int pos_end = sig_width * (slice_n + 1) / slices;
  return pos_end - pos_start;
}


x86 assembly (clang, -O0):
<slice_width>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slice_width>:
mov    %edx,%ecx
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %esi
mov    %eax,%esi
mov    %ecx,%eax
imul   %edi,%eax
cltd
idiv   %esi
mov    %eax,%r8d
add    $0x1,%ecx
imul   %edi,%ecx
mov    %ecx,%eax
cltd
idiv   %esi
sub    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @slice_width(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = add nsw i32 %10, %11
%13 = sub nsw i32 %12, 1
%14 = load i32, i32* %5
%15 = sdiv i32 %13, %14
store i32 %15, i32* %7
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = mul nsw i32 %16, %17
%19 = load i32, i32* %7
%20 = sdiv i32 %18, %19
store i32 %20, i32* %8
%21 = load i32, i32* %4
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
%24 = mul nsw i32 %21, %23
%25 = load i32, i32* %7
%26 = sdiv i32 %24, %25
store i32 %26, i32* %9
%27 = load i32, i32* %9
%28 = load i32, i32* %8
%29 = sub nsw i32 %27, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @slice_width(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, -1
%5 = add i32 %4, %1
%6 = sdiv i32 %5, %1
%7 = mul nsw i32 %2, %0
%8 = sdiv i32 %7, %6
%9 = add nsw i32 %2, 1
%10 = mul nsw i32 %9, %0
%11 = sdiv i32 %10, %6
%12 = sub nsw i32 %11, %8
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void printButton(char *value, int cmd) {
  printf("<input type='submit' value='%s' onclick='DbCommand(%d);' />\n", value,
         cmd);
}


x86 assembly (clang, -O0):
<printButton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printButton>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"<input type='submit' value='%s' onclick='DbCommand(%d);' />\0A\00"
define void @printButton(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"<input type='submit' value='%s' onclick='DbCommand(%d);' />\0A\00"
define void @printButton(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ get_time();
unsigned int stop_timer(unsigned int *start_time) {
  unsigned int stop_time = (unsigned int)get_time();
  return (stop_time >= *start_time) ? (stop_time - *start_time) : stop_time;
}


x86 assembly (clang, -O0):
<stop_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <get_time@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jb     1146 <stop_timer+0x36>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x10(%rbp)
jmp    114c <stop_timer+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_timer>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <get_time@plt>
mov    (%rbx),%ecx
cmp    %eax,%ecx
cmova  %ebp,%ecx
sub    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @stop_timer(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i64 (...) @get_time()
%5 = trunc i64 %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = icmp uge i32 %6, %8
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = sub i32 %11, %13
br label %17
15: ; preds = %1
%16 = load i32, i32* %3
br label %17
17: ; preds = %15, %10
%18 = phi i32 [ %14, %10 ], [ %16, %15 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @stop_timer(i32* nocapture %0) {
%2 = tail call i64 (...) @get_time()
%3 = trunc i64 %2 to i32
%4 = load i32, i32* %0
%5 = icmp ugt i32 %4, %3
%6 = select i1 %5, i32 0, i32 %4
%7 = sub i32 %3, %6
ret i32 %7
}
void f(void) {}


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int tcflush(int fd, int queue_selector) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<tcflush>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebe(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcflush>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @tcflush(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @tcflush(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int EXIT_SUCCESS;
int main(int args, char **argv) { return EXIT_SUCCESS; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
int lzst0_log2up(int v) {
  int i, j;
  i = 0;
  j = v;
  while (j > 1) {
    i++;
    j = (j + 1) >> 1;
  }
  return (i);
}


x86 assembly (clang, -O0):
<lzst0_log2up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1138 <lzst0_log2up+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <lzst0_log2up+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lzst0_log2up>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111f <lzst0_log2up+0x1f>
xor    %eax,%eax
nopl   0x0(%rax)
add    $0x1,%eax
lea    0x1(%rdi),%ecx
shr    %ecx
cmp    $0x2,%edi
mov    %ecx,%edi
ja     1110 <lzst0_log2up+0x10>
ret

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

LLVM IR (-O2):
define i32 @lzst0_log2up(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %6, %3 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = lshr i32 %7, 1
%9 = icmp ugt i32 %4, 2
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int say_hello(int x, int y, int z) {
  printf("Hello ");
  printf("World!\n");
  int value = x * y + z;
  int b = z * x - 3;
  value += b;
  return value;
}


x86 assembly (clang, -O0):
<say_hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<say_hello>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
add    %r14d,%ebx
imul   %ebp,%ebx
lea    (%r14,%rbx,1),%eax
add    $0xfffffffd,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"Hello \00"
@str = [7 x i8] c"World!\00"
define i32 @say_hello(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%6 = add i32 %2, %1
%7 = mul i32 %6, %0
%8 = add i32 %2, -3
%9 = add i32 %8, %7
ret i32 %9
}
char *rfdtd_strchrnul(const char *s, char c) {
  const char *i;
  for (i = s; *i != '\0' && *i != c; ++i)
    ;
  return (char *)i;
}


x86 assembly (clang, -O0):
<rfdtd_strchrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     113e <rfdtd_strchrnul+0x3e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    114e <rfdtd_strchrnul+0x4e>
jmp    1164 <rfdtd_strchrnul+0x64>
jmp    1153 <rfdtd_strchrnul+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <rfdtd_strchrnul+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfdtd_strchrnul>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <rfdtd_strchrnul+0x21>
cmp    %sil,%cl
jne    1110 <rfdtd_strchrnul+0x10>
ret

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

LLVM IR (-O2):
define i8* @rfdtd_strchrnul(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %1
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i8* %4
}
void glmVectorFromColord(double vector[3], const double color[3]) {
  vector[0] = (color[0] - 0.5) * 2.0;
  vector[1] = (color[1] - 0.5) * 2.0;
  vector[2] = (color[2] - 0.5) * 2.0;
}


x86 assembly (clang, -O0):
<glmVectorFromColord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xeec(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed8(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xec3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  0xe99(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe85(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmVectorFromColord>:
movsd  0xef8(%rip),%xmm0
movsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,(%rdi)
movsd  0x8(%rsi),%xmm1
addsd  %xmm0,%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x8(%rdi)
addsd  0x10(%rsi),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @glmVectorFromColord(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = fsub double %7, 5.000000e-01
%9 = fmul double %8, 2.000000e+00
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
store double %9, double* %11
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fsub double %14, 5.000000e-01
%16 = fmul double %15, 2.000000e+00
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 1
store double %16, double* %18
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = fsub double %21, 5.000000e-01
%23 = fmul double %22, 2.000000e+00
%24 = load double*, double** %3
%25 = getelementptr inbounds double, double* %24, i64 2
store double %23, double* %25
ret void
}

LLVM IR (-O2):
define void @glmVectorFromColord(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fadd double %3, -5.000000e-01
%5 = fmul double %4, 2.000000e+00
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = fadd double %7, -5.000000e-01
%9 = fmul double %8, 2.000000e+00
%10 = getelementptr inbounds double, double* %0, i64 1
store double %9, double* %10
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = fadd double %12, -5.000000e-01
%14 = fmul double %13, 2.000000e+00
%15 = getelementptr inbounds double, double* %0, i64 2
store double %14, double* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LSR_();
int /*<<< orphan*/ c64_memAbsoluteAddr();
void LSR_abs(void) {
  c64_memAbsoluteAddr();
  LSR_();
}


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

x86 assembly (clang, -O2):
<LSR_abs>:
push   %rax
xor    %eax,%eax
call   1040 <c64_memAbsoluteAddr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <LSR_@plt>

LLVM IR (-O0):
define void @LSR_abs() {
%1 = call i32 (...) @c64_memAbsoluteAddr()
%2 = call i32 (...) @LSR_()
ret void
}

LLVM IR (-O2):
define void @LSR_abs() {
%1 = tail call i32 (...) @c64_memAbsoluteAddr()
%2 = tail call i32 (...) @LSR_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ backtrackPermutations(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void generatePermutations(int n) {
  int *A = (int *)malloc(n * sizeof(int));
  backtrackPermutations(A, 0, n);
  free(A);
}


x86 assembly (clang, -O0):
<generatePermutations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1040 <backtrackPermutations@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generatePermutations>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
lea    0x0(,%r14,4),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14d,%edx
call   1040 <backtrackPermutations@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @generatePermutations(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = load i32, i32* %2
%12 = call i32 @backtrackPermutations(i32* %10, i32 0, i32 %11)
%13 = load i32*, i32** %3
%14 = call i32 @free(i32* %13)
ret void
}

LLVM IR (-O2):
define void @generatePermutations(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @backtrackPermutations(i32* %4, i32 0, i32 %0)
%6 = tail call i32 @free(i32* %4)
ret void
}
/* Variables and functions */
scalar_t__ test(unsigned char *, int);
int is_t(unsigned char *seq, int n) {
  int ndx = n * 2;
  if (test(seq, ndx) == 0 || test(seq, ndx + 1) == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <test@plt>
cmp    $0x0,%rax
je     1157 <is_t+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
add    $0x1,%esi
call   1030 <test@plt>
cmp    $0x0,%rax
jne    1163 <is_t+0x53>
movl   $0x0,-0x4(%rbp)
jmp    116a <is_t+0x5a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_t>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
add    %esi,%ebx
mov    %ebx,%esi
call   1030 <test@plt>
test   %rax,%rax
je     1141 <is_t+0x31>
or     $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <test@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1143 <is_t+0x33>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @is_t(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = tail call i64 @test(i8* %0, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = or i32 %3, 1
%8 = tail call i64 @test(i8* %0, i32 %7)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ 0, %2 ], [ %10, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ distance(int, int);
void distance_set(int dis) { distance(dis / 256, dis % 256); }


x86 assembly (clang, -O0):
<distance_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x4(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
call   1030 <distance@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_set>:
mov    %edi,%esi
lea    0xff(%rsi),%edi
test   %esi,%esi
cmovns %esi,%edi
mov    %edi,%eax
and    $0xffffff00,%eax
sub    %eax,%esi
sar    $0x8,%edi
jmp    1030 <distance@plt>

LLVM IR (-O0):
define void @distance_set(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 256
%5 = load i32, i32* %2
%6 = srem i32 %5, 256
%7 = call i32 @distance(i32 %4, i32 %6)
ret void
}

LLVM IR (-O2):
define void @distance_set(i32 %0) {
%2 = sdiv i32 %0, 256
%3 = srem i32 %0, 256
%4 = tail call i32 @distance(i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mav(int, int);
void drive_forward() { mav(2, 750); }


x86 assembly (clang, -O0):
<drive_forward>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x2ee,%esi
call   1030 <mav@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drive_forward>:
mov    $0x2,%edi
mov    $0x2ee,%esi
jmp    1030 <mav@plt>

LLVM IR (-O0):
define void @drive_forward() {
%1 = call i32 @mav(i32 2, i32 750)
ret void
}

LLVM IR (-O2):
define void @drive_forward() {
%1 = tail call i32 @mav(i32 2, i32 750)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void hit_return_to_continue(void) {
  printf("Hit return to continue: ");
  fflush(stdout);
  char ch;
  do
    ch = getchar();
  while (ch != '\n');
}


x86 assembly (clang, -O0):
<hit_return_to_continue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1152 <hit_return_to_continue+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hit_return_to_continue>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1150 <hit_return_to_continue+0x20>
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Hit return to continue: \00"
@stdout = global i32 0
define void @hit_return_to_continue() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
br label %5
5: ; preds = %7, %0
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %1
br label %7
7: ; preds = %5
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %5, label %11
11: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Hit return to continue: \00"
@stdout = global i32 0
define void @hit_return_to_continue() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
br label %4
4: ; preds = %4, %0
%5 = tail call signext i8 (...) @getchar()
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %4
7: ; preds = %4
ret void
}
void test___atomic_nand_fetch_2(int *mem) { __atomic_nand_fetch(mem, -1, 4); }


x86 assembly (clang, -O0):
<test___atomic_nand_fetch_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
and    %esi,%edx
mov    %edx,-0x28(%rbp)
not    %edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    1150 <test___atomic_nand_fetch_2+0x50>
jmp    1122 <test___atomic_nand_fetch_2+0x22>
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%eax
and    %ecx,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_nand_fetch_2>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <test___atomic_nand_fetch_2+0x10>
ret

LLVM IR (-O0):
define void @test___atomic_nand_fetch_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 -1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw nand i32* %5, i32 %6 acq_rel
%8 = and i32 %7, %6
%9 = xor i32 %8, -1
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_nand_fetch_2(i32* nocapture %0) {
%2 = atomicrmw nand i32* %0, i32 -1 acq_rel
ret void
}