#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int set_link_mtime(char *, long);
int /*<<< orphan*/ stderr;
long strtol(char *, char **, int);
int main(int argc, char *argv[]) {
  char *endptr;
  long mtime;
  if (argc != 3) {
    fprintf(stderr, "Usage: %s FILE_PATH TIMESTAMP\n", argv[0]);
    return EXIT_FAILURE;
  }
  mtime = strtol(argv[2], &endptr, 10);
  if (*endptr != '\0') {
    fprintf(stderr, "TIMESTAMP must not include non-digits\n");
    return EXIT_FAILURE;
  }
  return set_link_mtime(argv[1], mtime);
}


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   $0x3,-0x8(%rbp)
je     117f <main+0x4f>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe99(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e5 <main+0xb5>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11d1 <main+0xa1>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
lea    0xe66(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e5 <main+0xb5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <set_link_mtime@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    1173 <main+0x43>
mov    0x10(%rbx),%rdi
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    0x8(%rsp),%rcx
cmpb   $0x0,(%rcx)
je     119c <main+0x6c>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    118d <main+0x5d>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe7a(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x8(%rbx),%rdi
mov    %rax,%rsi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <set_link_mtime@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: %s FILE_PATH TIMESTAMP\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [39 x i8] c"TIMESTAMP must not include non-digits\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* @EXIT_FAILURE
store i32 %16, i32* %3
br label %36
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i64 @strtol(i8* %20, i8** %6, i32 10)
store i64 %21, i64* %7
%22 = load i8*, i8** %6
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %17
%27 = load i32, i32* @stderr
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%29 = load i32, i32* @EXIT_FAILURE
store i32 %29, i32* %3
br label %36
30: ; preds = %17
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = load i64, i64* %7
%35 = call i32 @set_link_mtime(i8* %33, i64 %34)
store i32 %35, i32* %3
br label %36
36: ; preds = %30, %26, %10
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: %s FILE_PATH TIMESTAMP\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [39 x i8] c"TIMESTAMP must not include non-digits\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = icmp eq i32 %0, 3
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @EXIT_FAILURE
br label %26
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = call i64 @strtol(i8* %13, i8** %3, i32 10)
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %11
%19 = load i32, i32* @stderr
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* @EXIT_FAILURE
br label %26
22: ; preds = %11
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = tail call i32 @set_link_mtime(i8* %24, i64 %14)
br label %26
26: ; preds = %22, %18, %6
%27 = phi i32 [ %10, %6 ], [ %21, %18 ], [ %25, %22 ]
ret i32 %27
}