#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ output_all(char *);
int /*<<< orphan*/ output_last_2(char *);
int /*<<< orphan*/ piece(char *, char, char *, int);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void output_row(char *s) {
  static char old_account_number[128];
  char account_number[128];
  if (!piece(account_number, '|', s, 1)) {
    fprintf(stderr, "format_attribute.e Invalid input format: (%s)\n", s);
    exit(1);
  }
  if (strcmp(account_number, old_account_number) != 0) {
    output_all(s);
    strcpy(old_account_number, account_number);
  } else
    output_last_2(s);
}


x86 assembly (clang, -O0):
<output_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x7c,%esi
mov    $0x1,%ecx
call   1090 <piece@plt>
cmp    $0x0,%eax
jne    11c5 <output_row+0x55>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe4a(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    -0x90(%rbp),%rdi
lea    0x2e9d(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     1203 <output_row+0x93>
mov    -0x8(%rbp),%rdi
call   1040 <output_all@plt>
lea    -0x90(%rbp),%rsi
lea    0x2e77(%rip),%rdi
call   1030 <strcpy@plt>
jmp    120c <output_row+0x9c>
mov    -0x8(%rbp),%rdi
call   1050 <output_last_2@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_row>:
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    $0x7c,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1090 <piece@plt>
test   %eax,%eax
je     11cf <output_row+0x5f>
lea    0x2ed5(%rip),%rsi
mov    %rsp,%rdi
call   1060 <strcmp@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     11c1 <output_row+0x51>
call   1040 <output_all@plt>
lea    0x2eb9(%rip),%rdi
mov    %rsp,%rsi
call   1030 <strcpy@plt>
jmp    11c6 <output_row+0x56>
call   1050 <output_last_2@plt>
add    $0x80,%rsp
pop    %rbx
ret
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
lea    0xe21(%rip),%rsi
mov    %rbx,%rdx
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@output_row.old_account_number = internal global [128 x i8] zeroinitializer
@stderr = global i32 0
@.str = [47 x i8] c"format_attribute.e Invalid input format: (%s)\0A\00"
define void @output_row(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @piece(i8* %4, i8 signext 124, i8* %5, i32 1)
%7 = icmp ne i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @output_row.old_account_number, i64 0, i64 0))
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i8*, i8** %2
%19 = call i32 @output_all(i8* %18)
%20 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%21 = call i32 @strcpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @output_row.old_account_number, i64 0, i64 0), i8* %20)
br label %25
22: ; preds = %13
%23 = load i8*, i8** %2
%24 = call i32 @output_last_2(i8* %23)
br label %25
25: ; preds = %22, %17
ret void
}

LLVM IR (-O2):
@output_row.old_account_number = internal global [128 x i8] zeroinitializer
@stderr = global i32 0
@.str = [47 x i8] c"format_attribute.e Invalid input format: (%s)\0A\00"
define void @output_row(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @piece(i8* %3, i8 signext 124, i8* %0, i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @output_row.old_account_number, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = call i32 @output_all(i8* %0)
%15 = call i32 @strcpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @output_row.old_account_number, i64 0, i64 0), i8* %3)
br label %18
16: ; preds = %10
%17 = call i32 @output_last_2(i8* %0)
br label %18
18: ; preds = %16, %13
ret void
}