#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 count_min_in_max(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int strstr(char *, char *);
int main(void) {
  char max[30] = "abc def abc def";
  char min[30] = "def";
  printf("%p\n", strstr(max, min));
  printf("%d\n", count_min_in_max(max, min));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xeac(%rip),%ax
mov    %ax,-0x14(%rbp)
mov    0xea5(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xea2(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe9f(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe9d(%rip),%eax
mov    %eax,-0x38(%rbp)
mov    0xe97(%rip),%ax
mov    %ax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <strstr@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <count_min_in_max@plt>
mov    %eax,%esi
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
movups 0xed0(%rip),%xmm0
movups %xmm0,0x2e(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xed8(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strstr@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <count_min_in_max@plt>
lea    0xea9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.max = [30 x i8] c"abc def abc def\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.min = [30 x i8] c"def\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
%3 = alloca [30 x i8]
store i32 0, i32* %1
%4 = bitcast [30 x i8]* %2 to i8*
%5 = bitcast [30 x i8]* %3 to i8*
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%8 = call i32 @strstr(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%12 = call i32 @count_min_in_max(i8* %10, i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.max = [30 x i8] c"abc def abc def\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.min = [30 x i8] c"def\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = alloca [30 x i8]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%5 = call i32 @strstr(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @count_min_in_max(i8* %3, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}