#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 *, float, int, int);
int /*<<< orphan*/ couleurCourante(int, int, int);
int gestionDuree(int);
int hauteurFenetre();
int largeurFenetre();
int /*<<< orphan*/ sprintf(char *, char *, int);
void afficheTempRestant(int joueurActuel) {
  float taille = (largeurFenetre() >= hauteurFenetre()) * largeurFenetre() / 6 +
                 (hauteurFenetre() > largeurFenetre()) * hauteurFenetre() / 6;
  gestionDuree(((joueurActuel + 1) % 2) * 2 + 2);
  char tempJ1[5];
  char tempJ2[5];
  sprintf(tempJ1, "%d", gestionDuree(3));
  sprintf(tempJ2, "%d", gestionDuree(5));
  couleurCourante(240, 255, 255);
  afficheChaine(tempJ1, taille / 6, taille / 10, hauteurFenetre() * 8 / 10);
  afficheChaine(tempJ2, taille / 6, largeurFenetre() - 9 * taille / 10,
                hauteurFenetre() * 8 / 10);
}


x86 assembly (clang, -O0):
<afficheTempRestant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <largeurFenetre@plt>
mov    %eax,-0x5c(%rbp)
mov    $0x0,%al
call   1030 <hauteurFenetre@plt>
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
cmp    %ecx,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x58(%rbp)
mov    $0x0,%al
call   1040 <largeurFenetre@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
imul   %ecx,%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4c(%rbp)
mov    $0x0,%al
call   1030 <hauteurFenetre@plt>
mov    %eax,-0x54(%rbp)
mov    $0x0,%al
call   1040 <largeurFenetre@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x50(%rbp)
mov    $0x0,%al
call   1030 <hauteurFenetre@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
imul   %ecx,%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
add    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
shl    $0x1,%edi
add    $0x2,%edi
call   1050 <gestionDuree@plt>
lea    -0xd(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    $0x3,%edi
call   1050 <gestionDuree@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%edx
lea    0xde0(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x12(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    $0x5,%edi
call   1050 <gestionDuree@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%edx
lea    0xdbc(%rip),%rsi
call   1070 <sprintf@plt>
mov    $0xf0,%edi
mov    $0xff,%edx
mov    %edx,%esi
call   1060 <couleurCourante@plt>
lea    -0xd(%rbp),%rax
mov    %rax,-0x38(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xd8d(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xd6f(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x2c(%rbp)
mov    $0x0,%al
call   1030 <hauteurFenetre@plt>
mov    -0x38(%rbp),%rdi
movss  -0x30(%rbp),%xmm0
mov    -0x2c(%rbp),%esi
shl    $0x3,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1080 <afficheChaine@plt>
lea    -0x12(%rbp),%rax
mov    %rax,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xd32(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <largeurFenetre@plt>
cvtsi2ss %eax,%xmm0
movss  0xd12(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  0xd01(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <hauteurFenetre@plt>
mov    -0x28(%rbp),%rdi
movss  -0x1c(%rbp),%xmm0
mov    -0x18(%rbp),%esi
shl    $0x3,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1080 <afficheChaine@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficheTempRestant>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %edi,%r14d
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <largeurFenetre@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1030 <hauteurFenetre@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1040 <largeurFenetre@plt>
mov    $0x0,%ebp
cmp    %r12d,%r15d
jl     11ac <afficheTempRestant+0x4c>
cltq
imul   $0x2aaaaaab,%rax,%rbp
mov    %rbp,%rax
shr    $0x3f,%rax
shr    $0x20,%rbp
add    %eax,%ebp
xor    %eax,%eax
call   1030 <hauteurFenetre@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1040 <largeurFenetre@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1030 <hauteurFenetre@plt>
cmp    %r12d,%r15d
jle    11e2 <afficheTempRestant+0x82>
cltq
imul   $0x2aaaaaab,%rax,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
shr    $0x20,%rbx
add    %eax,%ebx
add    %ebp,%ebx
cvtsi2ss %ebx,%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r14d,%eax
add    $0x1,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %r14d,%ecx
add    $0x1,%ecx
and    $0x7ffffffe,%ecx
sub    %ecx,%eax
lea    (%rax,%rax,1),%edi
add    $0x2,%edi
call   1050 <gestionDuree@plt>
mov    $0x3,%edi
call   1050 <gestionDuree@plt>
lea    0xde9(%rip),%rbp
lea    0x1b(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
call   1070 <sprintf@plt>
mov    $0x5,%edi
call   1050 <gestionDuree@plt>
lea    0x16(%rsp),%r14
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
call   1070 <sprintf@plt>
mov    $0xf0,%edi
mov    $0xff,%esi
mov    $0xff,%edx
call   1060 <couleurCourante@plt>
movss  0xc(%rsp),%xmm1
movaps %xmm1,%xmm0
divss  0xd8a(%rip),%xmm0
movss  %xmm0,0x10(%rsp)
movaps %xmm1,%xmm0
divss  0xd7d(%rip),%xmm0
cvttss2si %xmm0,%ebp
xor    %eax,%eax
call   1030 <hauteurFenetre@plt>
shl    $0x3,%eax
cltq
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x22,%rdx
add    %eax,%edx
mov    %rbx,%rdi
movss  0x10(%rsp),%xmm0
mov    %ebp,%esi
call   1080 <afficheChaine@plt>
xor    %eax,%eax
call   1040 <largeurFenetre@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0xc(%rsp),%xmm1
mulss  0xd31(%rip),%xmm1
divss  0xd25(%rip),%xmm1
addss  %xmm0,%xmm1
cvttss2si %xmm1,%ebx
xor    %eax,%eax
call   1030 <hauteurFenetre@plt>
shl    $0x3,%eax
cltq
imul   $0x66666667,%rax,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x22,%rdx
add    %eax,%edx
mov    %r14,%rdi
movss  0x10(%rsp),%xmm0
mov    %ebx,%esi
call   1080 <afficheChaine@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @afficheTempRestant(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca [5 x i8]
%5 = alloca [5 x i8]
store i32 %0, i32* %2
%6 = call i32 (...) @largeurFenetre()
%7 = call i32 (...) @hauteurFenetre()
%8 = icmp sge i32 %6, %7
%9 = zext i1 %8 to i32
%10 = call i32 (...) @largeurFenetre()
%11 = mul nsw i32 %9, %10
%12 = sdiv i32 %11, 6
%13 = call i32 (...) @hauteurFenetre()
%14 = call i32 (...) @largeurFenetre()
%15 = icmp sgt i32 %13, %14
%16 = zext i1 %15 to i32
%17 = call i32 (...) @hauteurFenetre()
%18 = mul nsw i32 %16, %17
%19 = sdiv i32 %18, 6
%20 = add nsw i32 %12, %19
%21 = sitofp i32 %20 to float
store float %21, float* %3
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
%24 = srem i32 %23, 2
%25 = mul nsw i32 %24, 2
%26 = add nsw i32 %25, 2
%27 = call i32 @gestionDuree(i32 %26)
%28 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%29 = call i32 @gestionDuree(i32 3)
%30 = call i32 @sprintf(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%32 = call i32 @gestionDuree(i32 5)
%33 = call i32 @sprintf(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %32)
%34 = call i32 @couleurCourante(i32 240, i32 255, i32 255)
%35 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%36 = load float, float* %3
%37 = fdiv float %36, 6.000000e+00
%38 = load float, float* %3
%39 = fdiv float %38, 1.000000e+01
%40 = fptosi float %39 to i32
%41 = call i32 (...) @hauteurFenetre()
%42 = mul nsw i32 %41, 8
%43 = sdiv i32 %42, 10
%44 = call i32 @afficheChaine(i8* %35, float %37, i32 %40, i32 %43)
%45 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%46 = load float, float* %3
%47 = fdiv float %46, 6.000000e+00
%48 = call i32 (...) @largeurFenetre()
%49 = sitofp i32 %48 to float
%50 = load float, float* %3
%51 = fmul float 9.000000e+00, %50
%52 = fdiv float %51, 1.000000e+01
%53 = fsub float %49, %52
%54 = fptosi float %53 to i32
%55 = call i32 (...) @hauteurFenetre()
%56 = mul nsw i32 %55, 8
%57 = sdiv i32 %56, 10
%58 = call i32 @afficheChaine(i8* %45, float %47, i32 %54, i32 %57)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @afficheTempRestant(i32 %0) {
%2 = alloca [5 x i8]
%3 = alloca [5 x i8]
%4 = tail call i32 (...) @largeurFenetre()
%5 = tail call i32 (...) @hauteurFenetre()
%6 = icmp slt i32 %4, %5
%7 = tail call i32 (...) @largeurFenetre()
%8 = sdiv i32 %7, 6
%9 = select i1 %6, i32 0, i32 %8
%10 = tail call i32 (...) @hauteurFenetre()
%11 = tail call i32 (...) @largeurFenetre()
%12 = icmp sgt i32 %10, %11
%13 = tail call i32 (...) @hauteurFenetre()
%14 = sdiv i32 %13, 6
%15 = select i1 %12, i32 %14, i32 0
%16 = add nsw i32 %15, %9
%17 = sitofp i32 %16 to float
%18 = add nsw i32 %0, 1
%19 = srem i32 %18, 2
%20 = shl nsw i32 %19, 1
%21 = add nsw i32 %20, 2
%22 = tail call i32 @gestionDuree(i32 %21)
%23 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%24 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%25 = tail call i32 @gestionDuree(i32 3)
%26 = call i32 @sprintf(i8* %23, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = tail call i32 @gestionDuree(i32 5)
%28 = call i32 @sprintf(i8* %24, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = tail call i32 @couleurCourante(i32 240, i32 255, i32 255)
%30 = fdiv float %17, 6.000000e+00
%31 = fdiv float %17, 1.000000e+01
%32 = fptosi float %31 to i32
%33 = tail call i32 (...) @hauteurFenetre()
%34 = shl nsw i32 %33, 3
%35 = sdiv i32 %34, 10
%36 = call i32 @afficheChaine(i8* %23, float %30, i32 %32, i32 %35)
%37 = call i32 (...) @largeurFenetre()
%38 = sitofp i32 %37 to float
%39 = fmul float %17, 9.000000e+00
%40 = fdiv float %39, 1.000000e+01
%41 = fsub float %38, %40
%42 = fptosi float %41 to i32
%43 = call i32 (...) @hauteurFenetre()
%44 = shl nsw i32 %43, 3
%45 = sdiv i32 %44, 10
%46 = call i32 @afficheChaine(i8* %24, float %30, i32 %42, i32 %45)
ret void
}