#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 */
scalar_t__ testAlign();
scalar_t__ testDeprecatedUsed();
scalar_t__ testDeprecatedUsedMessage();
scalar_t__ testPacked();
scalar_t__ testUnused(int /*<<< orphan*/);
scalar_t__ testWeak1();
scalar_t__ testWeak2();
int main() {
  int failed = 0;
  failed += testPacked();
  failed += testAlign();
  failed += testUnused(0);
  failed += testDeprecatedUsed();
  failed += testWeak1();
  failed += testWeak2();
  failed += testDeprecatedUsedMessage();
  return failed;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <testPacked@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <testAlign@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1060 <testUnused@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1080 <testDeprecatedUsed@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <testWeak1@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1090 <testWeak2@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <testDeprecatedUsedMessage@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <testPacked@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1070 <testAlign@plt>
mov    %rax,%r15
add    %r14d,%r15d
xor    %edi,%edi
call   1060 <testUnused@plt>
mov    %rax,%rbx
add    %r15d,%ebx
xor    %eax,%eax
call   1080 <testDeprecatedUsed@plt>
mov    %rax,%r14
add    %ebx,%r14d
xor    %eax,%eax
call   1050 <testWeak1@plt>
mov    %rax,%rbx
add    %r14d,%ebx
xor    %eax,%eax
call   1090 <testWeak2@plt>
mov    %rax,%r14
add    %ebx,%r14d
xor    %eax,%eax
call   1030 <testDeprecatedUsedMessage@plt>
add    %r14d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i64 (...) @testPacked()
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = call i64 (...) @testAlign()
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = call i64 @testUnused(i32 0)
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %2
%18 = call i64 (...) @testDeprecatedUsed()
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = add nsw i64 %20, %18
%22 = trunc i64 %21 to i32
store i32 %22, i32* %2
%23 = call i64 (...) @testWeak1()
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = add nsw i64 %25, %23
%27 = trunc i64 %26 to i32
store i32 %27, i32* %2
%28 = call i64 (...) @testWeak2()
%29 = load i32, i32* %2
%30 = sext i32 %29 to i64
%31 = add nsw i64 %30, %28
%32 = trunc i64 %31 to i32
store i32 %32, i32* %2
%33 = call i64 (...) @testDeprecatedUsedMessage()
%34 = load i32, i32* %2
%35 = sext i32 %34 to i64
%36 = add nsw i64 %35, %33
%37 = trunc i64 %36 to i32
store i32 %37, i32* %2
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @testPacked()
%2 = tail call i64 (...) @testAlign()
%3 = add i64 %2, %1
%4 = tail call i64 @testUnused(i32 0)
%5 = add i64 %3, %4
%6 = tail call i64 (...) @testDeprecatedUsed()
%7 = add i64 %5, %6
%8 = tail call i64 (...) @testWeak1()
%9 = add i64 %7, %8
%10 = tail call i64 (...) @testWeak2()
%11 = add i64 %9, %10
%12 = tail call i64 (...) @testDeprecatedUsedMessage()
%13 = add i64 %11, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}