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

/* Variables and functions */
int /*<<< orphan*/ long_long_list_add(struct _long_long_list *, long long);
struct _long_long_list *long_long_list_initial();
struct _long_long_list *long_long_list_initial_fill(int length,
                                                    long long value) {
  struct _long_long_list *s = long_long_list_initial();
  int i;
  for (i = 0; i < length; i++)
    long_long_list_add(s, value);
  return s;
}


x86 assembly (clang, -O0):
<long_long_list_initial_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <long_long_list_initial@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1168 <long_long_list_initial_fill+0x48>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <long_long_list_add@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1141 <long_long_list_initial_fill+0x21>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_long_list_initial_fill>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <long_long_list_initial@plt>
mov    %rax,%rbx
test   %ebp,%ebp
jle    1150 <long_long_list_initial_fill+0x30>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <long_long_list_add@plt>
add    $0xffffffff,%ebp
jne    1140 <long_long_list_initial_fill+0x20>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct._long_long_list = type { i32 }
define %struct._long_long_list* @long_long_list_initial_fill(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca %struct._long_long_list*
%6 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%7 = call %struct._long_long_list* (...) @long_long_list_initial()
store %struct._long_long_list* %7, %struct._long_long_list** %5
store i32 0, i32* %6
br label %8
8: ; preds = %16, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load %struct._long_long_list*, %struct._long_long_list** %5
%14 = load i64, i64* %4
%15 = call i32 @long_long_list_add(%struct._long_long_list* %13, i64 %14)
br label %16
16: ; preds = %12
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %8
19: ; preds = %8
%20 = load %struct._long_long_list*, %struct._long_long_list** %5
ret %struct._long_long_list* %20
}

LLVM IR (-O2):
%struct._long_long_list = type { i32 }
define %struct._long_long_list* @long_long_list_initial_fill(i32 %0, i64 %1) {
%3 = tail call %struct._long_long_list* (...) @long_long_list_initial()
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @long_long_list_add(%struct._long_long_list* %3, i64 %1)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret %struct._long_long_list* %3
}