#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*/ noyau_exit();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void tacheD(void) {
  int i = 0;
  long j;
  puts("------> DEBUT tache D");
  while (1) {
    for (j = 0; j < 120000L; j++)
      ;
    printf("======> Dans tache D %d\n", i++);
    if (i == 50)
      noyau_exit();
  }
}


x86 assembly (clang, -O0):
<tacheD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
movq   $0x0,-0x10(%rbp)
cmpq   $0x1d4c0,-0x10(%rbp)
jge    1177 <tacheD+0x47>
jmp    1166 <tacheD+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1153 <tacheD+0x23>
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x32,-0x4(%rbp)
jne    119f <tacheD+0x6f>
mov    $0x0,%al
call   1050 <noyau_exit@plt>
jmp    114b <tacheD+0x1b>

x86 assembly (clang, -O2):
<tacheD>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rbx
xor    %ebp,%ebp
jmp    1153 <tacheD+0x23>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
cmp    $0x31,%ebp
jne    1150 <tacheD+0x20>
xor    %eax,%eax
call   1050 <noyau_exit@plt>
jmp    1150 <tacheD+0x20>

LLVM IR (-O0):
@.str = [22 x i8] c"------> DEBUT tache D\00"
@.str.1 = [25 x i8] c"======> Dans tache D %d\0A\00"
define void @tacheD() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %20
store i64 0, i64* %2
br label %5
5: ; preds = %9, %4
%6 = load i64, i64* %2
%7 = icmp slt i64 %6, 120000
br i1 %7, label %8, label %12
8: ; preds = %5
br label %9
9: ; preds = %8
%10 = load i64, i64* %2
%11 = add nsw i64 %10, 1
store i64 %11, i64* %2
br label %5
12: ; preds = %5
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 50
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i32 (...) @noyau_exit()
br label %20
20: ; preds = %18, %12
br label %4
}

LLVM IR (-O2):
@.str = [22 x i8] c"------> DEBUT tache D\00"
@.str.1 = [25 x i8] c"======> Dans tache D %d\0A\00"
define void @tacheD() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %9, %0
%3 = phi i32 [ 0, %0 ], [ %4, %9 ]
%4 = add nuw nsw i32 %3, 1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%6 = icmp eq i32 %4, 50
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @noyau_exit()
br label %9
9: ; preds = %7, %2
br label %2
}