#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*/ link_error();
scalar_t__ memcmp(char *, char *, int);
int main(int argc) {
  if (memcmp("abcd", "efgh", 4) >= 0)
    link_error();
  if (memcmp("abcd", "abcd", 4) != 0)
    link_error();
  if (memcmp("efgh", "abcd", 4) <= 0)
    link_error();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
lea    0xec7(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jl     115b <main+0x3b>
mov    $0x0,%al
call   1040 <link_error@plt>
lea    0xe9e(%rip),%rsi
mov    $0x4,%edx
mov    %rsi,%rdi
call   1030 <memcmp@plt>
cmp    $0x0,%rax
je     1180 <main+0x60>
mov    $0x0,%al
call   1040 <link_error@plt>
lea    0xe7e(%rip),%rdi
lea    0xe72(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jg     11a9 <main+0x89>
mov    $0x0,%al
call   1040 <link_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
js     1145 <main+0x25>
xor    %eax,%eax
call   1040 <link_error@plt>
lea    0xeb4(%rip),%rdi
mov    %rdi,%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
je     1165 <main+0x45>
xor    %eax,%eax
call   1040 <link_error@plt>
lea    0xe99(%rip),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
jg     1189 <main+0x69>
xor    %eax,%eax
call   1040 <link_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"abcd\00"
@.str.1 = [5 x i8] c"efgh\00"
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
%4 = call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%5 = icmp sge i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @link_error()
br label %8
8: ; preds = %6, %1
%9 = call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @link_error()
br label %13
13: ; preds = %11, %8
%14 = call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%15 = icmp sle i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (...) @link_error()
br label %18
18: ; preds = %16, %13
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"abcd\00"
@.str.1 = [5 x i8] c"efgh\00"
define i32 @main(i32 %0) {
%2 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = icmp sgt i64 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @link_error()
br label %6
6: ; preds = %4, %1
%7 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 (...) @link_error()
br label %11
11: ; preds = %9, %6
%12 = tail call i64 @memcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%13 = icmp slt i64 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 (...) @link_error()
br label %16
16: ; preds = %14, %11
ret i32 0
}