#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 timespec {
  long tv_sec;
  int /*<<< orphan*/ tv_nsec;
};
typedef int ssize_t;

/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, ...);
char *flu_ts_to_hs(struct timespec *ts, char format) {
  char *r = calloc(42 + 1 + 9 + 1, sizeof(char));
  char *rr = r;
  long l;
  long s = ts->tv_sec;
  l = s / (7 * 24 * 60 * 60);
  s = s % (7 * 24 * 60 * 60);
  if (l > 0)
    rr += sprintf(rr, "%liw", l);
  l = s / (24 * 60 * 60);
  s = s % (24 * 60 * 60);
  if (l > 0)
    rr += sprintf(rr, "%lid", l);
  l = s / (60 * 60);
  s = s % (60 * 60);
  if (l > 0)
    rr += sprintf(rr, "%lih", l);
  l = s / (60);
  s = s % (60);
  if (l > 0)
    rr += sprintf(rr, "%lim", l);
  if (s > 0)
    rr += sprintf(rr, "%lis", s);
  else if (rr == r || format != 's')
    rr += sprintf(rr, "0s");
  snprintf(rr, 10, "%09li", ts->tv_nsec);
  ssize_t off = -1;
  if (format == 's')
    off = 0;
  else if (format == 'm')
    off = 3;
  else if (format == 'u')
    off = 6;
  if (off > -1)
    *(rr + off) = '\0';
  return r;
}


x86 assembly (clang, -O0):
<flu_ts_to_hs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x35,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x93a80,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x93a80,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x30(%rbp)
cmpq   $0x0,-0x28(%rbp)
jle    11bd <flu_ts_to_hs+0x8d>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xe5a(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x15180,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x15180,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x30(%rbp)
cmpq   $0x0,-0x28(%rbp)
jle    1212 <flu_ts_to_hs+0xe2>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xe0a(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x30(%rbp)
cmpq   $0x0,-0x28(%rbp)
jle    1267 <flu_ts_to_hs+0x137>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xdba(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x30(%rbp)
cmpq   $0x0,-0x28(%rbp)
jle    12bc <flu_ts_to_hs+0x18c>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xd6a(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x30(%rbp)
jle    12f2 <flu_ts_to_hs+0x1c2>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xd3e(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1334 <flu_ts_to_hs+0x204>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     130d <flu_ts_to_hs+0x1dd>
movsbl -0x9(%rbp),%eax
cmp    $0x73,%eax
je     132f <flu_ts_to_hs+0x1ff>
mov    -0x20(%rbp),%rdi
lea    0xd01(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1334 <flu_ts_to_hs+0x204>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    $0xa,%esi
lea    0xcd1(%rip),%rdx
call   1030 <snprintf@plt>
movl   $0xffffffff,-0x34(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x73,%eax
jne    1370 <flu_ts_to_hs+0x240>
movl   $0x0,-0x34(%rbp)
jmp    13a7 <flu_ts_to_hs+0x277>
movsbl -0x9(%rbp),%eax
cmp    $0x6d,%eax
jne    1389 <flu_ts_to_hs+0x259>
movl   $0x3,-0x34(%rbp)
jmp    13a2 <flu_ts_to_hs+0x272>
movsbl -0x9(%rbp),%eax
cmp    $0x75,%eax
jne    139d <flu_ts_to_hs+0x26d>
movl   $0x6,-0x34(%rbp)
jmp    13a2 <flu_ts_to_hs+0x272>
jmp    13a7 <flu_ts_to_hs+0x277>
cmpl   $0xffffffff,-0x34(%rbp)
jle    13bd <flu_ts_to_hs+0x28d>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flu_ts_to_hs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
mov    $0x35,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%r12
mov    (%r15),%rcx
movabs $0x377aef2669de1559,%rsi
ef 7a 37
mov    %rcx,%rax
imul   %rsi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x11,%rdx
add    %rax,%rdx
imul   $0x93a80,%rdx,%rax
mov    %rcx,%rbx
sub    %rax,%rbx
mov    %r12,%r13
cmp    $0x93a80,%rcx
jl     11ae <flu_ts_to_hs+0x7e>
mov    %rcx,%rax
mul    %rsi
shr    $0x11,%rdx
lea    0xe62(%rip),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
movslq %eax,%r13
add    %r12,%r13
movslq %ebx,%rbp
imul   $0xffffffffc22e4507,%rbp,%rax
shr    $0x20,%rax
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x10,%eax
add    %ecx,%eax
imul   $0x15180,%eax,%eax
sub    %eax,%ebp
cmp    $0x15180,%rbx
jl     11fe <flu_ts_to_hs+0xce>
mov    %ebx,%eax
mov    $0xc22e4507,%edx
imul   %rax,%rdx
shr    $0x30,%rdx
lea    0xe16(%rip),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
cltq
add    %rax,%r13
movslq %ebp,%rax
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %ebp,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xb,%ecx
add    %edx,%ecx
imul   $0xe10,%ecx,%ecx
mov    %eax,%ebx
sub    %ecx,%ebx
cmp    $0xe10,%eax
jl     124e <flu_ts_to_hs+0x11e>
mov    %ebp,%eax
mov    $0x91a2b3c5,%edx
imul   %rax,%rdx
shr    $0x2b,%rdx
lea    0xdcb(%rip),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
cltq
add    %rax,%r13
movswl %bx,%eax
imul   $0xffff8889,%eax,%eax
shr    $0x10,%eax
add    %ebx,%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
sar    $0x5,%ecx
add    %eax,%ecx
imul   $0x3c,%ecx,%eax
mov    %ebx,%ebp
sub    %eax,%ebp
cmp    $0x3c,%ebx
jl     1298 <flu_ts_to_hs+0x168>
movzwl %bx,%eax
imul   $0x8889,%eax,%edx
shr    $0x15,%edx
lea    0xd86(%rip),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
cltq
add    %rax,%r13
test   %bp,%bp
jle    12b6 <flu_ts_to_hs+0x186>
movswq %bp,%rdx
lea    0xd6c(%rip),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
cltq
jmp    12ec <flu_ts_to_hs+0x1bc>
cmp    $0x73,%r14b
jne    12db <flu_ts_to_hs+0x1ab>
cmp    %r12,%r13
je     12db <flu_ts_to_hs+0x1ab>
mov    0x8(%r15),%ecx
lea    0xd50(%rip),%rdx
mov    %r13,%rdi
mov    $0xa,%esi
call   1030 <snprintf@plt>
jmp    1320 <flu_ts_to_hs+0x1f0>
movb   $0x0,0x2(%r13)
movw   $0x7330,0x0(%r13)
mov    $0x2,%eax
add    %rax,%r13
mov    0x8(%r15),%ecx
lea    0xd22(%rip),%rdx
mov    %r13,%rdi
mov    $0xa,%esi
call   1030 <snprintf@plt>
cmp    $0x75,%r14b
je     1324 <flu_ts_to_hs+0x1f4>
cmp    $0x73,%r14b
je     1320 <flu_ts_to_hs+0x1f0>
cmp    $0x6d,%r14b
jne    132f <flu_ts_to_hs+0x1ff>
mov    $0x3,%eax
jmp    1329 <flu_ts_to_hs+0x1f9>
xor    %eax,%eax
jmp    1329 <flu_ts_to_hs+0x1f9>
mov    $0x6,%eax
movb   $0x0,0x0(%r13,%rax,1)
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i32 }
@.str = [5 x i8] c"%liw\00"
@.str.1 = [5 x i8] c"%lid\00"
@.str.2 = [5 x i8] c"%lih\00"
@.str.3 = [5 x i8] c"%lim\00"
@.str.4 = [5 x i8] c"%lis\00"
@.str.5 = [3 x i8] c"0s\00"
@.str.6 = [6 x i8] c"%09li\00"
define i8* @flu_ts_to_hs(%struct.timespec* %0, i8 signext %1) {
%3 = alloca %struct.timespec*
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
store %struct.timespec* %0, %struct.timespec** %3
store i8 %1, i8* %4
%10 = call i8* @calloc(i32 53, i32 1)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
store i8* %11, i8** %6
%12 = load %struct.timespec*, %struct.timespec** %3
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %12, i32 0, i32 0
%14 = load i64, i64* %13
store i64 %14, i64* %8
%15 = load i64, i64* %8
%16 = sdiv i64 %15, 604800
store i64 %16, i64* %7
%17 = load i64, i64* %8
%18 = srem i64 %17, 604800
store i64 %18, i64* %8
%19 = load i64, i64* %7
%20 = icmp sgt i64 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %2
%22 = load i8*, i8** %6
%23 = load i64, i64* %7
%24 = call i32 (i8*, i8*, ...) @sprintf(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %23)
%25 = load i8*, i8** %6
%26 = sext i32 %24 to i64
%27 = getelementptr inbounds i8, i8* %25, i64 %26
store i8* %27, i8** %6
br label %28
28: ; preds = %21, %2
%29 = load i64, i64* %8
%30 = sdiv i64 %29, 86400
store i64 %30, i64* %7
%31 = load i64, i64* %8
%32 = srem i64 %31, 86400
store i64 %32, i64* %8
%33 = load i64, i64* %7
%34 = icmp sgt i64 %33, 0
br i1 %34, label %35, label %42
35: ; preds = %28
%36 = load i8*, i8** %6
%37 = load i64, i64* %7
%38 = call i32 (i8*, i8*, ...) @sprintf(i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %37)
%39 = load i8*, i8** %6
%40 = sext i32 %38 to i64
%41 = getelementptr inbounds i8, i8* %39, i64 %40
store i8* %41, i8** %6
br label %42
42: ; preds = %35, %28
%43 = load i64, i64* %8
%44 = sdiv i64 %43, 3600
store i64 %44, i64* %7
%45 = load i64, i64* %8
%46 = srem i64 %45, 3600
store i64 %46, i64* %8
%47 = load i64, i64* %7
%48 = icmp sgt i64 %47, 0
br i1 %48, label %49, label %56
49: ; preds = %42
%50 = load i8*, i8** %6
%51 = load i64, i64* %7
%52 = call i32 (i8*, i8*, ...) @sprintf(i8* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 %51)
%53 = load i8*, i8** %6
%54 = sext i32 %52 to i64
%55 = getelementptr inbounds i8, i8* %53, i64 %54
store i8* %55, i8** %6
br label %56
56: ; preds = %49, %42
%57 = load i64, i64* %8
%58 = sdiv i64 %57, 60
store i64 %58, i64* %7
%59 = load i64, i64* %8
%60 = srem i64 %59, 60
store i64 %60, i64* %8
%61 = load i64, i64* %7
%62 = icmp sgt i64 %61, 0
br i1 %62, label %63, label %70
63: ; preds = %56
%64 = load i8*, i8** %6
%65 = load i64, i64* %7
%66 = call i32 (i8*, i8*, ...) @sprintf(i8* %64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 %65)
%67 = load i8*, i8** %6
%68 = sext i32 %66 to i64
%69 = getelementptr inbounds i8, i8* %67, i64 %68
store i8* %69, i8** %6
br label %70
70: ; preds = %63, %56
%71 = load i64, i64* %8
%72 = icmp sgt i64 %71, 0
br i1 %72, label %73, label %80
73: ; preds = %70
%74 = load i8*, i8** %6
%75 = load i64, i64* %8
%76 = call i32 (i8*, i8*, ...) @sprintf(i8* %74, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 %75)
%77 = load i8*, i8** %6
%78 = sext i32 %76 to i64
%79 = getelementptr inbounds i8, i8* %77, i64 %78
store i8* %79, i8** %6
br label %95
80: ; preds = %70
%81 = load i8*, i8** %6
%82 = load i8*, i8** %5
%83 = icmp eq i8* %81, %82
br i1 %83, label %88, label %84
84: ; preds = %80
%85 = load i8, i8* %4
%86 = sext i8 %85 to i32
%87 = icmp ne i32 %86, 115
br i1 %87, label %88, label %94
88: ; preds = %84, %80
%89 = load i8*, i8** %6
%90 = call i32 (i8*, i8*, ...) @sprintf(i8* %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%91 = load i8*, i8** %6
%92 = sext i32 %90 to i64
%93 = getelementptr inbounds i8, i8* %91, i64 %92
store i8* %93, i8** %6
br label %94
94: ; preds = %88, %84
br label %95
95: ; preds = %94, %73
%96 = load i8*, i8** %6
%97 = load %struct.timespec*, %struct.timespec** %3
%98 = getelementptr inbounds %struct.timespec, %struct.timespec* %97, i32 0, i32 1
%99 = load i32, i32* %98
%100 = call i32 @snprintf(i8* %96, i32 10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %99)
store i32 -1, i32* %9
%101 = load i8, i8* %4
%102 = sext i8 %101 to i32
%103 = icmp eq i32 %102, 115
br i1 %103, label %104, label %105
104: ; preds = %95
store i32 0, i32* %9
br label %117
105: ; preds = %95
%106 = load i8, i8* %4
%107 = sext i8 %106 to i32
%108 = icmp eq i32 %107, 109
br i1 %108, label %109, label %110
109: ; preds = %105
store i32 3, i32* %9
br label %116
110: ; preds = %105
%111 = load i8, i8* %4
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %112, 117
br i1 %113, label %114, label %115
114: ; preds = %110
store i32 6, i32* %9
br label %115
115: ; preds = %114, %110
br label %116
116: ; preds = %115, %109
br label %117
117: ; preds = %116, %104
%118 = load i32, i32* %9
%119 = icmp sgt i32 %118, -1
br i1 %119, label %120, label %125
120: ; preds = %117
%121 = load i8*, i8** %6
%122 = load i32, i32* %9
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i8, i8* %121, i64 %123
store i8 0, i8* %124
br label %125
125: ; preds = %120, %117
%126 = load i8*, i8** %5
ret i8* %126
}

LLVM IR (-O2):
%struct.timespec = type { i64, i32 }
@.str = [5 x i8] c"%liw\00"
@.str.1 = [5 x i8] c"%lid\00"
@.str.2 = [5 x i8] c"%lih\00"
@.str.3 = [5 x i8] c"%lim\00"
@.str.4 = [5 x i8] c"%lis\00"
@.str.5 = [3 x i8] c"0s\00"
@.str.6 = [6 x i8] c"%09li\00"
define i8* @flu_ts_to_hs(%struct.timespec* nocapture %0, i8 signext %1) {
%3 = tail call dereferenceable_or_null(53) i8* @calloc(i32 53, i32 1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = srem i64 %5, 604800
%7 = icmp sgt i64 %5, 604799
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = udiv i64 %5, 604800
%10 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %3, i64 %11
br label %13
13: ; preds = %8, %2
%14 = phi i8* [ %12, %8 ], [ %3, %2 ]
%15 = trunc i64 %6 to i32
%16 = srem i32 %15, 86400
%17 = icmp sgt i64 %6, 86399
br i1 %17, label %18, label %24
18: ; preds = %13
%19 = udiv i32 %15, 86400
%20 = zext i32 %19 to i64
%21 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %14, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %20)
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %14, i64 %22
br label %24
24: ; preds = %18, %13
%25 = phi i8* [ %23, %18 ], [ %14, %13 ]
%26 = srem i32 %16, 3600
%27 = icmp sgt i32 %16, 3599
br i1 %27, label %28, label %34
28: ; preds = %24
%29 = udiv i32 %16, 3600
%30 = zext i32 %29 to i64
%31 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %25, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 %30)
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %25, i64 %32
br label %34
34: ; preds = %28, %24
%35 = phi i8* [ %33, %28 ], [ %25, %24 ]
%36 = trunc i32 %26 to i16
%37 = srem i16 %36, 60
%38 = sext i16 %37 to i64
%39 = icmp sgt i32 %26, 59
br i1 %39, label %40, label %46
40: ; preds = %34
%41 = udiv i16 %36, 60
%42 = zext i16 %41 to i64
%43 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %35, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 %42)
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %35, i64 %44
br label %46
46: ; preds = %40, %34
%47 = phi i8* [ %45, %40 ], [ %35, %34 ]
%48 = icmp sgt i16 %37, 0
br i1 %48, label %49, label %52
49: ; preds = %46
%50 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %47, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 %38)
%51 = sext i32 %50 to i64
br label %61
52: ; preds = %46
%53 = icmp eq i8* %47, %3
%54 = icmp ne i8 %1, 115
%55 = or i1 %54, %53
br i1 %55, label %60, label %56
56: ; preds = %52
%57 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%58 = load i32, i32* %57
%59 = tail call i32 @snprintf(i8* %47, i32 10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %58)
br label %69
60: ; preds = %52
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %47, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i64 3, i1 false)
br label %61
61: ; preds = %60, %49
%62 = phi i64 [ 2, %60 ], [ %51, %49 ]
%63 = getelementptr inbounds i8, i8* %47, i64 %62
%64 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%65 = load i32, i32* %64
%66 = tail call i32 @snprintf(i8* %63, i32 10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %65)
switch i8 %1, label %73 [
i8 115, label %69
i8 109, label %67
i8 117, label %68
]
67: ; preds = %61
br label %69
68: ; preds = %61
br label %69
69: ; preds = %67, %68, %61, %56
%70 = phi i8* [ %47, %56 ], [ %63, %61 ], [ %63, %68 ], [ %63, %67 ]
%71 = phi i64 [ 0, %56 ], [ 0, %61 ], [ 6, %68 ], [ 3, %67 ]
%72 = getelementptr inbounds i8, i8* %70, i64 %71
store i8 0, i8* %72
br label %73
73: ; preds = %61, %69
ret i8* %3
}