#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 *);
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");
}


x86 assembly (clang, -O0):
<dotimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
call   1050 <times@plt>
mov    -0x18(%rbp),%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
mov    %eax,%edi
call   1030 <prn@plt>
lea    0xea3(%rip),%rdi
call   1040 <prs@plt>
mov    -0x18(%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    -0x10(%rbp),%rax
mov    $0xe10,%ecx
cqto
idiv   %rcx
mov    %eax,%edi
call   1030 <prn@plt>
lea    0xe54(%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    0xe2b(%rip),%rdi
call   1040 <prs@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%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
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <prs@plt>

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 i32
%2 = alloca %struct.tms
%3 = call i32 @times(%struct.tms* %2)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %2, i32 0, i32 0
%5 = load i64, i64* %4
%6 = sdiv i64 %5, 3600
%7 = trunc i64 %6 to i32
%8 = call i32 @prn(i32 %7)
%9 = call i32 @prs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds %struct.tms, %struct.tms* %2, i32 0, i32 0
%11 = load i64, i64* %10
%12 = srem i64 %11, 3600
%13 = sdiv i64 %12, 60
%14 = trunc i64 %13 to i32
%15 = call i32 @prn(i32 %14)
%16 = call i32 @prs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%17 = getelementptr inbounds %struct.tms, %struct.tms* %2, i32 0, i32 1
%18 = load i64, i64* %17
%19 = sdiv i64 %18, 3600
%20 = trunc i64 %19 to i32
%21 = call i32 @prn(i32 %20)
%22 = call i32 @prs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%23 = getelementptr inbounds %struct.tms, %struct.tms* %2, i32 0, i32 1
%24 = load i64, i64* %23
%25 = srem i64 %24, 3600
%26 = sdiv i64 %25, 60
%27 = trunc i64 %26 to i32
%28 = call i32 @prn(i32 %27)
%29 = call i32 @prs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%30 = load i32, i32* %1
ret i32 %30
}

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 undef
}