#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 getpid();
int /*<<< orphan*/ printf(char *, ...);
void printargs(int argc, char *argv[]) {
  int c;
  printf("pid: %u ", getpid());
  for (c = 0; c < argc; ++c) {
    printf("%s ", argv[c]);
  }
  printf("(%d)\n", argc);
  printf("char"
         ": %lu\n",
         sizeof(char));
  ;
  printf("short int"
         ": %lu\n",
         sizeof(short int));
  ;
  printf("int"
         ": %lu\n",
         sizeof(int));
  ;
  printf("long"
         ": %lu\n",
         sizeof(long));
  ;
  printf("long int"
         ": %lu\n",
         sizeof(long int));
  ;
  printf("long long int"
         ": %lu\n",
         sizeof(long long int));
  ;
  printf("double"
         ": %lu\n",
         sizeof(double));
  ;
  printf("long double"
         ": %lu\n",
         sizeof(long double));
  ;
}


x86 assembly (clang, -O0):
<printargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1181 <printargs+0x61>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <printargs+0x2d>
mov    -0x4(%rbp),%esi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7a(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe72(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe84(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe5c(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe59(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe41(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe47(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe2f(%rip),%rdi
mov    $0x10,%esi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printargs>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r12
mov    %edi,%r14d
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    1177 <printargs+0x57>
mov    %r14d,%ebp
lea    0xeb5(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1160 <printargs+0x40>
lea    0xe8f(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe84(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8e(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe66(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe63(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe4b(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe51(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe39(%rip),%rdi
mov    $0x10,%esi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"pid: %u \00"
@.str.1 = [4 x i8] c"%s \00"
@.str.2 = [6 x i8] c"(%d)\0A\00"
@.str.3 = [11 x i8] c"char: %lu\0A\00"
@.str.4 = [16 x i8] c"short int: %lu\0A\00"
@.str.5 = [10 x i8] c"int: %lu\0A\00"
@.str.6 = [11 x i8] c"long: %lu\0A\00"
@.str.7 = [15 x i8] c"long int: %lu\0A\00"
@.str.8 = [20 x i8] c"long long int: %lu\0A\00"
@.str.9 = [13 x i8] c"double: %lu\0A\00"
@.str.10 = [18 x i8] c"long double: %lu\0A\00"
define void @printargs(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (...) @getpid()
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 0, i32* %5
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i8**, i8*** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %8
22: ; preds = %8
%23 = load i32, i32* %3
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i64 1)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i64 2)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i64 4)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i64 8)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i64 8)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i64 8)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i64 8)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i64 16)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"pid: %u \00"
@.str.1 = [4 x i8] c"%s \00"
@.str.2 = [6 x i8] c"(%d)\0A\00"
@.str.3 = [11 x i8] c"char: %lu\0A\00"
@.str.4 = [16 x i8] c"short int: %lu\0A\00"
@.str.5 = [10 x i8] c"int: %lu\0A\00"
@.str.6 = [11 x i8] c"long: %lu\0A\00"
@.str.7 = [15 x i8] c"long int: %lu\0A\00"
@.str.8 = [20 x i8] c"long long int: %lu\0A\00"
@.str.9 = [13 x i8] c"double: %lu\0A\00"
@.str.10 = [18 x i8] c"long double: %lu\0A\00"
define void @printargs(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %2
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %0)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i64 1)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i64 2)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i64 4)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i64 8)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i64 8)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i64 8)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i64 8)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i64 16)
ret void
}