#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 const *);
int strcmp(char *, char *);
int main(int argc, char *argv[]) {
  const char salt[] = "$1$saltstring";
  char *cp;
  int result = 0;
  cp = crypt("Hello world!", salt);
  if (cp)
    result |= strcmp("$1$saltstri$YMyguxXMBpd2TEZ.vS/3q1", cp);
  return result;
}


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)
mov    0xec3(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0x12(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    -0x1e(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <crypt@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1191 <main+0x71>
mov    -0x28(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1040 <strcmp@plt>
or     -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x676e6972747374,%rax
mov    %rax,0xe(%rsp)
movabs $0x73746c6173243124,%rax
6c 74 73
mov    %rax,0x8(%rsp)
lea    0xec5(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <crypt@plt>
test   %rax,%rax
je     116c <main+0x4c>
lea    0xebc(%rip),%rdi
mov    %rax,%rsi
call   1040 <strcmp@plt>
add    $0x18,%rsp
ret
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.salt = [14 x i8] c"$1$saltstring\00"
@.str = [13 x i8] c"Hello world!\00"
@.str.1 = [35 x i8] c"$1$saltstri$YMyguxXMBpd2TEZ.vS/3q1\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [14 x i8]
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [14 x i8]* %6 to i8*
store i32 0, i32* %8
%10 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
%11 = call i8* @crypt(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %19
14: ; preds = %2
%15 = load i8*, i8** %7
%16 = call i32 @strcmp(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = load i32, i32* %8
%18 = or i32 %17, %16
store i32 %18, i32* %8
br label %19
19: ; preds = %14, %2
%20 = load i32, i32* %8
ret i32 %20
}

LLVM IR (-O2):
@__const.main.salt = [14 x i8] c"$1$saltstring\00"
@.str = [13 x i8] c"Hello world!\00"
@.str.1 = [35 x i8] c"$1$saltstri$YMyguxXMBpd2TEZ.vS/3q1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [14 x i8]
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%5 = call i8* @crypt(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @strcmp(i8* dereferenceable(35) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %9
9: ; preds = %7, %2
%10 = phi i32 [ %8, %7 ], [ 0, %2 ]
ret i32 %10
}