#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 utimbuf {
  int /*<<< orphan*/ modtime;
};

/* Variables and functions */
int /*<<< orphan*/ fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ utime(int /*<<< orphan*/, struct utimbuf *);
int main(signed int index, char **__files) {
  if ((index | 0x00) < 0x02) {
    fprintf(stderr, "\nTouch v0.3 - Felipe Ecker (Khun)\n");
    fprintf(stderr, "Use: \n%s <file>\n%s *\n%s dir/*\n\n", *__files, *__files,
            *__files);
    goto __END;
  } else
    __files++;
  struct utimbuf _utbuff;
  while (*__files) {
    fopen(*__files, "a+");
    _utbuff.modtime = time(NULL);
    utime(*__files++, &_utbuff);
  }
__END:
  return index;
}


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    -0x8(%rbp),%eax
or     $0x0,%eax
cmp    $0x2,%eax
jge    11ad <main+0x6d>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe8b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    (%rax),%r8
lea    0xe82(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1212 <main+0xd2>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    11be <main+0x7e>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     120d <main+0xcd>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe69(%rip),%rsi
call   1060 <fopen@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %eax,%edi
lea    -0x18(%rbp),%rsi
call   1030 <utime@plt>
jmp    11be <main+0x7e>
jmp    1212 <main+0xd2>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%r14d
cmp    $0x2,%edi
jge    1186 <main+0x46>
mov    0x2e87(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xe9d(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x0(%rbp),%edi
mov    (%rbx),%rcx
lea    0xeac(%rip),%rsi
mov    %rcx,%rdx
mov    %rcx,%r8
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    11c9 <main+0x89>
mov    0x8(%rbx),%rdi
test   %rdi,%rdi
je     11c9 <main+0x89>
add    $0x10,%rbx
lea    0xea9(%rip),%r15
mov    %rsp,%rbp
nopl   (%rax)
mov    %r15,%rsi
call   1060 <fopen@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,(%rsp)
mov    -0x8(%rbx),%edi
mov    %rbp,%rsi
call   1030 <utime@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    11a0 <main+0x60>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.utimbuf = type { i32 }
@stderr = global i32 0
@.str = [35 x i8] c"\0ATouch v0.3 - Felipe Ecker (Khun)\0A\00"
@.str.1 = [32 x i8] c"Use: \0A%s <file>\0A%s *\0A%s dir/*\0A\0A\00"
@.str.2 = [3 x i8] c"a+\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.utimbuf
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = or i32 %7, 0
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %21
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = load i8**, i8*** %5
%15 = load i8*, i8** %14
%16 = load i8**, i8*** %5
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %15, i8* %17, i8* %19)
br label %41
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i32 1
store i8** %23, i8*** %5
br label %24
24: ; preds = %21
br label %25
25: ; preds = %29, %24
%26 = load i8**, i8*** %5
%27 = load i8*, i8** %26
%28 = icmp ne i8* %27, null
br i1 %28, label %29, label %40
29: ; preds = %25
%30 = load i8**, i8*** %5
%31 = load i8*, i8** %30
%32 = call i32 @fopen(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%33 = call i32 @time(i32* null)
%34 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %6, i32 0, i32 0
store i32 %33, i32* %34
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i32 1
store i8** %36, i8*** %5
%37 = load i8*, i8** %35
%38 = ptrtoint i8* %37 to i32
%39 = call i32 @utime(i32 %38, %struct.utimbuf* %6)
br label %25
40: ; preds = %25
br label %41
41: ; preds = %40, %10
%42 = load i32, i32* %4
ret i32 %42
}

LLVM IR (-O2):
%struct.utimbuf = type { i32 }
@stderr = global i32 0
@.str = [35 x i8] c"\0ATouch v0.3 - Felipe Ecker (Khun)\0A\00"
@.str.1 = [32 x i8] c"Use: \0A%s <file>\0A%s *\0A%s dir/*\0A\0A\00"
@.str.2 = [3 x i8] c"a+\00"
define i32 @main(i32 returned %0, i8** nocapture %1) {
%3 = alloca %struct.utimbuf
%4 = icmp slt i32 %0, 2
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %29, label %9
9: ; preds = %5
%10 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %3, i64 0, i32 0
br label %17
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %1
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %15, i8* %15, i8* %15)
br label %29
17: ; preds = %9, %17
%18 = phi i8* [ %7, %9 ], [ %27, %17 ]
%19 = phi i8** [ %6, %9 ], [ %26, %17 ]
%20 = call i32 @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @time(i32* null)
store i32 %21, i32* %10
%22 = load i8*, i8** %19
%23 = ptrtoint i8* %22 to i64
%24 = trunc i64 %23 to i32
%25 = call i32 @utime(i32 %24, %struct.utimbuf* %3)
%26 = getelementptr inbounds i8*, i8** %19, i64 1
%27 = load i8*, i8** %26
%28 = icmp eq i8* %27, null
br i1 %28, label %29, label %17
29: ; preds = %17, %5, %11
ret i32 %0
}