#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_mrand48();
int /*<<< orphan*/ rnd_free(struct rnd *);
void test_alloc_mrand48(void) {
  struct rnd *rnd = rnd_alloc_mrand48();
  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",
                  39);
  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",
                  40);
  rnd_free(rnd);
}


x86 assembly (clang, -O0):
<test_alloc_mrand48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rnd_alloc_mrand48@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x3e8,%ecx
lea    0xea6(%rip),%r8
mov    $0x27,%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    $0x28,%r9d
call   1050 <assert_in_range@plt>
mov    -0x8(%rbp),%rdi
call   1030 <rnd_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_alloc_mrand48>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <rnd_alloc_mrand48@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x3e8,%ecx
mov    %r14,%r8
mov    $0x27,%r9d
call   1050 <assert_in_range@plt>
mov    %rbx,%rdi
mov    $0x1433,%esi
mov    $0x16b2,%edx
mov    $0x186a0,%ecx
mov    %r14,%r8
mov    $0x28,%r9d
call   1050 <assert_in_range@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <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_alloc_mrand48() {
%1 = alloca %struct.rnd*
%2 = call %struct.rnd* (...) @rnd_alloc_mrand48()
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 39)
%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 40)
%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_alloc_mrand48() {
%1 = tail call %struct.rnd* (...) @rnd_alloc_mrand48()
%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 39)
%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 40)
%4 = tail call i32 @rnd_free(%struct.rnd* %1)
ret void
}