#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*/ ft_putchar(char);
void ligne_1(int x) {
  int a;
  a = 0;
  while (a != x) {
    if (a != 0 && a != x - 1) {
      ft_putchar('-');
    } else if (a == 0 || a == x - 1) {
      ft_putchar('o');
    }
    a++;
  }
}


x86 assembly (clang, -O0):
<ligne_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1190 <ligne_1+0x80>
cmpl   $0x0,-0x8(%rbp)
je     1158 <ligne_1+0x48>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1158 <ligne_1+0x48>
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
jmp    1182 <ligne_1+0x72>
cmpl   $0x0,-0x8(%rbp)
je     1173 <ligne_1+0x63>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    117d <ligne_1+0x6d>
mov    $0x6f,%edi
call   1030 <ft_putchar@plt>
jmp    1182 <ligne_1+0x72>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <ligne_1+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ligne_1>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     1151 <ligne_1+0x41>
mov    %edi,%r14d
xor    %ebx,%ebx
mov    $0x6f,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%r14,%rbx,1),%eax
cmp    $0x1,%eax
mov    $0x2d,%edi
cmove  %ebp,%edi
sub    $0x1,%ebx
cmovb  %ebp,%edi
call   1030 <ft_putchar@plt>
mov    %r14d,%eax
add    %ebx,%eax
jne    1130 <ligne_1+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @ligne_1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %29, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %32
8: ; preds = %4
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 1
%15 = icmp ne i32 %12, %14
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 @ft_putchar(i8 signext 45)
br label %29
18: ; preds = %11, %8
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 0
br i1 %20, label %26, label %21
21: ; preds = %18
%22 = load i32, i32* %3
%23 = load i32, i32* %2
%24 = sub nsw i32 %23, 1
%25 = icmp eq i32 %22, %24
br i1 %25, label %26, label %28
26: ; preds = %21, %18
%27 = call i32 @ft_putchar(i8 signext 111)
br label %28
28: ; preds = %26, %21
br label %29
29: ; preds = %28, %16
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %4
32: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @ligne_1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ 0, %3 ], [ %12, %5 ]
%7 = icmp eq i32 %6, 0
%8 = icmp eq i32 %6, %4
%9 = select i1 %7, i1 true, i1 %8
%10 = select i1 %9, i8 111, i8 45
%11 = tail call i32 @ft_putchar(i8 signext %10)
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, %0
br i1 %13, label %14, label %5
14: ; preds = %5, %1
ret void
}