#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 */
char *malloc(int);
int sscanf(char *, char *, int *, int *, int *, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void extractXMFAinfo(char *line, int *si, int *ss, int *se, char *sd,
                     char **sc) {
  int numread;
  *sc = malloc(sizeof(char) * 1024);
  numread = sscanf(line, ">%d:%d-%d %c %s", si, ss, se, sd, *sc);
  if (numread < 4) {
    *si = *ss = *se = -1;
    *sd = '~';
    strcpy(*sc, "");
  } else if (numread < 5) {
    strcpy(*sc, "");
  }
}


x86 assembly (clang, -O0):
<extractXMFAinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
lea    0xe7a(%rip),%rsi
mov    %rax,(%rsp)
call   1050 <sscanf@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x4,-0x34(%rbp)
jge    11d9 <extractXMFAinfo+0xa9>
mov    -0x20(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x28(%rbp),%rax
movb   $0x7e,(%rax)
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
lea    0xe40(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11fb <extractXMFAinfo+0xcb>
cmpl   $0x5,-0x34(%rbp)
jge    11f6 <extractXMFAinfo+0xc6>
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
lea    0xe1e(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11fb <extractXMFAinfo+0xcb>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractXMFAinfo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r13
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,(%r14)
mov    %rax,(%rsp)
lea    0xe9b(%rip),%rsi
mov    %rbp,%rdi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %r15,%r9
call   1050 <sscanf@plt>
cmp    $0x3,%eax
jg     119a <extractXMFAinfo+0x6a>
movl   $0xffffffff,0x0(%r13)
ff
movl   $0xffffffff,(%r12)
ff
movl   $0xffffffff,(%rbx)
movb   $0x7e,(%r15)
jmp    119f <extractXMFAinfo+0x6f>
cmp    $0x4,%eax
jne    11bc <extractXMFAinfo+0x8c>
mov    (%r14),%rdi
lea    0xe66(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <strcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c">%d:%d-%d %c %s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @extractXMFAinfo(i8* %0, i32* %1, i32* %2, i32* %3, i8* %4, i8** %5) {
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i8**
%13 = alloca i32
store i8* %0, i8** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i8* %4, i8** %11
store i8** %5, i8*** %12
%14 = call i8* @malloc(i32 1024)
%15 = load i8**, i8*** %12
store i8* %14, i8** %15
%16 = load i8*, i8** %7
%17 = load i32*, i32** %8
%18 = load i32*, i32** %9
%19 = load i32*, i32** %10
%20 = load i8*, i8** %11
%21 = load i8**, i8*** %12
%22 = load i8*, i8** %21
%23 = call i32 @sscanf(i8* %16, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %17, i32* %18, i32* %19, i8* %20, i8* %22)
store i32 %23, i32* %13
%24 = load i32, i32* %13
%25 = icmp slt i32 %24, 4
br i1 %25, label %26, label %34
26: ; preds = %6
%27 = load i32*, i32** %10
store i32 -1, i32* %27
%28 = load i32*, i32** %9
store i32 -1, i32* %28
%29 = load i32*, i32** %8
store i32 -1, i32* %29
%30 = load i8*, i8** %11
store i8 126, i8* %30
%31 = load i8**, i8*** %12
%32 = load i8*, i8** %31
%33 = call i32 @strcpy(i8* %32, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %42
34: ; preds = %6
%35 = load i32, i32* %13
%36 = icmp slt i32 %35, 5
br i1 %36, label %37, label %41
37: ; preds = %34
%38 = load i8**, i8*** %12
%39 = load i8*, i8** %38
%40 = call i32 @strcpy(i8* %39, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %41
41: ; preds = %37, %34
br label %42
42: ; preds = %41, %26
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c">%d:%d-%d %c %s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @extractXMFAinfo(i8* nocapture %0, i32* %1, i32* %2, i32* %3, i8* %4, i8** nocapture %5) {
%7 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
store i8* %7, i8** %5
%8 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i8* %4, i8* %7)
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %11
10: ; preds = %6
store i32 -1, i32* %3
store i32 -1, i32* %2
store i32 -1, i32* %1
store i8 126, i8* %4
br label %13
11: ; preds = %6
%12 = icmp eq i32 %8, 4
br i1 %12, label %13, label %16
13: ; preds = %11, %10
%14 = load i8*, i8** %5
%15 = tail call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %13, %11
ret void
}