#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_strcmp(char *, char *);
int get_label(char *line) {
  char *lbl[] = {"##start", "##end"};
  int i;
  i = 0;
  while (i < 2) {
    if (!ft_strcmp(lbl[i], line))
      return (i);
    i++;
  }
  return (-1);
}


x86 assembly (clang, -O0):
<get_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ced(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cea(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    1177 <get_label+0x67>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,8),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ft_strcmp@plt>
cmp    $0x0,%eax
jne    1169 <get_label+0x59>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117e <get_label+0x6e>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1139 <get_label+0x29>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_label>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <ft_strcmp@plt>
test   %eax,%eax
je     113f <get_label+0x2f>
lea    0xeda(%rip),%rdi
mov    %rbx,%rsi
call   1030 <ft_strcmp@plt>
neg    %eax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"##start\00"
@.str.1 = [6 x i8] c"##end\00"
@__const.get_label.lbl = [2 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0)]
define i32 @get_label(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [2 x i8*]
%5 = alloca i32
store i8* %0, i8** %3
%6 = bitcast [2 x i8*]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %20, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 %12
%14 = load i8*, i8** %13
%15 = load i8*, i8** %3
%16 = call i32 @ft_strcmp(i8* %14, i8* %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %10
%19 = load i32, i32* %5
store i32 %19, i32* %2
br label %24
20: ; preds = %10
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %7
23: ; preds = %7
store i32 -1, i32* %2
br label %24
24: ; preds = %23, %18
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@.str = [8 x i8] c"##start\00"
@.str.1 = [6 x i8] c"##end\00"
define i32 @get_label(i8* %0) {
%2 = tail call i32 @ft_strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @ft_strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 1, i32 -1
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}