#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 */
typedef int id_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
void fmt_usergroup(FILE *out, id_t id, const char *n, int w, int mw) {
  if (n)
    fputs(n, out);
  else
    fprintf(out, "%d", id);
  for (int n = mw - w + 1; n--;)
    putc(' ', out);
}


x86 assembly (clang, -O0):
<fmt_usergroup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1167 <fmt_usergroup+0x37>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <fputs@plt>
jmp    117a <fmt_usergroup+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe8b(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x24(%rbp)
cmp    $0x0,%eax
je     11ad <fmt_usergroup+0x7d>
mov    -0x8(%rbp),%rsi
mov    $0x20,%edi
call   1040 <putc@plt>
jmp    1186 <fmt_usergroup+0x56>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_usergroup>:
push   %rbp
push   %r14
push   %rbx
mov    %r8d,%ebx
mov    %ecx,%ebp
mov    %rdi,%r14
test   %rdx,%rdx
je     114e <fmt_usergroup+0x1e>
mov    %rdx,%rdi
mov    %r14,%rsi
call   1030 <fputs@plt>
jmp    1161 <fmt_usergroup+0x31>
mov    %esi,%eax
lea    0xea9(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
call   1050 <fprintf@plt>
mov    %ebx,%eax
sub    %ebp,%eax
cmp    $0xffffffff,%eax
je     1181 <fmt_usergroup+0x51>
not    %ebx
add    %ebp,%ebx
xchg   %ax,%ax
mov    $0x20,%edi
mov    %r14,%rsi
call   1040 <putc@plt>
inc    %ebx
jne    1170 <fmt_usergroup+0x40>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @fmt_usergroup(i32* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i8*, i8** %8
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %5
%15 = load i8*, i8** %8
%16 = load i32*, i32** %6
%17 = call i32 @fputs(i8* %15, i32* %16)
br label %22
18: ; preds = %5
%19 = load i32*, i32** %6
%20 = load i32, i32* %7
%21 = call i32 @fprintf(i32* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %18, %14
%23 = load i32, i32* %10
%24 = load i32, i32* %9
%25 = sub nsw i32 %23, %24
%26 = add nsw i32 %25, 1
store i32 %26, i32* %11
br label %27
27: ; preds = %31, %22
%28 = load i32, i32* %11
%29 = add nsw i32 %28, -1
store i32 %29, i32* %11
%30 = icmp ne i32 %28, 0
br i1 %30, label %31, label %34
31: ; preds = %27
%32 = load i32*, i32** %6
%33 = call i32 @putc(i8 signext 32, i32* %32)
br label %27
34: ; preds = %27
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @fmt_usergroup(i32* nocapture %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = icmp eq i8* %2, null
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @fputs(i8* %2, i32* %0)
br label %11
9: ; preds = %5
%10 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %11
11: ; preds = %9, %7
%12 = sub i32 1, %3
%13 = add i32 %12, %4
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %16, %11
ret void
16: ; preds = %11, %16
%17 = phi i32 [ %18, %16 ], [ %13, %11 ]
%18 = add nsw i32 %17, -1
%19 = tail call i32 @putc(i8 signext 32, i32* %0)
%20 = icmp eq i32 %18, 0
br i1 %20, label %15, label %16
}