#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 sscanf(char *, char *, char *, char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
void parse(char *line, char *label, char *op, char *param) {
  if (sscanf(line, "%[^:]:%s %s", label, op, param) >= 3) {
  } else if (sscanf(line, "%s %s", op, param) == 2) {
    strcpy(label, "");
  }
}


x86 assembly (clang, -O0):
<parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xeb1(%rip),%rsi
mov    $0x0,%al
call   1040 <sscanf@plt>
cmp    $0x3,%eax
jl     1164 <parse+0x44>
jmp    119c <parse+0x7c>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe8f(%rip),%rsi
mov    $0x0,%al
call   1040 <sscanf@plt>
cmp    $0x2,%eax
jne    1197 <parse+0x77>
mov    -0x10(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1030 <strcpy@plt>
jmp    119c <parse+0x7c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1040 <sscanf@plt>
cmp    $0x2,%eax
jg     1186 <parse+0x66>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   1040 <sscanf@plt>
cmp    $0x2,%eax
jne    1186 <parse+0x66>
lea    0xe98(%rip),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <strcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%[^:]:%s %s\00"
@.str.1 = [6 x i8] c"%s %s\00"
@.str.2 = [1 x i8] zeroinitializer
define void @parse(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 (i8*, i8*, i8*, i8*, ...) @sscanf(i8* %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i8* %12)
%14 = icmp sge i32 %13, 3
br i1 %14, label %15, label %16
15: ; preds = %4
br label %26
16: ; preds = %4
%17 = load i8*, i8** %5
%18 = load i8*, i8** %7
%19 = load i8*, i8** %8
%20 = call i32 (i8*, i8*, i8*, i8*, ...) @sscanf(i8* %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %18, i8* %19)
%21 = icmp eq i32 %20, 2
br i1 %21, label %22, label %25
22: ; preds = %16
%23 = load i8*, i8** %6
%24 = call i32 @strcpy(i8* %23, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %22, %16
br label %26
26: ; preds = %25, %15
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%[^:]:%s %s\00"
@.str.1 = [6 x i8] c"%s %s\00"
@.str.2 = [1 x i8] zeroinitializer
define void @parse(i8* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 (i8*, i8*, i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
%6 = icmp sgt i32 %5, 2
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = tail call i32 (i8*, i8*, i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %3)
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %7, %10, %4
ret void
}