#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 strcmp(char *, char *);
int main(void) {
  printf("If two strings are idential, strcmp() will return 0.\n");
  printf("For example, when you do a strcmp(\"dog\", \"dog\"), the output will "
         "be: %d\n",
         strcmp("dog", "dog"));
  printf("\nIf the string in the first parameter is less than the string in "
         "second parameter,");
  printf(" strcmp() will return a value less than 0.\n");
  printf("For example, when you do a strcmp(\"cat\", \"dog\"), the output will "
         "be: %d\n",
         strcmp("cat", "dog"));
  printf("\nIf the string in the first parameter is greater than the string in "
         "second parameter,");
  printf(" strcmp() will return a value greater than 0.\n");
  printf("For example, when you do a strcmp(\"dog\", \"cat\"), the output will "
         "be: %d\n",
         strcmp("dog", "cat"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf3b(%rip),%rsi
mov    %rsi,%rdi
call   1040 <strcmp@plt>
mov    %eax,%esi
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfcc(%rip),%rdi
lea    0xef9(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%esi
lea    0xf6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xff5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0xf86(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%esi
lea    0x1001(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x105c(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf05(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1067(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3e(%rip),%rdi
mov    $0xffffffff,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf74(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1065(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb0(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"If two strings are idential, strcmp() will return 0.\0A\00"
@.str.1 = [73 x i8] c"For example, when you do a strcmp(\22dog\22, \22dog\22), the output will be: %d\0A\00"
@.str.2 = [4 x i8] c"dog\00"
@.str.3 = [83 x i8] c"\0AIf the string in the first parameter is less than the string in second parameter,\00"
@.str.4 = [44 x i8] c" strcmp() will return a value less than 0.\0A\00"
@.str.5 = [73 x i8] c"For example, when you do a strcmp(\22cat\22, \22dog\22), the output will be: %d\0A\00"
@.str.6 = [4 x i8] c"cat\00"
@.str.7 = [86 x i8] c"\0AIf the string in the first parameter is greater than the string in second parameter,\00"
@.str.8 = [47 x i8] c" strcmp() will return a value greater than 0.\0A\00"
@.str.9 = [73 x i8] c"For example, when you do a strcmp(\22dog\22, \22cat\22), the output will be: %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.5, i64 0, i64 0), i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.9, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [73 x i8] c"For example, when you do a strcmp(\22dog\22, \22dog\22), the output will be: %d\0A\00"
@.str.3 = [83 x i8] c"\0AIf the string in the first parameter is less than the string in second parameter,\00"
@.str.5 = [73 x i8] c"For example, when you do a strcmp(\22cat\22, \22dog\22), the output will be: %d\0A\00"
@.str.7 = [86 x i8] c"\0AIf the string in the first parameter is greater than the string in second parameter,\00"
@.str.9 = [73 x i8] c"For example, when you do a strcmp(\22dog\22, \22cat\22), the output will be: %d\0A\00"
@str = [53 x i8] c"If two strings are idential, strcmp() will return 0.\00"
@str.10 = [43 x i8] c" strcmp() will return a value less than 0.\00"
@str.11 = [46 x i8] c" strcmp() will return a value greater than 0.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.10, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.5, i64 0, i64 0), i32 -1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @.str.7, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.11, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.9, i64 0, i64 0), i32 1)
ret i32 0
}