#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*/ error2(char *);
char *strc(int n, char c) {
  static char s[256];
  int i;
  if (n > 255)
    error2("line >255 in strc");
  for (i = 0; i < n; i++)
    s[i] = c;
  s[n] = 0;
  return (s);
}


x86 assembly (clang, -O0):
<strc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    113a <strc+0x2a>
lea    0xecb(%rip),%rdi
call   1030 <error2@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116c <strc+0x5c>
mov    -0x5(%rbp),%dl
movslq -0xc(%rbp),%rcx
lea    0x2ee5(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <strc+0x31>
movslq -0x4(%rbp),%rcx
lea    0x2ec9(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2ebe(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
cmp    $0x100,%edi
jl     113d <strc+0x1d>
lea    0xeca(%rip),%rdi
call   1040 <error2@plt>
jmp    1141 <strc+0x21>
test   %ebx,%ebx
jle    1153 <strc+0x33>
mov    %ebx,%edx
movzbl %bpl,%esi
lea    0x2ef2(%rip),%rdi
call   1030 <memset@plt>
movslq %ebx,%rcx
lea    0x2ee3(%rip),%rax
movb   $0x0,(%rcx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@strc.s = internal global [256 x i8] zeroinitializer
@.str = [18 x i8] c"line >255 in strc\00"
define i8* @strc(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 255
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @error2(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
store i32 0, i32* %5
br label %11
11: ; preds = %20, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = load i8, i8* %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [256 x i8], [256 x i8]* @strc.s, i64 0, i64 %18
store i8 %16, i8* %19
br label %20
20: ; preds = %15
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %11
23: ; preds = %11
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [256 x i8], [256 x i8]* @strc.s, i64 0, i64 %25
store i8 0, i8* %26
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @strc.s, i64 0, i64 0)
}

LLVM IR (-O2):
@strc.s = internal global [256 x i8] zeroinitializer
@.str = [18 x i8] c"line >255 in strc\00"
define i8* @strc(i32 %0, i8 signext %1) {
%3 = icmp sgt i32 %0, 255
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @error2(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = icmp sgt i32 %0, 0
br i1 %7, label %8, label %10
8: ; preds = %4, %6
%9 = zext i32 %0 to i64
br label %10
10: ; preds = %8, %6
%11 = sext i32 %0 to i64
%12 = getelementptr inbounds [256 x i8], [256 x i8]* @strc.s, i64 0, i64 %11
store i8 0, i8* %12
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @strc.s, i64 0, i64 0)
}