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


x86 assembly (clang, -O0):
<strc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    1137 <strc+0x27>
lea    0xece(%rip),%rdi
call   1030 <error2@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116b <strc+0x5b>
mov    -0x8(%rbp),%eax
mov    %al,%dl
movslq -0xc(%rbp),%rcx
lea    0x2ee6(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <strc+0x2e>
movslq -0x4(%rbp),%rcx
lea    0x2eca(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2ebf(%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    1151 <strc+0x31>
mov    %ebx,%edx
lea    0x2ef6(%rip),%rdi
mov    %ebp,%esi
call   1030 <memset@plt>
movslq %ebx,%rcx
lea    0x2ee5(%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, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %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 = %21, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %24
15: ; preds = %11
%16 = load i32, i32* %4
%17 = trunc i32 %16 to i8
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [256 x i8], [256 x i8]* @strc.s, i64 0, i64 %19
store i8 %17, i8* %20
br label %21
21: ; preds = %15
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %11
24: ; preds = %11
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [256 x i8], [256 x i8]* @strc.s, i64 0, i64 %26
store i8 0, i8* %27
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, i32 %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 %11
8: ; preds = %4, %6
%9 = trunc i32 %1 to i8
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %8, %6
%12 = sext i32 %0 to i64
%13 = getelementptr inbounds [256 x i8], [256 x i8]* @strc.s, i64 0, i64 %12
store i8 0, i8* %13
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @strc.s, i64 0, i64 0)
}