#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 tms {
  long tms_cutime;
  long tms_cstime;
};

/* Variables and functions */
int /*<<< orphan*/ prn(int);
int /*<<< orphan*/ prs(char *);
int /*<<< orphan*/ times(struct tms *);
int dotimes() {
  struct tms tbuf;
  times(&tbuf);
  prn((int)(tbuf.tms_cutime / 3600L));
  prs("m");
  prn((int)((tbuf.tms_cutime % 3600L) / 60L));
  prs("s ");
  prn((int)(tbuf.tms_cstime / 3600L));
  prs("m");
  prn((int)((tbuf.tms_cstime % 3600L) / 60L));
  prs("s\n");
  return (0);
}


x86 assembly (clang, -O0):
<dotimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1050 <times@plt>
mov    -0x10(%rbp),%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
mov    %eax,%edi
call   1030 <prn@plt>
lea    0xea3(%rip),%rdi
call   1040 <prs@plt>
mov    -0x10(%rbp),%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %eax,%edi
call   1030 <prn@plt>
lea    0xe77(%rip),%rdi
call   1040 <prs@plt>
mov    -0x8(%rbp),%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
mov    %eax,%edi
call   1030 <prn@plt>
lea    0xe54(%rip),%rdi
call   1040 <prs@plt>
mov    -0x8(%rbp),%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
mov    %rdx,%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %eax,%edi
call   1030 <prn@plt>
lea    0xe2b(%rip),%rdi
call   1040 <prs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotimes>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1050 <times@plt>
mov    0x8(%rsp),%r15
movabs $0x48d159e26af37c05,%r12
59 d1 48
mov    %r15,%rax
imul   %r12
mov    %rdx,%rbx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0xa,%rbx
add    %eax,%ebx
mov    %ebx,%edi
call   1030 <prn@plt>
lea    0xe88(%rip),%r14
mov    %r14,%rdi
call   1040 <prs@plt>
imul   $0xe10,%ebx,%eax
sub    %eax,%r15d
movswl %r15w,%eax
imul   $0xffff8889,%eax,%eax
shr    $0x10,%eax
add    %r15d,%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
sar    $0x5,%ecx
add    %eax,%ecx
movswl %cx,%edi
call   1030 <prn@plt>
lea    0xe4c(%rip),%rdi
call   1040 <prs@plt>
mov    0x10(%rsp),%r15
mov    %r15,%rax
imul   %r12
mov    %rdx,%rbx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0xa,%rbx
add    %eax,%ebx
mov    %ebx,%edi
call   1030 <prn@plt>
mov    %r14,%rdi
call   1040 <prs@plt>
imul   $0xe10,%ebx,%eax
sub    %eax,%r15d
movswl %r15w,%eax
imul   $0xffff8889,%eax,%eax
shr    $0x10,%eax
add    %r15d,%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
sar    $0x5,%ecx
add    %eax,%ecx
movswl %cx,%edi
call   1030 <prn@plt>
lea    0xdea(%rip),%rdi
call   1040 <prs@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tms = type { i64, i64 }
@.str = [2 x i8] c"m\00"
@.str.1 = [3 x i8] c"s \00"
@.str.2 = [3 x i8] c"s\0A\00"
define i32 @dotimes() {
%1 = alloca %struct.tms
%2 = call i32 @times(%struct.tms* %1)
%3 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = sdiv i64 %4, 3600
%6 = trunc i64 %5 to i32
%7 = call i32 @prn(i32 %6)
%8 = call i32 @prs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 0
%10 = load i64, i64* %9
%11 = srem i64 %10, 3600
%12 = sdiv i64 %11, 60
%13 = trunc i64 %12 to i32
%14 = call i32 @prn(i32 %13)
%15 = call i32 @prs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 1
%17 = load i64, i64* %16
%18 = sdiv i64 %17, 3600
%19 = trunc i64 %18 to i32
%20 = call i32 @prn(i32 %19)
%21 = call i32 @prs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%22 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 1
%23 = load i64, i64* %22
%24 = srem i64 %23, 3600
%25 = sdiv i64 %24, 60
%26 = trunc i64 %25 to i32
%27 = call i32 @prn(i32 %26)
%28 = call i32 @prs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.tms = type { i64, i64 }
@.str = [2 x i8] c"m\00"
@.str.1 = [3 x i8] c"s \00"
@.str.2 = [3 x i8] c"s\0A\00"
define i32 @dotimes() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = sdiv i64 %5, 3600
%7 = trunc i64 %6 to i32
%8 = tail call i32 @prn(i32 %7)
%9 = tail call i32 @prs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = srem i64 %5, 3600
%11 = trunc i64 %10 to i16
%12 = sdiv i16 %11, 60
%13 = sext i16 %12 to i32
%14 = tail call i32 @prn(i32 %13)
%15 = tail call i32 @prs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 1
%17 = load i64, i64* %16
%18 = sdiv i64 %17, 3600
%19 = trunc i64 %18 to i32
%20 = tail call i32 @prn(i32 %19)
%21 = tail call i32 @prs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%22 = srem i64 %17, 3600
%23 = trunc i64 %22 to i16
%24 = sdiv i16 %23, 60
%25 = sext i16 %24 to i32
%26 = tail call i32 @prn(i32 %25)
%27 = tail call i32 @prs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}