#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*/ strcpy(char *, char *);
void sdbout_one_type(char *p) {
  int i, t = 1;
  char *q;
  for (i = 0; i < 2; i++) {
    strcpy(p, "1");
    p += sizeof("1");
  }
  if (t)
    q = "2";
  else
    q = "3";
  strcpy(p, q);
}


x86 assembly (clang, -O0):
<sdbout_one_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    115e <sdbout_one_type+0x4e>
mov    -0x8(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <sdbout_one_type+0x1a>
cmpl   $0x0,-0x10(%rbp)
je     1178 <sdbout_one_type+0x68>
lea    0xe93(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1183 <sdbout_one_type+0x73>
lea    0xe85(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdbout_one_type>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
mov    %r14,%rsi
call   1030 <strcpy@plt>
lea    0x2(%rbx),%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
add    $0x4,%rbx
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"2\00"
define void @sdbout_one_type(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = tail call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}