#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*/ error(char *, int, char *);
int myprintf(char *, int, double);
int printf(char *, int, ...);
int /*<<< orphan*/ simple_va_fun(char *, int, int, int, ...);
int strcmp(char *, char *);
main() {
  simple_va_fun("extra arg", -5, 100, -1);
  simple_va_fun("extra arg", -5, 100, 200, -1);
  simple_va_fun("extra arg", -5, 100, 200, 500, -1);
  printf("%d\n", myprintf("\n%d,%.3f\n", 12, 1.8));
  printf("%d\n", printf("%d,%.3f\n", 12, 1.5));
  printf("%d", strcmp("lixiang", "lixiang"));
  error("%d,%s", 79,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/lixiangbest/algorithm/refs/heads/master/"
        "falls/9.1.c");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0xfffffffb,%esi
mov    $0x64,%edx
mov    $0xffffffff,%ecx
mov    $0x0,%al
call   1060 <simple_va_fun@plt>
lea    0xe8d(%rip),%rdi
mov    $0xfffffffb,%esi
mov    $0x64,%edx
mov    $0xc8,%ecx
mov    $0xffffffff,%r8d
mov    $0x0,%al
call   1060 <simple_va_fun@plt>
lea    0xe6a(%rip),%rdi
mov    $0xfffffffb,%esi
mov    $0x64,%edx
mov    $0xc8,%ecx
mov    $0x1f4,%r8d
mov    $0xffffffff,%r9d
mov    $0x0,%al
call   1060 <simple_va_fun@plt>
lea    0xe4f(%rip),%rdi
mov    $0xc,%esi
movsd  0xe2c(%rip),%xmm0
call   1050 <myprintf@plt>
mov    %eax,%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe27(%rip),%rdi
mov    $0xc,%esi
movsd  0xdfb(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
mov    %eax,%esi
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe08(%rip),%rsi
mov    %rsi,%rdi
call   1040 <strcmp@plt>
mov    %eax,%esi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf1(%rip),%rdi
mov    $0x4f,%esi
lea    0xdeb(%rip),%rdx
call   1070 <error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xfffffffb,%esi
mov    $0x64,%edx
mov    $0xffffffff,%ecx
xor    %eax,%eax
call   1050 <simple_va_fun@plt>
mov    %rbx,%rdi
mov    $0xfffffffb,%esi
mov    $0x64,%edx
mov    $0xc8,%ecx
mov    $0xffffffff,%r8d
xor    %eax,%eax
call   1050 <simple_va_fun@plt>
mov    %rbx,%rdi
mov    $0xfffffffb,%esi
mov    $0x64,%edx
mov    $0xc8,%ecx
mov    $0x1f4,%r8d
mov    $0xffffffff,%r9d
xor    %eax,%eax
call   1050 <simple_va_fun@plt>
lea    0xe72(%rip),%rdi
movsd  0xe4c(%rip),%xmm0
mov    $0xc,%esi
call   1040 <myprintf@plt>
lea    0xe55(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe47(%rip),%rdi
movsd  0xe28(%rip),%xmm0
mov    $0xc,%esi
mov    $0x1,%al
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe29(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe1c(%rip),%rdi
lea    0xe1b(%rip),%rdx
mov    $0x4f,%esi
call   1060 <error@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"extra arg\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [10 x i8] c"\0A%d,%.3f\0A\00"
@.str.3 = [9 x i8] c"%d,%.3f\0A\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [8 x i8] c"lixiang\00"
@.str.6 = [6 x i8] c"%d,%s\00"
@.str.7 = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/lixiangbest/algorithm/refs/heads/master/falls/9.1.c\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, i32, i32, i32, ...) @simple_va_fun(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 -5, i32 100, i32 -1)
%3 = call i32 (i8*, i32, i32, i32, ...) @simple_va_fun(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 -5, i32 100, i32 200, i32 -1)
%4 = call i32 (i8*, i32, i32, i32, ...) @simple_va_fun(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 -5, i32 100, i32 200, i32 500, i32 -1)
%5 = call i32 @myprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 12, double 1.800000e+00)
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 12, double 1.500000e+00)
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = call i32 @error(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 79, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"extra arg\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [10 x i8] c"\0A%d,%.3f\0A\00"
@.str.3 = [9 x i8] c"%d,%.3f\0A\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.6 = [6 x i8] c"%d,%s\00"
@.str.7 = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/lixiangbest/algorithm/refs/heads/master/falls/9.1.c\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, i32, i32, ...) @simple_va_fun(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 -5, i32 100, i32 -1)
%2 = tail call i32 (i8*, i32, i32, i32, ...) @simple_va_fun(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 -5, i32 100, i32 200, i32 -1)
%3 = tail call i32 (i8*, i32, i32, i32, ...) @simple_va_fun(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 -5, i32 100, i32 200, i32 500, i32 -1)
%4 = tail call i32 @myprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 12, double 1.800000e+00)
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 12, double 1.500000e+00)
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 0)
%9 = tail call i32 @error(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 79, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}