#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*/ printf(char *, int);
scalar_t__ strcmp(char const *, char const *);
int main(int argc, const char *argv[]) {
  int cmp;
  if (argc != 3)
    return 128;
  cmp = (((strcmp(argv[1], argv[2])) > 0) - ((strcmp(argv[1], argv[2])) < 0));
  printf("%d\n", cmp);
  return !!cmp;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0x80,-0x4(%rbp)
jmp    11bf <main+0x9f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%eax
cmp    $0x0,%rcx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x80,%ebp
cmp    $0x3,%edi
jne    1171 <main+0x51>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <strcmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
setg   %r14b
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
call   1040 <strcmp@plt>
sar    $0x3f,%rax
lea    0xea0(%rip),%rdi
xor    %ebp,%ebp
add    %eax,%r14d
setne  %bpl
mov    %r14d,%esi
call   1030 <printf@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 3
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 128, i32* %3
br label %37
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i64 @strcmp(i8* %13, i8* %16)
%18 = icmp sgt i64 %17, 0
%19 = zext i1 %18 to i32
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call i64 @strcmp(i8* %22, i8* %25)
%27 = icmp slt i64 %26, 0
%28 = zext i1 %27 to i32
%29 = sub nsw i32 %19, %28
store i32 %29, i32* %6
%30 = load i32, i32* %6
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %6
%33 = icmp ne i32 %32, 0
%34 = xor i1 %33, true
%35 = xor i1 %34, true
%36 = zext i1 %35 to i32
store i32 %36, i32* %3
br label %37
37: ; preds = %10, %9
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %6, i8* %8)
%10 = icmp sgt i64 %9, 0
%11 = zext i1 %10 to i32
%12 = load i8*, i8** %5
%13 = load i8*, i8** %7
%14 = tail call i64 @strcmp(i8* %12, i8* %13)
%15 = ashr i64 %14, 63
%16 = trunc i64 %15 to i32
%17 = add nsw i32 %16, %11
%18 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = icmp ne i32 %17, 0
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %2, %4
%22 = phi i32 [ %20, %4 ], [ 128, %2 ]
ret i32 %22
}