#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 ceil(int);
int /*<<< orphan*/ printf(char *);
void calculBarre(int nbLettre, double sommeEtudiants) {
  int incrementation;
  incrementation = ceil(nbLettre / ceil(sommeEtudiants / 50));
  int i;
  for (i = 0; i < incrementation; i++) {
    printf("X");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<calculBarre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <ceil@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    118f <calculBarre+0x6f>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1169 <calculBarre+0x49>
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculBarre>:
push   %rbx
mov    %edi,%ebx
divsd  0xed5(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <ceil@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <ceil@plt>
test   %eax,%eax
jle    115f <calculBarre+0x3f>
mov    %eax,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x58,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1150 <calculBarre+0x30>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"X\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @calculBarre(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store double %1, double* %4
%7 = load i32, i32* %3
%8 = load double, double* %4
%9 = fdiv double %8, 5.000000e+01
%10 = fptosi double %9 to i32
%11 = call i32 @ceil(i32 %10)
%12 = sdiv i32 %7, %11
%13 = call i32 @ceil(i32 %12)
store i32 %13, i32* %5
store i32 0, i32* %6
br label %14
14: ; preds = %20, %2
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %14
23: ; preds = %14
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @calculBarre(i32 %0, double %1) {
%3 = fdiv double %1, 5.000000e+01
%4 = fptosi double %3 to i32
%5 = tail call i32 @ceil(i32 %4)
%6 = sdiv i32 %0, %5
%7 = tail call i32 @ceil(i32 %6)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2, %9
%10 = phi i32 [ %12, %9 ], [ 0, %2 ]
%11 = tail call i32 @putchar(i32 88)
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, %7
br i1 %13, label %14, label %9
14: ; preds = %9, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}