#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*/ ext_strcmp(char const *, char const *);
int main(int argc, char *argv[]) {
  const char *pa = "abc";
  const char *pb = "abcdef";
  const char *pc = "abcdef";
  const char *pd = "abcdefghijklmn";
  ext_strcmp(pa, pb);
  ext_strcmp(pa, pd);
  ext_strcmp(pb, pa);
  ext_strcmp(pc, pb);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xecc(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xec1(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xebd(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <ext_strcmp@plt>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <ext_strcmp@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ext_strcmp@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <ext_strcmp@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
lea    0xee2(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <ext_strcmp@plt>
lea    0xed7(%rip),%rsi
mov    %r14,%rdi
call   1030 <ext_strcmp@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <ext_strcmp@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <ext_strcmp@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [7 x i8] c"abcdef\00"
@.str.2 = [15 x i8] c"abcdefghijklmn\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8** %9
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = call i32 @ext_strcmp(i8* %10, i8* %11)
%13 = load i8*, i8** %6
%14 = load i8*, i8** %9
%15 = call i32 @ext_strcmp(i8* %13, i8* %14)
%16 = load i8*, i8** %7
%17 = load i8*, i8** %6
%18 = call i32 @ext_strcmp(i8* %16, i8* %17)
%19 = load i8*, i8** %8
%20 = load i8*, i8** %7
%21 = call i32 @ext_strcmp(i8* %19, i8* %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [7 x i8] c"abcdef\00"
@.str.2 = [15 x i8] c"abcdefghijklmn\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @ext_strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @ext_strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @ext_strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @ext_strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}