#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ write_into_file(int /*<<< orphan*/ *, char const *, char *,
                                   char const **);
void write_multiple_into_file(FILE *outfile, int len, const char *opt,
                              char **arg, const char *values[]) {
  int i;
  for (i = 0; i < len; ++i)
    write_into_file(outfile, opt, (arg ? arg[i] : 0), values);
}


x86 assembly (clang, -O0):
<write_multiple_into_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    119c <write_multiple_into_file+0x8c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     116e <write_multiple_into_file+0x5e>
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
jmp    1179 <write_multiple_into_file+0x69>
xor    %eax,%eax
mov    %rax,-0x48(%rbp)
jmp    1179 <write_multiple_into_file+0x69>
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <write_into_file@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1132 <write_multiple_into_file+0x22>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_multiple_into_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1164 <write_multiple_into_file+0x54>
mov    %r8,%r14
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rdi,%r12
mov    %esi,%r13d
xor    %ebp,%ebp
jmp    115b <write_multiple_into_file+0x4b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx,%rbp,8),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rcx
call   1030 <write_into_file@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
je     1164 <write_multiple_into_file+0x54>
test   %rbx,%rbx
jne    1140 <write_multiple_into_file+0x30>
xor    %edx,%edx
jmp    1144 <write_multiple_into_file+0x34>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @write_multiple_into_file(i32* %0, i32 %1, i8* %2, i8** %3, i8** %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8**
%10 = alloca i8**
%11 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8** %3, i8*** %9
store i8** %4, i8*** %10
store i32 0, i32* %11
br label %12
12: ; preds = %32, %5
%13 = load i32, i32* %11
%14 = load i32, i32* %7
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %35
16: ; preds = %12
%17 = load i32*, i32** %6
%18 = load i8*, i8** %8
%19 = load i8**, i8*** %9
%20 = icmp ne i8** %19, null
br i1 %20, label %21, label %27
21: ; preds = %16
%22 = load i8**, i8*** %9
%23 = load i32, i32* %11
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
br label %28
27: ; preds = %16
br label %28
28: ; preds = %27, %21
%29 = phi i8* [ %26, %21 ], [ null, %27 ]
%30 = load i8**, i8*** %10
%31 = call i32 @write_into_file(i32* %17, i8* %18, i8* %29, i8** %30)
br label %32
32: ; preds = %28
%33 = load i32, i32* %11
%34 = add nsw i32 %33, 1
store i32 %34, i32* %11
br label %12
35: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @write_multiple_into_file(i32* %0, i32 %1, i8* %2, i8** %3, i8** %4) {
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %20
7: ; preds = %5
%8 = icmp eq i8** %3, null
%9 = zext i32 %1 to i64
br label %10
10: ; preds = %7, %15
%11 = phi i64 [ 0, %7 ], [ %18, %15 ]
br i1 %8, label %15, label %12
12: ; preds = %10
%13 = getelementptr inbounds i8*, i8** %3, i64 %11
%14 = load i8*, i8** %13
br label %15
15: ; preds = %10, %12
%16 = phi i8* [ %14, %12 ], [ null, %10 ]
%17 = tail call i32 @write_into_file(i32* %0, i8* %2, i8* %16, i8** %4)
%18 = add nuw nsw i64 %11, 1
%19 = icmp eq i64 %18, %9
br i1 %19, label %20, label %10
20: ; preds = %15, %5
ret void
}