#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int /*<<< orphan*/ free(void *);
int get_file_size(char *);
void *xmalloc(int);
unsigned long xstrtoul(char *);
void test_util() {
  {
    unsigned long u = xstrtoul("10");
    assert(u == 10UL);
  }
  { assert(get_file_size("data/buf.data") == 5); }
  {
    void *p = xmalloc(10);
    assert(p);
    free(p);
  }
}


x86 assembly (clang, -O0):
<test_util>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1070 <xstrtoul@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0xa,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
movslq %eax,%rdi
call   1050 <assert@plt>
lea    0xe7f(%rip),%rdi
call   1060 <get_file_size@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movslq %eax,%rdi
call   1050 <assert@plt>
mov    $0xa,%edi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_util>:
push   %rbx
lea    0xea8(%rip),%rdi
call   1070 <xstrtoul@plt>
xor    %edi,%edi
cmp    $0xa,%rax
sete   %dil
call   1050 <assert@plt>
lea    0xe90(%rip),%rdi
call   1060 <get_file_size@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0xa,%edi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"10\00"
@.str.1 = [14 x i8] c"data/buf.data\00"
define void @test_util() {
%1 = alloca i64
%2 = alloca i8*
%3 = call i64 @xstrtoul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = icmp eq i64 %4, 10
%6 = zext i1 %5 to i32
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = call i32 @assert(i8* %8)
%10 = call i32 @get_file_size(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32 %10, 5
%12 = zext i1 %11 to i32
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
%15 = call i32 @assert(i8* %14)
%16 = call i8* @xmalloc(i32 10)
store i8* %16, i8** %2
%17 = load i8*, i8** %2
%18 = call i32 @assert(i8* %17)
%19 = load i8*, i8** %2
%20 = call i32 @free(i8* %19)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"10\00"
@.str.1 = [14 x i8] c"data/buf.data\00"
define void @test_util() {
%1 = tail call i64 @xstrtoul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 10
%3 = zext i1 %2 to i64
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @assert(i8* %4)
%6 = tail call i32 @get_file_size(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, 5
%8 = zext i1 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 @assert(i8* %9)
%11 = tail call i8* @xmalloc(i32 10)
%12 = tail call i32 @assert(i8* %11)
%13 = tail call i32 @free(i8* %11)
ret void
}