#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 */
scalar_t__ ENOENT;
int creat(char *, int);
scalar_t__ errno;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int utime(char *, int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  int ret;
  int i;
  char *file;
  if (1 == argc) {
    printf("%s: missing file operand\n", argv[0]);
    return 1;
  }
  for (i = 1; i < argc; i++) {
    file = argv[i];
    ret = utime(file, NULL);
    if (-1 == ret) {
      if (errno == ENOENT) {
        ret = creat(file, 0644);
        if (-1 == ret) {
          perror("creat");
          return 1;
        }
      } else {
        perror("utime");
        return 1;
      }
    }
  }
  return 0;
}


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)
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    1183 <main+0x43>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1251 <main+0x111>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    124a <main+0x10a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <utime@plt>
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%eax
cmp    -0x14(%rbp),%eax
jne    1237 <main+0xf7>
mov    0x2e15(%rip),%rax
mov    (%rax),%rax
mov    0x2dfb(%rip),%rcx
cmp    (%rcx),%rax
jne    121a <main+0xda>
mov    -0x20(%rbp),%rdi
mov    $0x1a4,%esi
call   1060 <creat@plt>
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%eax
cmp    -0x14(%rbp),%eax
jne    1215 <main+0xd5>
lea    0xe16(%rip),%rdi
call   1050 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1251 <main+0x111>
jmp    1232 <main+0xf2>
lea    0xdff(%rip),%rdi
call   1050 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1251 <main+0x111>
jmp    1237 <main+0xf7>
jmp    123c <main+0xfc>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    118a <main+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
cmp    $0x1,%edi
jne    1169 <main+0x29>
mov    (%r14),%rsi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
jmp    11d3 <main+0x93>
xor    %eax,%eax
cmp    $0x2,%edi
jl     11d3 <main+0x93>
mov    %edi,%r15d
mov    $0x1,%ebx
mov    0x2e61(%rip),%r13
mov    0x2e4a(%rip),%rbp
jmp    1199 <main+0x59>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r15
je     11d1 <main+0x91>
mov    (%r14,%rbx,8),%r12
mov    %r12,%rdi
xor    %esi,%esi
call   1030 <utime@plt>
cmp    $0xffffffff,%eax
jne    1190 <main+0x50>
mov    0x0(%r13),%rax
cmp    0x0(%rbp),%rax
jne    11e2 <main+0xa2>
mov    %r12,%rdi
mov    $0x1a4,%esi
call   1060 <creat@plt>
cmp    $0xffffffff,%eax
jne    1190 <main+0x50>
lea    0xe4b(%rip),%rdi
jmp    11e9 <main+0xa9>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe37(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%eax
jmp    11d3 <main+0x93>

LLVM IR (-O0):
@.str = [26 x i8] c"%s: missing file operand\0A\00"
@errno = global i64 0
@ENOENT = global i64 0
@.str.1 = [6 x i8] c"creat\00"
@.str.2 = [6 x i8] c"utime\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp eq i32 1, %9
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 1, i32* %3
br label %51
16: ; preds = %2
store i32 1, i32* %7
br label %17
17: ; preds = %47, %16
%18 = load i32, i32* %7
%19 = load i32, i32* %4
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %50
21: ; preds = %17
%22 = load i8**, i8*** %5
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
store i8* %26, i8** %8
%27 = load i8*, i8** %8
%28 = call i32 @utime(i8* %27, i32* null)
store i32 %28, i32* %6
%29 = load i32, i32* %6
%30 = icmp eq i32 -1, %29
br i1 %30, label %31, label %46
31: ; preds = %21
%32 = load i64, i64* @errno
%33 = load i64, i64* @ENOENT
%34 = icmp eq i64 %32, %33
br i1 %34, label %35, label %43
35: ; preds = %31
%36 = load i8*, i8** %8
%37 = call i32 @creat(i8* %36, i32 420)
store i32 %37, i32* %6
%38 = load i32, i32* %6
%39 = icmp eq i32 -1, %38
br i1 %39, label %40, label %42
40: ; preds = %35
%41 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %51
42: ; preds = %35
br label %45
43: ; preds = %31
%44 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %51
45: ; preds = %42
br label %46
46: ; preds = %45, %21
br label %47
47: ; preds = %46
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
store i32 %49, i32* %7
br label %17
50: ; preds = %17
store i32 0, i32* %3
br label %51
51: ; preds = %50, %43, %40, %11
%52 = load i32, i32* %3
ret i32 %52
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s: missing file operand\0A\00"
@errno = global i64 0
@ENOENT = global i64 0
@.str.1 = [6 x i8] c"creat\00"
@.str.2 = [6 x i8] c"utime\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %31
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %11
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %31
11: ; preds = %6, %28
%12 = phi i64 [ 1, %6 ], [ %29, %28 ]
%13 = getelementptr inbounds i8*, i8** %1, i64 %12
%14 = load i8*, i8** %13
%15 = tail call i32 @utime(i8* %14, i32* null)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %28
17: ; preds = %11
%18 = load i64, i64* @errno
%19 = load i64, i64* @ENOENT
%20 = icmp eq i64 %18, %19
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = tail call i32 @creat(i8* %14, i32 420)
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %31
26: ; preds = %17
%27 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %31
28: ; preds = %11, %21
%29 = add nuw nsw i64 %12, 1
%30 = icmp eq i64 %29, %7
br i1 %30, label %31, label %11
31: ; preds = %28, %4, %26, %24, %8
%32 = phi i32 [ 1, %8 ], [ 1, %24 ], [ 1, %26 ], [ 0, %4 ], [ 0, %28 ]
ret i32 %32
}