#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*/ d003s(int);
int /*<<< orphan*/ d003t(int);
scalar_t__ icheck(char *);
int /*<<< orphan*/ init();
int /*<<< orphan*/ printf(char *);
main() {
  int i, n, errors;
  n = 117;
  errors = 0;
  init();
  d003s(n);
  errors += icheck("after d003s");
  init();
  d003t(n);
  errors += icheck("after d003t");
  if (errors == 0)
    printf("for 003 PASSED\n");
  else
    printf("for 003 FAILED\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x75,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1060 <init@plt>
mov    -0xc(%rbp),%edi
call   1070 <d003s@plt>
lea    0xe7d(%rip),%rdi
call   1050 <icheck@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <init@plt>
mov    -0xc(%rbp),%edi
call   1030 <d003t@plt>
lea    0xe61(%rip),%rdi
call   1050 <icheck@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    11d8 <main+0x88>
lea    0xe4a(%rip),%rdi
call   1040 <printf@plt>
jmp    11e4 <main+0x94>
lea    0xe49(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <init@plt>
mov    $0x75,%edi
call   1070 <d003s@plt>
lea    0xe97(%rip),%rdi
call   1050 <icheck@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <init@plt>
mov    $0x75,%edi
call   1040 <d003t@plt>
lea    0xe83(%rip),%rdi
call   1050 <icheck@plt>
add    %ebx,%eax
lea    0xe90(%rip),%rax
lea    0xe7a(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"after d003s\00"
@.str.1 = [12 x i8] c"after d003t\00"
@.str.2 = [16 x i8] c"for 003 PASSED\0A\00"
@.str.3 = [16 x i8] c"for 003 FAILED\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 117, i32* %3
store i32 0, i32* %4
%5 = call i32 (...) @init()
%6 = load i32, i32* %3
%7 = call i32 @d003s(i32 %6)
%8 = call i64 @icheck(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %4
%13 = call i32 (...) @init()
%14 = load i32, i32* %3
%15 = call i32 @d003t(i32 %14)
%16 = call i64 @icheck(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = add nsw i64 %18, %16
%20 = trunc i64 %19 to i32
store i32 %20, i32* %4
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %0
%24 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
br label %27
25: ; preds = %0
%26 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str = [12 x i8] c"after d003s\00"
@.str.1 = [12 x i8] c"after d003t\00"
@str = [15 x i8] c"for 003 FAILED\00"
@str.4 = [15 x i8] c"for 003 PASSED\00"
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 @d003s(i32 117)
%3 = tail call i64 @icheck(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @init()
%5 = tail call i32 @d003t(i32 117)
%6 = tail call i64 @icheck(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%7 = add i64 %6, %3
%8 = trunc i64 %7 to i32
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0)
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
ret i32 0
}