#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 discrete_world {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ discrete_world_constant_param_fill(struct discrete_world *,
                                                      int /*<<< orphan*/,
                                                      unsigned int,
                                                      int /*<<< orphan*/, int,
                                                      long *);
int /*<<< orphan*/
discrete_world_testbench_world_is_filled_with(struct discrete_world *,
                                              unsigned int, long);
int sprintf(char *, char *, long);
int /*<<< orphan*/ write(int, char *, int);
int discrete_world_testbench_test_long_fill(struct discrete_world *world,
                                            unsigned int param_index,
                                            long var) {
  char string[100];
  write(1, string, sprintf(string, "Filling with %ld\n", var));
  discrete_world_constant_param_fill(world, 0, param_index, 0, sizeof(long),
                                     &var);
  write(1, "Verifying ...\n", sizeof("Verifying ...\n"));
  if (!discrete_world_testbench_world_is_filled_with(world, param_index, var))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<discrete_world_testbench_test_long_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x98(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
mov    $0x8,%r8d
lea    -0x20(%rbp),%r9
mov    %ecx,%esi
call   1060 <discrete_world_constant_param_fill@plt>
mov    $0x1,%edi
lea    0xe5e(%rip),%rsi
mov    $0xf,%edx
call   1030 <write@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <discrete_world_testbench_world_is_filled_with@plt>
cmp    $0x0,%eax
jne    11e3 <discrete_world_testbench_test_long_fill+0xa3>
movl   $0x0,-0x4(%rbp)
jmp    11ea <discrete_world_testbench_test_long_fill+0xaa>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<discrete_world_testbench_test_long_fill>:
push   %rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,0x8(%rsp)
lea    0xea4(%rip),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1050 <sprintf@plt>
mov    $0x1,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0x8(%rsp),%r9
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
mov    $0x8,%r8d
call   1060 <discrete_world_constant_param_fill@plt>
lea    0xe7a(%rip),%rsi
mov    $0x1,%edi
mov    $0xf,%edx
call   1030 <write@plt>
mov    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <discrete_world_testbench_world_is_filled_with@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.discrete_world = type { i32 }
@.str = [18 x i8] c"Filling with %ld\0A\00"
@.str.1 = [15 x i8] c"Verifying ...\0A\00"
define i32 @discrete_world_testbench_test_long_fill(%struct.discrete_world* %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.discrete_world*
%6 = alloca i32
%7 = alloca i64
%8 = alloca [100 x i8]
store %struct.discrete_world* %0, %struct.discrete_world** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%11 = load i64, i64* %7
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = call i32 @write(i32 1, i8* %9, i32 %12)
%14 = load %struct.discrete_world*, %struct.discrete_world** %5
%15 = load i32, i32* %6
%16 = call i32 @discrete_world_constant_param_fill(%struct.discrete_world* %14, i32 0, i32 %15, i32 0, i32 8, i64* %7)
%17 = call i32 @write(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 15)
%18 = load %struct.discrete_world*, %struct.discrete_world** %5
%19 = load i32, i32* %6
%20 = load i64, i64* %7
%21 = call i32 @discrete_world_testbench_world_is_filled_with(%struct.discrete_world* %18, i32 %19, i64 %20)
%22 = icmp ne i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %3
store i32 0, i32* %4
br label %25
24: ; preds = %3
store i32 1, i32* %4
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
%struct.discrete_world = type { i32 }
@.str = [18 x i8] c"Filling with %ld\0A\00"
@.str.1 = [15 x i8] c"Verifying ...\0A\00"
define i32 @discrete_world_testbench_test_long_fill(%struct.discrete_world* %0, i32 %1, i64 %2) {
%4 = alloca i64
%5 = alloca [100 x i8]
store i64 %2, i64* %4
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %2)
%8 = call i32 @write(i32 1, i8* %6, i32 %7)
%9 = call i32 @discrete_world_constant_param_fill(%struct.discrete_world* %0, i32 0, i32 %1, i32 0, i32 8, i64* %4)
%10 = call i32 @write(i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 15)
%11 = load i64, i64* %4
%12 = call i32 @discrete_world_testbench_world_is_filled_with(%struct.discrete_world* %0, i32 %1, i64 %11)
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}