#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 */
struct rnd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert_in_range(struct rnd *, int, int, int, char *, int);
struct rnd *rnd_alloc();
int /*<<< orphan*/ rnd_free(struct rnd *);
void test_rnd_alloc(void) {
  struct rnd *rnd = rnd_alloc();
  assert_in_range((rnd), (0), (9), (1000),
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/donmccaughey/rnd/refs/"
                  "heads/master/rnd_tests.c",
                  19);
  assert_in_range((rnd), (5171), (5810), (100000),
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/donmccaughey/rnd/refs/"
                  "heads/master/rnd_tests.c",
                  20);
  rnd_free(rnd);
}


x86 assembly (clang, -O0):
<test_rnd_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rnd_alloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x3e8,%ecx
lea    0xea6(%rip),%r8
mov    $0x13,%r9d
call   1050 <assert_in_range@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1433,%esi
mov    $0x16b2,%edx
mov    $0x186a0,%ecx
lea    0xe81(%rip),%r8
mov    $0x14,%r9d
call   1050 <assert_in_range@plt>
mov    -0x8(%rbp),%rdi
call   1040 <rnd_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rnd_alloc>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <rnd_alloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x3e8,%ecx
mov    %r14,%r8
mov    $0x13,%r9d
call   1050 <assert_in_range@plt>
mov    %rbx,%rdi
mov    $0x1433,%esi
mov    $0x16b2,%edx
mov    $0x186a0,%ecx
mov    %r14,%r8
mov    $0x14,%r9d
call   1050 <assert_in_range@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <rnd_free@plt>

LLVM IR (-O0):
%struct.rnd = type { i32 }
@.str = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/donmccaughey/rnd/refs/heads/master/rnd_tests.c\00"
define void @test_rnd_alloc() {
%1 = alloca %struct.rnd*
%2 = call %struct.rnd* (...) @rnd_alloc()
store %struct.rnd* %2, %struct.rnd** %1
%3 = load %struct.rnd*, %struct.rnd** %1
%4 = call i32 @assert_in_range(%struct.rnd* %3, i32 0, i32 9, i32 1000, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0), i32 19)
%5 = load %struct.rnd*, %struct.rnd** %1
%6 = call i32 @assert_in_range(%struct.rnd* %5, i32 5171, i32 5810, i32 100000, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0), i32 20)
%7 = load %struct.rnd*, %struct.rnd** %1
%8 = call i32 @rnd_free(%struct.rnd* %7)
ret void
}

LLVM IR (-O2):
%struct.rnd = type { i32 }
@.str = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/donmccaughey/rnd/refs/heads/master/rnd_tests.c\00"
define void @test_rnd_alloc() {
%1 = tail call %struct.rnd* (...) @rnd_alloc()
%2 = tail call i32 @assert_in_range(%struct.rnd* %1, i32 0, i32 9, i32 1000, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0), i32 19)
%3 = tail call i32 @assert_in_range(%struct.rnd* %1, i32 5171, i32 5810, i32 100000, i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0), i32 20)
%4 = tail call i32 @rnd_free(%struct.rnd* %1)
ret void
}