#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 */
char *crypt(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
void crypt1_test() {
  char str1[] = "helloworld";
  printf("crypt1.0 %s\n", crypt(str1, "ab"));
  printf("crypt1.1 %s\n", crypt(str1, "cd"));
}


x86 assembly (clang, -O0):
<crypt1_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xb(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xb(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <crypt@plt>
mov    %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    -0xb(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <crypt@plt>
mov    %rax,%rsi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt1_test>:
push   %rbx
sub    $0x10,%rsp
movabs $0x726f776f6c6c6568,%rax
77 6f 72
mov    %rax,(%rsp)
movl   $0x646c72,0x7(%rsp)
lea    0xed6(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <crypt@plt>
lea    0xeb7(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <crypt@plt>
lea    0xea9(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.crypt1_test.str1 = [11 x i8] c"helloworld\00"
@.str = [13 x i8] c"crypt1.0 %s\0A\00"
@.str.1 = [3 x i8] c"ab\00"
@.str.2 = [13 x i8] c"crypt1.1 %s\0A\00"
@.str.3 = [3 x i8] c"cd\00"
define void @crypt1_test() {
%1 = alloca [11 x i8]
%2 = bitcast [11 x i8]* %1 to i8*
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%4 = call i8* @crypt(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%7 = call i8* @crypt(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@__const.crypt1_test.str1 = [11 x i8] c"helloworld\00"
@.str = [13 x i8] c"crypt1.0 %s\0A\00"
@.str.1 = [3 x i8] c"ab\00"
@.str.2 = [13 x i8] c"crypt1.1 %s\0A\00"
@.str.3 = [3 x i8] c"cd\00"
define void @crypt1_test() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i8* @crypt(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i8* @crypt(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret void
}