#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*/ _debug(char *, int, ...);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char *agrv[]) {
  _debug("test%d int     %d  \n", 1, 0x123);
  _debug("test%d char    %c  \n", 2, 'g');
  _debug("test%d float   %.2f\n", 3, 123.4567);
  _debug("test%d double  %lf \n", 4, 123.45678901);
  _debug("test%d long    %ld \n", 5, 123456789);
  _debug("test%d string  %s  \n", 5, "Am I right?");
  char *p = "pointer";
  _debug("test%d pointer %p  \n", 6, p);
  _debug("test%d string  %s  \n", 7, p);
  _debug("test%d %s %d, %f, %c%s\n", 8, "This is a test:", 123, 45.678, 'G',
         "ood!");
  do {
    fprintf(stderr, "[debug %s:%d] [%s %s]: ",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/hy0kl/study/refs/heads/master/c-study/"
            "debug.c",
            51, "Mar 18 2022", "10:35:18");
    fprintf(stderr, "test%d %s %d, %f, %c%s\n", 9, "This is a test:", 12345,
            11.121, 'K', " good!");
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xee3(%rip),%rdi
mov    $0x1,%esi
mov    $0x123,%edx
mov    $0x0,%al
call   1040 <_debug@plt>
lea    0xee0(%rip),%rdi
mov    $0x2,%esi
mov    $0x67,%edx
mov    $0x0,%al
call   1040 <_debug@plt>
lea    0xedd(%rip),%rdi
mov    $0x3,%esi
movsd  0xe96(%rip),%xmm0
mov    $0x1,%al
call   1040 <_debug@plt>
lea    0xed7(%rip),%rdi
mov    $0x4,%esi
movsd  0xe73(%rip),%xmm0
mov    $0x1,%al
call   1040 <_debug@plt>
lea    0xed1(%rip),%rdi
mov    $0x5,%esi
mov    $0x75bcd15,%edx
mov    $0x0,%al
call   1040 <_debug@plt>
lea    0xece(%rip),%rdi
mov    $0x5,%esi
lea    0xed7(%rip),%rdx
mov    $0x0,%al
call   1040 <_debug@plt>
lea    0xed5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
lea    0xece(%rip),%rdi
mov    $0x6,%esi
mov    $0x0,%al
call   1040 <_debug@plt>
mov    -0x18(%rbp),%rdx
lea    0xe8e(%rip),%rdi
mov    $0x7,%esi
mov    $0x0,%al
call   1040 <_debug@plt>
lea    0xeb9(%rip),%rdi
mov    $0x8,%esi
lea    0xec5(%rip),%rdx
mov    $0x7b,%ecx
movsd  0xdd9(%rip),%xmm0
mov    $0x47,%r8d
lea    0xf72(%rip),%r9
mov    $0x1,%al
call   1040 <_debug@plt>
mov    0x2d9e(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
lea    0xeb5(%rip),%rdx
mov    $0x33,%ecx
lea    0xf31(%rip),%r8
lea    0xf36(%rip),%r9
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d6d(%rip),%rax
mov    (%rax),%edi
lea    0xe4b(%rip),%rsi
mov    $0x9,%edx
lea    0xe57(%rip),%rcx
mov    $0x3039,%r8d
movsd  0xd82(%rip),%xmm0
mov    $0x4b,%r9d
lea    0xf01(%rip),%rax
mov    %rax,(%rsp)
mov    $0x1,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xef0(%rip),%rdi
mov    $0x1,%esi
mov    $0x123,%edx
xor    %eax,%eax
call   1040 <_debug@plt>
lea    0xeed(%rip),%rdi
mov    $0x2,%esi
mov    $0x67,%edx
xor    %eax,%eax
call   1040 <_debug@plt>
lea    0xeea(%rip),%rdi
movsd  0xe98(%rip),%xmm0
mov    $0x3,%esi
mov    $0x1,%al
call   1040 <_debug@plt>
lea    0xee4(%rip),%rdi
movsd  0xe85(%rip),%xmm0
mov    $0x4,%esi
mov    $0x1,%al
call   1040 <_debug@plt>
lea    0xede(%rip),%rdi
mov    $0x5,%esi
mov    $0x75bcd15,%edx
xor    %eax,%eax
call   1040 <_debug@plt>
lea    0xedb(%rip),%r14
lea    0xee9(%rip),%rdx
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <_debug@plt>
lea    0xee7(%rip),%rdi
lea    0xed8(%rip),%rbx
mov    $0x6,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <_debug@plt>
mov    %r14,%rdi
mov    $0x7,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <_debug@plt>
lea    0xecd(%rip),%r15
lea    0xede(%rip),%r14
lea    0xf9e(%rip),%r9
movsd  0xe00(%rip),%xmm0
mov    %r15,%rdi
mov    $0x8,%esi
mov    %r14,%rdx
mov    $0x7b,%ecx
mov    $0x47,%r8d
mov    $0x1,%al
call   1040 <_debug@plt>
mov    0x2dac(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb2(%rip),%rsi
lea    0xec3(%rip),%rdx
lea    0xf44(%rip),%r8
lea    0xf49(%rip),%r9
mov    $0x33,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf3d(%rip),%rax
mov    %rax,(%rsp)
movsd  0xda5(%rip),%xmm0
mov    %r15,%rsi
mov    $0x9,%edx
mov    %r14,%rcx
mov    $0x3039,%r8d
mov    $0x4b,%r9d
mov    $0x1,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"test%d int %d \0A\00"
@.str.1 = [21 x i8] c"test%d char %c \0A\00"
@.str.2 = [21 x i8] c"test%d float %.2f\0A\00"
@.str.3 = [21 x i8] c"test%d double %lf \0A\00"
@.str.4 = [21 x i8] c"test%d long %ld \0A\00"
@.str.5 = [21 x i8] c"test%d string %s \0A\00"
@.str.6 = [12 x i8] c"Am I right?\00"
@.str.7 = [8 x i8] c"pointer\00"
@.str.8 = [21 x i8] c"test%d pointer %p \0A\00"
@.str.9 = [24 x i8] c"test%d %s %d, %f, %c%s\0A\00"
@.str.10 = [16 x i8] c"This is a test:\00"
@.str.11 = [5 x i8] c"ood!\00"
@stderr = global i32 0
@.str.12 = [24 x i8] c"[debug %s:%d] [%s %s]: \00"
@.str.13 = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hy0kl/study/refs/heads/master/c-study/debug.c\00"
@.str.14 = [12 x i8] c"Mar 18 2022\00"
@.str.15 = [9 x i8] c"10:35:18\00"
@.str.16 = [7 x i8] c" good!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 1, i32 291)
%8 = call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 103)
%9 = call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 3, double 0x405EDD3A92A30553)
%10 = call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 4, double 0x405EDD3C07F8C7D2)
%11 = call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 5, i32 123456789)
%12 = call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8** %6
%13 = load i8*, i8** %6
%14 = call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i32 6, i8* %13)
%15 = load i8*, i8** %6
%16 = call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 7, i8* %15)
%17 = call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 123, double 4.567800e+01, i32 71, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
br label %18
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.13, i64 0, i64 0), i32 51, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 12345, double 1.112100e+01, i32 75, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
br label %23
23: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"test%d int %d \0A\00"
@.str.1 = [21 x i8] c"test%d char %c \0A\00"
@.str.2 = [21 x i8] c"test%d float %.2f\0A\00"
@.str.3 = [21 x i8] c"test%d double %lf \0A\00"
@.str.4 = [21 x i8] c"test%d long %ld \0A\00"
@.str.5 = [21 x i8] c"test%d string %s \0A\00"
@.str.6 = [12 x i8] c"Am I right?\00"
@.str.7 = [8 x i8] c"pointer\00"
@.str.8 = [21 x i8] c"test%d pointer %p \0A\00"
@.str.9 = [24 x i8] c"test%d %s %d, %f, %c%s\0A\00"
@.str.10 = [16 x i8] c"This is a test:\00"
@.str.11 = [5 x i8] c"ood!\00"
@stderr = global i32 0
@.str.12 = [24 x i8] c"[debug %s:%d] [%s %s]: \00"
@.str.13 = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hy0kl/study/refs/heads/master/c-study/debug.c\00"
@.str.14 = [12 x i8] c"Mar 18 2022\00"
@.str.15 = [9 x i8] c"10:35:18\00"
@.str.16 = [7 x i8] c" good!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 1, i32 291)
%4 = tail call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 103)
%5 = tail call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 3, double 0x405EDD3A92A30553)
%6 = tail call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 4, double 0x405EDD3C07F8C7D2)
%7 = tail call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 5, i32 123456789)
%8 = tail call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i32 6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%10 = tail call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%11 = tail call i32 (i8*, i32, ...) @_debug(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 123, double 4.567800e+01, i32 71, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.13, i64 0, i64 0), i32 51, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i32 12345, double 1.112100e+01, i32 75, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
ret i32 0
}