#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*/ sink(void *);
int /*<<< orphan*/ strcpy(void *, char *);
void *usr_alloc2(int, int);
void usr_alloc2_ir_ir_strcpy(int m, int n) {
  void *p = usr_alloc2(3 < n ? 3 : n, 5 < n ? 5 : n);
  strcpy(p, "0123456789abcde");
  sink(p);
  strcpy(p, "0123456789abcd");
  sink(p);
}


x86 assembly (clang, -O0):
<usr_alloc2_ir_ir_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x3,%eax
cmp    -0x8(%rbp),%eax
jge    1159 <usr_alloc2_ir_ir_strcpy+0x29>
mov    $0x3,%eax
mov    %eax,-0x14(%rbp)
jmp    115f <usr_alloc2_ir_ir_strcpy+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x5,%eax
cmp    -0x8(%rbp),%eax
jge    1180 <usr_alloc2_ir_ir_strcpy+0x50>
mov    $0x5,%eax
mov    %eax,-0x1c(%rbp)
jmp    1186 <usr_alloc2_ir_ir_strcpy+0x56>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1040 <usr_alloc2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe60(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1050 <sink@plt>
mov    -0x10(%rbp),%rdi
lea    0xe57(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1050 <sink@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usr_alloc2_ir_ir_strcpy>:
push   %rbx
cmp    $0x3,%esi
mov    $0x3,%edi
cmovl  %esi,%edi
cmp    $0x5,%esi
mov    $0x5,%eax
cmovge %eax,%esi
call   1040 <usr_alloc2@plt>
mov    %rax,%rbx
lea    0xeaa(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <sink@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <sink@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"0123456789abcde\00"
@.str.1 = [15 x i8] c"0123456789abcd\00"
define void @usr_alloc2_ir_ir_strcpy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp slt i32 3, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %11
9: ; preds = %2
%10 = load i32, i32* %4
br label %11
11: ; preds = %9, %8
%12 = phi i32 [ 3, %8 ], [ %10, %9 ]
%13 = load i32, i32* %4
%14 = icmp slt i32 5, %13
br i1 %14, label %15, label %16
15: ; preds = %11
br label %18
16: ; preds = %11
%17 = load i32, i32* %4
br label %18
18: ; preds = %16, %15
%19 = phi i32 [ 5, %15 ], [ %17, %16 ]
%20 = call i8* @usr_alloc2(i32 %12, i32 %19)
store i8* %20, i8** %5
%21 = load i8*, i8** %5
%22 = call i32 @strcpy(i8* %21, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%23 = load i8*, i8** %5
%24 = call i32 @sink(i8* %23)
%25 = load i8*, i8** %5
%26 = call i32 @strcpy(i8* %25, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%27 = load i8*, i8** %5
%28 = call i32 @sink(i8* %27)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"0123456789abcde\00"
@.str.1 = [15 x i8] c"0123456789abcd\00"
define void @usr_alloc2_ir_ir_strcpy(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 3
%4 = select i1 %3, i32 %1, i32 3
%5 = icmp slt i32 %1, 5
%6 = select i1 %5, i32 %1, i32 5
%7 = tail call i8* @usr_alloc2(i32 %4, i32 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @sink(i8* %7)
%10 = tail call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @sink(i8* %7)
ret void
}