#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 /*<<< orphan*/ afficheChaine(char *, int, int, scalar_t__);
int /*<<< orphan*/ couleurCourante(int, int, int);
int /*<<< orphan*/ epaisseurDeTrait(int);
int gestionDuree(int);
scalar_t__ hauteurFenetre();
int largeurFenetre();
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
void afficheDuree(int taille) {
  char chaine[20];
  int dure = gestionDuree(1);
  int H = dure / 3600;
  int m = (dure - H * 3600) / 60;
  int s = (dure - H * 3600 - m * 60);
  sprintf(chaine, "%.2dh%.2dm%.2ds", H, m, s);
  epaisseurDeTrait(1);
  couleurCourante(240, 255, 255);
  epaisseurDeTrait(1);
  afficheChaine(chaine, taille / 10, 2 * largeurFenetre() / 3,
                hauteurFenetre() - taille / 4);
}


x86 assembly (clang, -O0):
<afficheDuree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1060 <gestionDuree@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
imul   $0xe10,-0x28(%rbp),%ecx
sub    %ecx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
imul   $0xe10,-0x28(%rbp),%ecx
sub    %ecx,%eax
imul   $0x3c,-0x2c(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
lea    0xe29(%rip),%rsi
call   1080 <sprintf@plt>
mov    $0x1,%edi
call   1040 <epaisseurDeTrait@plt>
mov    $0xf0,%edi
mov    $0xff,%edx
mov    %edx,%esi
call   1070 <couleurCourante@plt>
mov    $0x1,%edi
call   1040 <epaisseurDeTrait@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x38(%rbp)
mov    $0x0,%al
call   1050 <largeurFenetre@plt>
shl    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x34(%rbp)
mov    $0x0,%al
call   1030 <hauteurFenetre@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%esi
mov    %rax,%rcx
mov    -0x4(%rbp),%eax
mov    $0x4,%r8d
cltd
idiv   %r8d
mov    -0x34(%rbp),%edx
cltq
sub    %rax,%rcx
call   1090 <afficheChaine@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficheDuree>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
mov    $0x1,%edi
call   1060 <gestionDuree@plt>
cltq
imul   $0xffffffff91a2b3c5,%rax,%rdx
shr    $0x20,%rdx
add    %eax,%edx
mov    %edx,%ecx
shr    $0x1f,%ecx
sar    $0xb,%edx
add    %ecx,%edx
imul   $0xfffff1f0,%edx,%ecx
add    %eax,%ecx
movslq %ecx,%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%esi
shr    $0x1f,%esi
sar    $0x5,%ecx
add    %esi,%ecx
imul   $0xffffffc4,%ecx,%r8d
add    %eax,%r8d
lea    0xe31(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1080 <sprintf@plt>
mov    $0x1,%edi
call   1040 <epaisseurDeTrait@plt>
mov    $0xf0,%edi
mov    $0xff,%esi
mov    $0xff,%edx
call   1070 <couleurCourante@plt>
mov    $0x1,%edi
call   1040 <epaisseurDeTrait@plt>
movslq %ebp,%r15
imul   $0x66666667,%r15,%rbp
mov    %rbp,%rax
shr    $0x3f,%rax
shr    $0x20,%rbp
sar    $0x2,%ebp
add    %eax,%ebp
xor    %eax,%eax
call   1050 <largeurFenetre@plt>
add    %eax,%eax
cltq
imul   $0x55555556,%rax,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
shr    $0x20,%rbx
add    %eax,%ebx
xor    %eax,%eax
call   1030 <hauteurFenetre@plt>
lea    0x3(%r15),%ecx
test   %r15d,%r15d
cmovns %r15d,%ecx
sar    $0x2,%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %rax,%rcx
call   1090 <afficheChaine@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%.2dh%.2dm%.2ds\00"
define void @afficheDuree(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
%8 = call i32 @gestionDuree(i32 1)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 3600
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = mul nsw i32 %12, 3600
%14 = sub nsw i32 %11, %13
%15 = sdiv i32 %14, 60
store i32 %15, i32* %6
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = mul nsw i32 %17, 3600
%19 = sub nsw i32 %16, %18
%20 = load i32, i32* %6
%21 = mul nsw i32 %20, 60
%22 = sub nsw i32 %19, %21
store i32 %22, i32* %7
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = call i32 @sprintf(i8* %23, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %24, i32 %25, i32 %26)
%28 = call i32 @epaisseurDeTrait(i32 1)
%29 = call i32 @couleurCourante(i32 240, i32 255, i32 255)
%30 = call i32 @epaisseurDeTrait(i32 1)
%31 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%32 = load i32, i32* %2
%33 = sdiv i32 %32, 10
%34 = call i32 (...) @largeurFenetre()
%35 = mul nsw i32 2, %34
%36 = sdiv i32 %35, 3
%37 = call i64 (...) @hauteurFenetre()
%38 = load i32, i32* %2
%39 = sdiv i32 %38, 4
%40 = sext i32 %39 to i64
%41 = sub nsw i64 %37, %40
%42 = call i32 @afficheChaine(i8* %31, i32 %33, i32 %36, i64 %41)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%.2dh%.2dm%.2ds\00"
define void @afficheDuree(i32 %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @gestionDuree(i32 1)
%5 = sdiv i32 %4, 3600
%6 = mul nsw i32 %5, -3600
%7 = add i32 %6, %4
%8 = sdiv i32 %7, 60
%9 = mul nsw i32 %8, -60
%10 = add i32 %9, %7
%11 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8, i32 %10)
%12 = tail call i32 @epaisseurDeTrait(i32 1)
%13 = tail call i32 @couleurCourante(i32 240, i32 255, i32 255)
%14 = tail call i32 @epaisseurDeTrait(i32 1)
%15 = sdiv i32 %0, 10
%16 = tail call i32 (...) @largeurFenetre()
%17 = shl nsw i32 %16, 1
%18 = sdiv i32 %17, 3
%19 = tail call i64 (...) @hauteurFenetre()
%20 = sdiv i32 %0, 4
%21 = sext i32 %20 to i64
%22 = sub nsw i64 %19, %21
%23 = call i32 @afficheChaine(i8* %3, i32 %15, i32 %18, i64 %22)
ret void
}