#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 EIO;
int createQueryURL(char const *, int, char const *, char *, int, char const **,
                   char const **, char **);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int snprintf(char *, int, char *, unsigned long);
int createUrlForUTIMES(const char *host, int nnPort, const char *path,
                       long unsigned mTime, long unsigned aTime,
                       const char *user, char **url) {
  int strlength;
  char modTime[21], acsTime[21];
  const char *paraNames[3], *paraValues[3];
  memset(modTime, 0, 21);
  memset(acsTime, 0, 21);
  strlength = snprintf(modTime, 21, "%lu", mTime);
  if (strlength < 0 || strlength >= 21) {
    return EIO;
  }
  strlength = snprintf(acsTime, 21, "%lu", aTime);
  if (strlength < 0 || strlength >= 21) {
    return EIO;
  }
  paraNames[0] = "modificationtime";
  paraNames[1] = "accesstime";
  paraNames[2] = "user.name";
  paraValues[0] = modTime;
  paraValues[1] = acsTime;
  paraValues[2] = user;
  return createQueryURL(host, nnPort, path, "SETTIMES", 3, paraNames,
                        paraValues, url);
}


x86 assembly (clang, -O0):
<createUrlForUTIMES>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x15,%edx
call   1050 <memset@plt>
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x15,%edx
call   1050 <memset@plt>
lea    -0x60(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x15,%esi
lea    0xe76(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jl     11a6 <createUrlForUTIMES+0x76>
cmpl   $0x15,-0x3c(%rbp)
jl     11b7 <createUrlForUTIMES+0x87>
mov    0x2e33(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <createUrlForUTIMES+0x14e>
lea    -0x80(%rbp),%rdi
mov    -0x30(%rbp),%rcx
mov    $0x15,%esi
lea    0xe35(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jl     11e7 <createUrlForUTIMES+0xb7>
cmpl   $0x15,-0x3c(%rbp)
jl     11f8 <createUrlForUTIMES+0xc8>
mov    0x2df2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    127e <createUrlForUTIMES+0x14e>
lea    0xe05(%rip),%rax
mov    %rax,-0xa0(%rbp)
lea    0xe08(%rip),%rax
mov    %rax,-0x98(%rbp)
lea    0xe05(%rip),%rax
mov    %rax,-0x90(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0xc0(%rbp)
lea    -0x80(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    -0xa0(%rbp),%r9
lea    -0xc0(%rbp),%r10
mov    0x10(%rbp),%rax
lea    0xdc3(%rip),%rcx
mov    $0x3,%r8d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <createQueryURL@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createUrlForUTIMES>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %r9,%r13
mov    %r8,%rbp
mov    %rcx,%r14
mov    %rdx,0x8(%rsp)
mov    %esi,%r15d
mov    %rdi,%r12
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x15,%edx
call   1050 <memset@plt>
lea    0x50(%rsp),%rdi
xor    %esi,%esi
mov    $0x15,%edx
call   1050 <memset@plt>
lea    0xe7f(%rip),%rdx
mov    %rbx,%rdi
mov    $0x15,%esi
mov    %r14,%rcx
call   1030 <snprintf@plt>
cmp    $0x15,%eax
jae    11b7 <createUrlForUTIMES+0x87>
lea    0xe63(%rip),%rdx
lea    0x50(%rsp),%r14
mov    %r14,%rdi
mov    $0x15,%esi
mov    %rbp,%rcx
call   1030 <snprintf@plt>
cmp    $0x15,%eax
jb     11c2 <createUrlForUTIMES+0x92>
mov    0x2e22(%rip),%rax
mov    (%rax),%eax
jmp    122a <createUrlForUTIMES+0xfa>
mov    0xc0(%rsp),%rax
lea    0xe33(%rip),%rcx
mov    %rcx,0x30(%rsp)
lea    0xe38(%rip),%rcx
mov    %rcx,0x38(%rsp)
lea    0xe37(%rip),%rcx
mov    %rcx,0x40(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r14,0x18(%rsp)
mov    %r13,0x20(%rsp)
lea    0x10(%rsp),%rbp
lea    0xe21(%rip),%rcx
lea    0x30(%rsp),%r9
mov    %r12,%rdi
mov    %r15d,%esi
mov    0x8(%rsp),%rdx
mov    $0x3,%r8d
push   %rax
push   %rbp
call   1040 <createQueryURL@plt>
add    $0x10,%rsp
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lu\00"
@EIO = global i32 0
@.str.1 = [17 x i8] c"modificationtime\00"
@.str.2 = [11 x i8] c"accesstime\00"
@.str.3 = [10 x i8] c"user.name\00"
@.str.4 = [9 x i8] c"SETTIMES\00"
define i32 @createUrlForUTIMES(i8* %0, i32 %1, i8* %2, i64 %3, i64 %4, i8* %5, i8** %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i8**
%16 = alloca i32
%17 = alloca [21 x i8]
%18 = alloca [21 x i8]
%19 = alloca [3 x i8*]
%20 = alloca [3 x i8*]
store i8* %0, i8** %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i64 %3, i64* %12
store i64 %4, i64* %13
store i8* %5, i8** %14
store i8** %6, i8*** %15
%21 = getelementptr inbounds [21 x i8], [21 x i8]* %17, i64 0, i64 0
%22 = call i32 @memset(i8* %21, i32 0, i32 21)
%23 = getelementptr inbounds [21 x i8], [21 x i8]* %18, i64 0, i64 0
%24 = call i32 @memset(i8* %23, i32 0, i32 21)
%25 = getelementptr inbounds [21 x i8], [21 x i8]* %17, i64 0, i64 0
%26 = load i64, i64* %12
%27 = call i32 @snprintf(i8* %25, i32 21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %26)
store i32 %27, i32* %16
%28 = load i32, i32* %16
%29 = icmp slt i32 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %7
%31 = load i32, i32* %16
%32 = icmp sge i32 %31, 21
br i1 %32, label %33, label %35
33: ; preds = %30, %7
%34 = load i32, i32* @EIO
store i32 %34, i32* %8
br label %63
35: ; preds = %30
%36 = getelementptr inbounds [21 x i8], [21 x i8]* %18, i64 0, i64 0
%37 = load i64, i64* %13
%38 = call i32 @snprintf(i8* %36, i32 21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %37)
store i32 %38, i32* %16
%39 = load i32, i32* %16
%40 = icmp slt i32 %39, 0
br i1 %40, label %44, label %41
41: ; preds = %35
%42 = load i32, i32* %16
%43 = icmp sge i32 %42, 21
br i1 %43, label %44, label %46
44: ; preds = %41, %35
%45 = load i32, i32* @EIO
store i32 %45, i32* %8
br label %63
46: ; preds = %41
%47 = getelementptr inbounds [3 x i8*], [3 x i8*]* %19, i64 0, i64 0
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %47
%48 = getelementptr inbounds [3 x i8*], [3 x i8*]* %19, i64 0, i64 1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %48
%49 = getelementptr inbounds [3 x i8*], [3 x i8*]* %19, i64 0, i64 2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8** %49
%50 = getelementptr inbounds [21 x i8], [21 x i8]* %17, i64 0, i64 0
%51 = getelementptr inbounds [3 x i8*], [3 x i8*]* %20, i64 0, i64 0
store i8* %50, i8** %51
%52 = getelementptr inbounds [21 x i8], [21 x i8]* %18, i64 0, i64 0
%53 = getelementptr inbounds [3 x i8*], [3 x i8*]* %20, i64 0, i64 1
store i8* %52, i8** %53
%54 = load i8*, i8** %14
%55 = getelementptr inbounds [3 x i8*], [3 x i8*]* %20, i64 0, i64 2
store i8* %54, i8** %55
%56 = load i8*, i8** %9
%57 = load i32, i32* %10
%58 = load i8*, i8** %11
%59 = getelementptr inbounds [3 x i8*], [3 x i8*]* %19, i64 0, i64 0
%60 = getelementptr inbounds [3 x i8*], [3 x i8*]* %20, i64 0, i64 0
%61 = load i8**, i8*** %15
%62 = call i32 @createQueryURL(i8* %56, i32 %57, i8* %58, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 3, i8** %59, i8** %60, i8** %61)
store i32 %62, i32* %8
br label %63
63: ; preds = %46, %44, %33
%64 = load i32, i32* %8
ret i32 %64
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lu\00"
@EIO = global i32 0
@.str.1 = [17 x i8] c"modificationtime\00"
@.str.2 = [11 x i8] c"accesstime\00"
@.str.3 = [10 x i8] c"user.name\00"
@.str.4 = [9 x i8] c"SETTIMES\00"
define i32 @createUrlForUTIMES(i8* %0, i32 %1, i8* %2, i64 %3, i64 %4, i8* %5, i8** %6) {
%8 = alloca [21 x i8]
%9 = alloca [21 x i8]
%10 = alloca [3 x i8*]
%11 = alloca [3 x i8*]
%12 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 0
%13 = getelementptr inbounds [21 x i8], [21 x i8]* %9, i64 0, i64 0
%14 = bitcast [3 x i8*]* %10 to i8*
%15 = bitcast [3 x i8*]* %11 to i8*
%16 = call i32 @memset(i8* %12, i32 0, i32 21)
%17 = call i32 @memset(i8* %13, i32 0, i32 21)
%18 = call i32 @snprintf(i8* %12, i32 21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
%19 = icmp ugt i32 %18, 20
br i1 %19, label %20, label %22
20: ; preds = %7
%21 = load i32, i32* @EIO
br label %35
22: ; preds = %7
%23 = call i32 @snprintf(i8* %13, i32 21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %4)
%24 = icmp ugt i32 %23, 20
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = load i32, i32* @EIO
br label %35
27: ; preds = %22
%28 = getelementptr inbounds [3 x i8*], [3 x i8*]* %10, i64 0, i64 0
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %28
%29 = getelementptr inbounds [3 x i8*], [3 x i8*]* %10, i64 0, i64 1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %29
%30 = getelementptr inbounds [3 x i8*], [3 x i8*]* %10, i64 0, i64 2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8** %30
%31 = getelementptr inbounds [3 x i8*], [3 x i8*]* %11, i64 0, i64 0
store i8* %12, i8** %31
%32 = getelementptr inbounds [3 x i8*], [3 x i8*]* %11, i64 0, i64 1
store i8* %13, i8** %32
%33 = getelementptr inbounds [3 x i8*], [3 x i8*]* %11, i64 0, i64 2
store i8* %5, i8** %33
%34 = call i32 @createQueryURL(i8* %0, i32 %1, i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 3, i8** %28, i8** %31, i8** %6)
br label %35
35: ; preds = %27, %25, %20
%36 = phi i32 [ %21, %20 ], [ %26, %25 ], [ %34, %27 ]
ret i32 %36
}