#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*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int);
void cpu_name(int cpu, int npidstot) {
  char name[64];
  sprintf(name, "CPU %d", cpu);
  int y0 = cpu * ((npidstot - 1) * 1000 + 1800 + 225);
  printf("4 2 0 50 0 0 12 0.0 4 135 345 ");
  printf("%d %d ", 450 + 225, 1000 + y0);
  printf("%s\\001\n", name);
}


x86 assembly (clang, -O0):
<cpu_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec4(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
imul   $0x3e8,%ecx,%ecx
add    $0x708,%ecx
add    $0xe1,%ecx
imul   %ecx,%eax
mov    %eax,-0x54(%rbp)
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x54(%rbp),%edx
add    $0x3e8,%edx
lea    0xea6(%rip),%rdi
mov    $0x2a3,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_name>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1040 <sprintf@plt>
imul   $0x3e8,%ebp,%ebp
add    $0x401,%ebp
imul   %ebx,%ebp
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x3e8,%ebp
lea    0xebc(%rip),%rdi
mov    $0x2a3,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"CPU %d\00"
@.str.1 = [31 x i8] c"4 2 0 50 0 0 12 0.0 4 135 345 \00"
@.str.2 = [7 x i8] c"%d %d \00"
@.str.3 = [8 x i8] c"%s\\001\0A\00"
define void @cpu_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [64 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = mul nsw i32 %12, 1000
%14 = add nsw i32 %13, 1800
%15 = add nsw i32 %14, 225
%16 = mul nsw i32 %10, %15
store i32 %16, i32* %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* %6
%19 = add nsw i32 1000, %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 675, i32 %19)
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %21)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"CPU %d\00"
@.str.1 = [31 x i8] c"4 2 0 50 0 0 12 0.0 4 135 345 \00"
@.str.2 = [7 x i8] c"%d %d \00"
@.str.3 = [8 x i8] c"%s\\001\0A\00"
define void @cpu_name(i32 %0, i32 %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = mul i32 %1, 1000
%7 = add i32 %6, 1025
%8 = mul nsw i32 %7, %0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%10 = add nsw i32 %8, 1000
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 675, i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %4)
ret void
}