#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 */
struct colprintLine {
  int dummy;
};

/* Variables and functions */
char *colprintLineGetColumn(struct colprintLine *, int);
int strcmp(char const *, char const *);
int flagsColprintCompareLines(struct colprintLine *a, struct colprintLine *b) {
  const char *a_letter = colprintLineGetColumn(a, 0);
  const char *b_letter = colprintLineGetColumn(b, 0);
  if (a_letter[0] != '-' && b_letter[0] == '-')
    return -1;
  else if (a_letter[0] == '-' && b_letter[0] != '-')
    return 1;
  else if (a_letter[0] != '-' && b_letter[0] != '-')
    return strcmp(a_letter, b_letter);
  const char *a_name = colprintLineGetColumn(a, 1);
  const char *b_name = colprintLineGetColumn(b, 1);
  if (a_name[0] != '_' && b_name[0] == '_')
    return -1;
  else if (a_name[0] == '_' && b_name[0] != '_')
    return 1;
  return strcmp(a_name, b_name);
}


x86 assembly (clang, -O0):
<flagsColprintCompareLines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1040 <colprintLineGetColumn@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1040 <colprintLineGetColumn@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     117a <flagsColprintCompareLines+0x5a>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    117a <flagsColprintCompareLines+0x5a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1276 <flagsColprintCompareLines+0x156>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11a6 <flagsColprintCompareLines+0x86>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     11a6 <flagsColprintCompareLines+0x86>
movl   $0x1,-0x4(%rbp)
jmp    1276 <flagsColprintCompareLines+0x156>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     11db <flagsColprintCompareLines+0xbb>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     11db <flagsColprintCompareLines+0xbb>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
jmp    1276 <flagsColprintCompareLines+0x156>
jmp    11e0 <flagsColprintCompareLines+0xc0>
jmp    11e5 <flagsColprintCompareLines+0xc5>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <colprintLineGetColumn@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1040 <colprintLineGetColumn@plt>
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
je     1235 <flagsColprintCompareLines+0x115>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
jne    1235 <flagsColprintCompareLines+0x115>
movl   $0xffffffff,-0x4(%rbp)
jmp    1276 <flagsColprintCompareLines+0x156>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
jne    1261 <flagsColprintCompareLines+0x141>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
je     1261 <flagsColprintCompareLines+0x141>
movl   $0x1,-0x4(%rbp)
jmp    1276 <flagsColprintCompareLines+0x156>
jmp    1266 <flagsColprintCompareLines+0x146>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flagsColprintCompareLines>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%rbp
xor    %esi,%esi
call   1040 <colprintLineGetColumn@plt>
mov    %rax,%rbx
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <colprintLineGetColumn@plt>
cmpb   $0x2d,(%rbx)
mov    (%rax),%cl
jne    1185 <flagsColprintCompareLines+0x65>
mov    $0x1,%r14d
cmp    $0x2d,%cl
jne    11a0 <flagsColprintCompareLines+0x80>
mov    $0x1,%r14d
mov    %rbp,%rdi
mov    $0x1,%esi
call   1040 <colprintLineGetColumn@plt>
mov    %rax,%rbp
mov    %r15,%rdi
mov    $0x1,%esi
call   1040 <colprintLineGetColumn@plt>
cmpb   $0x5f,0x0(%rbp)
mov    (%rax),%cl
jne    1195 <flagsColprintCompareLines+0x75>
cmp    $0x5f,%cl
jne    11a0 <flagsColprintCompareLines+0x80>
jmp    11ae <flagsColprintCompareLines+0x8e>
mov    $0xffffffff,%r14d
cmp    $0x2d,%cl
je     11a0 <flagsColprintCompareLines+0x80>
mov    %rbx,%rdi
jmp    11b1 <flagsColprintCompareLines+0x91>
mov    $0xffffffff,%r14d
cmp    $0x5f,%cl
jne    11ae <flagsColprintCompareLines+0x8e>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbp,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
%struct.colprintLine = type { i32 }
define i32 @flagsColprintCompareLines(%struct.colprintLine* %0, %struct.colprintLine* %1) {
%3 = alloca i32
%4 = alloca %struct.colprintLine*
%5 = alloca %struct.colprintLine*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store %struct.colprintLine* %0, %struct.colprintLine** %4
store %struct.colprintLine* %1, %struct.colprintLine** %5
%10 = load %struct.colprintLine*, %struct.colprintLine** %4
%11 = call i8* @colprintLineGetColumn(%struct.colprintLine* %10, i32 0)
store i8* %11, i8** %6
%12 = load %struct.colprintLine*, %struct.colprintLine** %5
%13 = call i8* @colprintLineGetColumn(%struct.colprintLine* %12, i32 0)
store i8* %13, i8** %7
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 45
br i1 %18, label %19, label %26
19: ; preds = %2
%20 = load i8*, i8** %7
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 45
br i1 %24, label %25, label %26
25: ; preds = %19
store i32 -1, i32* %3
br label %92
26: ; preds = %19, %2
%27 = load i8*, i8** %6
%28 = getelementptr inbounds i8, i8* %27, i64 0
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 45
br i1 %31, label %32, label %39
32: ; preds = %26
%33 = load i8*, i8** %7
%34 = getelementptr inbounds i8, i8* %33, i64 0
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 45
br i1 %37, label %38, label %39
38: ; preds = %32
store i32 1, i32* %3
br label %92
39: ; preds = %32, %26
%40 = load i8*, i8** %6
%41 = getelementptr inbounds i8, i8* %40, i64 0
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %43, 45
br i1 %44, label %45, label %55
45: ; preds = %39
%46 = load i8*, i8** %7
%47 = getelementptr inbounds i8, i8* %46, i64 0
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp ne i32 %49, 45
br i1 %50, label %51, label %55
51: ; preds = %45
%52 = load i8*, i8** %6
%53 = load i8*, i8** %7
%54 = call i32 @strcmp(i8* %52, i8* %53)
store i32 %54, i32* %3
br label %92
55: ; preds = %45, %39
br label %56
56: ; preds = %55
br label %57
57: ; preds = %56
%58 = load %struct.colprintLine*, %struct.colprintLine** %4
%59 = call i8* @colprintLineGetColumn(%struct.colprintLine* %58, i32 1)
store i8* %59, i8** %8
%60 = load %struct.colprintLine*, %struct.colprintLine** %5
%61 = call i8* @colprintLineGetColumn(%struct.colprintLine* %60, i32 1)
store i8* %61, i8** %9
%62 = load i8*, i8** %8
%63 = getelementptr inbounds i8, i8* %62, i64 0
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp ne i32 %65, 95
br i1 %66, label %67, label %74
67: ; preds = %57
%68 = load i8*, i8** %9
%69 = getelementptr inbounds i8, i8* %68, i64 0
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 95
br i1 %72, label %73, label %74
73: ; preds = %67
store i32 -1, i32* %3
br label %92
74: ; preds = %67, %57
%75 = load i8*, i8** %8
%76 = getelementptr inbounds i8, i8* %75, i64 0
%77 = load i8, i8* %76
%78 = sext i8 %77 to i32
%79 = icmp eq i32 %78, 95
br i1 %79, label %80, label %87
80: ; preds = %74
%81 = load i8*, i8** %9
%82 = getelementptr inbounds i8, i8* %81, i64 0
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = icmp ne i32 %84, 95
br i1 %85, label %86, label %87
86: ; preds = %80
store i32 1, i32* %3
br label %92
87: ; preds = %80, %74
br label %88
88: ; preds = %87
%89 = load i8*, i8** %8
%90 = load i8*, i8** %9
%91 = call i32 @strcmp(i8* %89, i8* %90)
store i32 %91, i32* %3
br label %92
92: ; preds = %88, %86, %73, %51, %38, %25
%93 = load i32, i32* %3
ret i32 %93
}

LLVM IR (-O2):
%struct.colprintLine = type { i32 }
define i32 @flagsColprintCompareLines(%struct.colprintLine* %0, %struct.colprintLine* %1) {
%3 = tail call i8* @colprintLineGetColumn(%struct.colprintLine* %0, i32 0)
%4 = tail call i8* @colprintLineGetColumn(%struct.colprintLine* %1, i32 0)
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 45
%7 = load i8, i8* %4
%8 = icmp eq i8 %7, 45
br i1 %6, label %10, label %9
9: ; preds = %2
br i1 %8, label %24, label %11
10: ; preds = %2
br i1 %8, label %13, label %24
11: ; preds = %9
%12 = tail call i32 @strcmp(i8* %3, i8* %4)
br label %24
13: ; preds = %10
%14 = tail call i8* @colprintLineGetColumn(%struct.colprintLine* %0, i32 1)
%15 = tail call i8* @colprintLineGetColumn(%struct.colprintLine* %1, i32 1)
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 95
%18 = load i8, i8* %15
%19 = icmp eq i8 %18, 95
br i1 %17, label %21, label %20
20: ; preds = %13
br i1 %19, label %24, label %22
21: ; preds = %13
br i1 %19, label %22, label %24
22: ; preds = %20, %21
%23 = tail call i32 @strcmp(i8* %14, i8* dereferenceable(1) %15)
br label %24
24: ; preds = %22, %20, %21, %10, %9, %11
%25 = phi i32 [ %12, %11 ], [ -1, %9 ], [ 1, %10 ], [ %23, %22 ], [ -1, %20 ], [ 1, %21 ]
ret i32 %25
}