#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 */

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int edit_file(char *);
int main(int argc, char *argv[]) {
  if (argc == 1) {
    return EXIT_FAILURE;
  }
  for (int i = 1; i < argc; i += 1) {
    int file_status;
    if ((file_status = edit_file(argv[i])) != EXIT_SUCCESS) {
      return file_status;
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <main+0x31>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11a1 <main+0x91>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1195 <main+0x85>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <edit_file@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e69(%rip),%rcx
cmp    (%rcx),%eax
je     1182 <main+0x72>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11a1 <main+0x91>
jmp    1187 <main+0x77>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1148 <main+0x38>
mov    0x2e3c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    1127 <main+0x17>
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
jmp    1183 <main+0x73>
jle    116e <main+0x5e>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
call   1030 <edit_file@plt>
mov    0x2e9a(%rip),%r14
mov    (%r14),%ecx
cmp    %ecx,%eax
jne    1183 <main+0x73>
mov    %ebp,%r15d
mov    $0x2,%edx
nopl   (%rax)
mov    %rdx,%rbp
cmp    %rdx,%r15
je     1179 <main+0x69>
mov    (%rbx,%rbp,8),%rdi
call   1030 <edit_file@plt>
mov    (%r14),%ecx
lea    0x1(%rbp),%rdx
cmp    %ecx,%eax
je     1150 <main+0x40>
jmp    117b <main+0x6b>
mov    0x2e63(%rip),%rax
mov    (%rax),%eax
jmp    1183 <main+0x73>
xor    %eax,%eax
cmp    %r15,%rbp
cmovb  %eax,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = load i32, i32* @EXIT_SUCCESS
br label %34
8: ; preds = %4
%9 = zext i32 %0 to i64
%10 = zext i32 %0 to i64
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @edit_file(i8* %12)
%14 = load i32, i32* @EXIT_SUCCESS
%15 = icmp eq i32 %13, %14
br i1 %15, label %18, label %34
16: ; preds = %2
%17 = load i32, i32* @EXIT_FAILURE
br label %34
18: ; preds = %8, %22
%19 = phi i64 [ %28, %22 ], [ 2, %8 ]
%20 = phi i32 [ %26, %22 ], [ %14, %8 ]
%21 = icmp eq i64 %19, %10
br i1 %21, label %29, label %22
22: ; preds = %18
%23 = getelementptr inbounds i8*, i8** %1, i64 %19
%24 = load i8*, i8** %23
%25 = tail call i32 @edit_file(i8* %24)
%26 = load i32, i32* @EXIT_SUCCESS
%27 = icmp eq i32 %25, %26
%28 = add nuw nsw i64 %19, 1
br i1 %27, label %18, label %29
29: ; preds = %22, %18
%30 = phi i32 [ %20, %18 ], [ %26, %22 ]
%31 = phi i32 [ 0, %18 ], [ %25, %22 ]
%32 = icmp ult i64 %19, %9
%33 = select i1 %32, i32 %31, i32 %30
br label %34
34: ; preds = %8, %29, %6, %16
%35 = phi i32 [ %17, %16 ], [ %7, %6 ], [ %13, %8 ], [ %33, %29 ]
ret i32 %35
}