#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 dy_foo(char *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
main() {
  int answer, x = 41;
  char *str = "foostr";
  printf("%s begins:\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/aosm/gcc_os/refs/heads/master/gcc/"
         "testsuite/gcc.apple/special/longcall-prog.c");
  answer = dy_foo(str, x);
  printf("dy_foo (\"%s\", %d) = %d", str, x, answer);
  if (answer != 42)
    printf(" (error!)");
  printf("\n%s done.\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/aosm/gcc_os/refs/heads/master/gcc/"
         "testsuite/gcc.apple/special/longcall-prog.c");
  exit(answer != 42);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x29,-0xc(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xeaf(%rip),%rdi
lea    0xeb4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <dy_foo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xf35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2a,-0x8(%rbp)
je     11a5 <main+0x75>
lea    0xf34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf30(%rip),%rdi
lea    0xe60(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2a,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xecc(%rip),%rdi
lea    0xed1(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb0(%rip),%r14
mov    %r14,%rdi
mov    $0x29,%esi
call   1040 <dy_foo@plt>
mov    %eax,%ebx
lea    0xf55(%rip),%rdi
mov    %r14,%rsi
mov    $0x29,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x2a,%ebx
je     118a <main+0x5a>
lea    0xf4f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %ebp,%ebp
cmp    $0x2a,%ebx
setne  %bpl
lea    0xf42(%rip),%rdi
lea    0xe72(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"foostr\00"
@.str.1 = [12 x i8] c"%s begins:\0A\00"
@.str.2 = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/aosm/gcc_os/refs/heads/master/gcc/testsuite/gcc.apple/special/longcall-prog.c\00"
@.str.3 = [23 x i8] c"dy_foo (\22%s\22, %d) = %d\00"
@.str.4 = [10 x i8] c" (error!)\00"
@.str.5 = [11 x i8] c"\0A%s done.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 0, i32* %1
store i32 41, i32* %3
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str.2, i64 0, i64 0))
%6 = load i8*, i8** %4
%7 = load i32, i32* %3
%8 = call i32 @dy_foo(i8* %6, i32 %7)
store i32 %8, i32* %2
%9 = load i8*, i8** %4
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 %10, i32 %11)
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 42
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %17
17: ; preds = %15, %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str.2, i64 0, i64 0))
%19 = load i32, i32* %2
%20 = icmp ne i32 %19, 42
%21 = zext i1 %20 to i32
%22 = call i32 @exit(i32 %21)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"foostr\00"
@.str.1 = [12 x i8] c"%s begins:\0A\00"
@.str.2 = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/aosm/gcc_os/refs/heads/master/gcc/testsuite/gcc.apple/special/longcall-prog.c\00"
@.str.3 = [23 x i8] c"dy_foo (\22%s\22, %d) = %d\00"
@.str.4 = [10 x i8] c" (error!)\00"
@.str.5 = [11 x i8] c"\0A%s done.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @dy_foo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 41)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 41, i32 %2)
%4 = icmp ne i32 %2, 42
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str.2, i64 0, i64 0))
%9 = zext i1 %4 to i32
%10 = tail call i32 @exit(i32 %9)
unreachable
}