#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 mystrcmp2(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
int main() {
  char a[] = "Hello, world";
  char b[] = "Hello, seikai";
  int t = mystrcmp2(a, b);
  printf("\"%s\" %s \"%s\"\n", a, t == 0 ? "=" : t < 0 ? "<" : ">", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xeb2(%rip),%ax
mov    %ax,-0x13(%rbp)
lea    -0x11(%rbp),%rdi
lea    -0x1f(%rbp),%rsi
call   1040 <mystrcmp2@plt>
mov    %eax,-0x24(%rbp)
lea    -0x11(%rbp),%rax
mov    %rax,-0x30(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    119d <main+0x7d>
lea    0xe95(%rip),%rax
mov    %rax,-0x38(%rbp)
jmp    11b9 <main+0x99>
mov    -0x24(%rbp),%edx
lea    0xe86(%rip),%rax
lea    0xe7d(%rip),%rcx
cmp    $0x0,%edx
cmovl  %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
lea    -0x1f(%rbp),%rcx
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movabs $0x646c726f77202c,%rax
mov    %rax,0xd(%rsp)
movabs $0x77202c6f6c6c6548,%rax
2c 20 77
mov    %rax,0x8(%rsp)
movabs $0x69616b69657320,%rax
mov    %rax,0x1e(%rsp)
movabs $0x73202c6f6c6c6548,%rax
2c 20 73
mov    %rax,0x18(%rsp)
lea    0x8(%rsp),%rbx
lea    0x18(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <mystrcmp2@plt>
test   %eax,%eax
lea    0xeaa(%rip),%rax
lea    0xea5(%rip),%rcx
cmovs  %rax,%rcx
lea    0xe96(%rip),%rdx
cmovne %rcx,%rdx
lea    0xe7d(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rcx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a = [13 x i8] c"Hello, world\00"
@__const.main.b = [14 x i8] c"Hello, seikai\00"
@.str = [14 x i8] c"\22%s\22 %s \22%s\22\0A\00"
@.str.1 = [2 x i8] c"=\00"
@.str.2 = [2 x i8] c"<\00"
@.str.3 = [2 x i8] c">\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
%3 = alloca [14 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [13 x i8]* %2 to i8*
%6 = bitcast [14 x i8]* %3 to i8*
%7 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%9 = call i32 @mystrcmp2(i8* %7, i8* %8)
store i32 %9, i32* %4
%10 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %0
br label %19
14: ; preds = %0
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
br label %19
19: ; preds = %14, %13
%20 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %13 ], [ %18, %14 ]
%21 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%22 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %20, i8* %21)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [13 x i8] c"Hello, world\00"
@__const.main.b = [14 x i8] c"Hello, seikai\00"
@.str = [14 x i8] c"\22%s\22 %s \22%s\22\0A\00"
@.str.1 = [2 x i8] c"=\00"
@.str.2 = [2 x i8] c"<\00"
@.str.3 = [2 x i8] c">\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = alloca [14 x i8]
%3 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%5 = call i32 @mystrcmp2(i8* %3, i8* %4)
%6 = icmp eq i32 %5, 0
%7 = icmp slt i32 %5, 0
%8 = select i1 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%9 = select i1 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %9, i8* %4)
ret i32 0
}