#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*/ nueva_etiqueta(char *, int, int);
int strlen(char *);
void buscar_etiqueta(char *linea, int num_linea) {
  int i = 0;
  for (; i < strlen(linea); i++)
    if (linea[i] == ':') {
      nueva_etiqueta(linea, i, num_linea);
      break;
    }
}


x86 assembly (clang, -O0):
<buscar_etiqueta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    118e <buscar_etiqueta+0x6e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    117b <buscar_etiqueta+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <nueva_etiqueta@plt>
jmp    118e <buscar_etiqueta+0x6e>
jmp    1180 <buscar_etiqueta+0x60>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <buscar_etiqueta+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buscar_etiqueta>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1159 <buscar_etiqueta+0x39>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x3a,(%rbx,%rbp,1)
je     115e <buscar_etiqueta+0x3e>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     1140 <buscar_etiqueta+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <nueva_etiqueta@plt>

LLVM IR (-O0):
define void @buscar_etiqueta(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %25, %2
%7 = load i32, i32* %5
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %28
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 58
br i1 %18, label %19, label %24
19: ; preds = %11
%20 = load i8*, i8** %3
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = call i32 @nueva_etiqueta(i8* %20, i32 %21, i32 %22)
br label %28
24: ; preds = %11
br label %25
25: ; preds = %24
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %6
28: ; preds = %19, %6
ret void
}

LLVM IR (-O2):
define void @buscar_etiqueta(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %18
5: ; preds = %2, %13
%6 = phi i64 [ %14, %13 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 58
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = trunc i64 %6 to i32
%12 = tail call i32 @nueva_etiqueta(i8* %0, i32 %11, i32 %1)
br label %18
13: ; preds = %5
%14 = add nuw nsw i64 %6, 1
%15 = tail call i32 @strlen(i8* %0)
%16 = sext i32 %15 to i64
%17 = icmp slt i64 %14, %16
br i1 %17, label %5, label %18
18: ; preds = %13, %2, %10
ret void
}