#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  int i;
  for (i = 0; i < 1000; i++) {
    if (i < 800)
      fprintf(stderr, "-");
    else
      fprintf(stderr, "+");
  }
  fprintf(stderr, "sortie\n");
  if (i < 100)
    fprintf(stderr, "jamais exécuté\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1182 <main+0x72>
cmpl   $0x320,-0x8(%rbp)
jge    115a <main+0x4a>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
jmp    116f <main+0x5f>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1174 <main+0x64>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
lea    0xe72(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x64,-0x8(%rbp)
jge    11b6 <main+0xa6>
mov    0x2e38(%rip),%rax
mov    (%rax),%edi
lea    0xe5b(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebp,%ebp
mov    0x2ec0(%rip),%r14
lea    0xed9(%rip),%r15
lea    0xed4(%rip),%rbx
xchg   %ax,%ax
cmp    $0x320,%ebp
mov    (%r14),%edi
mov    %rbx,%rsi
cmovb  %r15,%rsi
call   1030 <fprintf@plt>
add    $0x1,%ebp
cmp    $0x3e8,%ebp
jne    1130 <main+0x20>
mov    (%r14),%edi
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [8 x i8] c"sortie\0A\00"
@.str.3 = [18 x i8] c"jamais ex\C3\A9cut\C3\A9\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %16, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000
br i1 %5, label %6, label %19
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 800
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %15
12: ; preds = %6
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %12, %9
br label %16
16: ; preds = %15
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %3
19: ; preds = %3
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* %2
%23 = icmp slt i32 %22, 100
br i1 %23, label %24, label %27
24: ; preds = %19
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %27
27: ; preds = %24, %19
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [8 x i8] c"sortie\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = icmp ult i32 %2, 800
%4 = load i32, i32* @stderr
%5 = select i1 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @fprintf(i32 %4, i8* %5)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 1000
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}