#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*/ strcpy(char *, char *);
int strlen(char *);
void filtrar_etiqueta(char *linea, char *inst_o_dato) {
  int i = 0;
  for (; i < strlen(linea); i++)
    if (linea[i] == ':')
      break;
  if (i == strlen(linea))
    strcpy(inst_o_dato, linea);
  else
    strcpy(inst_o_dato, &linea[i + 1]);
}


x86 assembly (clang, -O0):
<filtrar_etiqueta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1180 <filtrar_etiqueta+0x60>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    116d <filtrar_etiqueta+0x4d>
jmp    1180 <filtrar_etiqueta+0x60>
jmp    1172 <filtrar_etiqueta+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <filtrar_etiqueta+0x17>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jne    11ae <filtrar_etiqueta+0x8e>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    11c6 <filtrar_etiqueta+0xa6>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
add    %rax,%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filtrar_etiqueta>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
xor    %ebx,%ebx
test   %eax,%eax
jle    115a <filtrar_etiqueta+0x3a>
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x3a,(%r15,%rbx,1)
je     115a <filtrar_etiqueta+0x3a>
add    $0x1,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <filtrar_etiqueta+0x20>
mov    %r15,%rdi
call   1040 <strlen@plt>
cmp    %eax,%ebx
jne    116e <filtrar_etiqueta+0x4e>
mov    %r14,%rdi
mov    %r15,%rsi
jmp    117b <filtrar_etiqueta+0x5b>
mov    %ebx,%eax
lea    (%rax,%r15,1),%rsi
add    $0x1,%rsi
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @filtrar_etiqueta(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %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 %24
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 %20
19: ; preds = %11
br label %24
20: ; preds = %11
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %19, %6
%25 = load i32, i32* %5
%26 = load i8*, i8** %3
%27 = call i32 @strlen(i8* %26)
%28 = icmp eq i32 %25, %27
br i1 %28, label %29, label %33
29: ; preds = %24
%30 = load i8*, i8** %4
%31 = load i8*, i8** %3
%32 = call i32 @strcpy(i8* %30, i8* %31)
br label %41
33: ; preds = %24
%34 = load i8*, i8** %4
%35 = load i8*, i8** %3
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %35, i64 %38
%40 = call i32 @strcpy(i8* %34, i8* %39)
br label %41
41: ; preds = %33, %29
ret void
}

LLVM IR (-O2):
define void @filtrar_etiqueta(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %18
5: ; preds = %2, %10
%6 = phi i64 [ %11, %10 ], [ 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 %15, label %10
10: ; preds = %5
%11 = add nuw nsw i64 %6, 1
%12 = tail call i32 @strlen(i8* %0)
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %5, label %15
15: ; preds = %5, %10
%16 = phi i64 [ %11, %10 ], [ %6, %5 ]
%17 = trunc i64 %16 to i32
br label %18
18: ; preds = %15, %2
%19 = phi i32 [ 0, %2 ], [ %17, %15 ]
%20 = tail call i32 @strlen(i8* %0)
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = tail call i32 @strcpy(i8* %1, i8* %0)
br label %29
24: ; preds = %18
%25 = add nuw nsw i32 %19, 1
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %0, i64 %26
%28 = tail call i32 @strcpy(i8* %1, i8* %27)
br label %29
29: ; preds = %24, %22
ret void
}