#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 */
typedef int /*<<< orphan*/ args;

/* Variables and functions */
int /*<<< orphan*/ _assert_int_equal(unsigned long long, unsigned long long,
                                     char *, int);
int /*<<< orphan*/ _expect_string(char *, char *, char *, int, char const *,
                                  int);
scalar_t__ example_main(int, char **);
void test_example_main(void **state) {
  const char *args[] = {
      "example", "1", "+", "3", "*", "10",
  };
  (void)state;
  _expect_string("example_test_printf", "temporary_buffer",
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/jhrozek/cmocka/refs/heads/"
                 "master/example/calculator_test.c",
                 445, (const char *)("1\n"), 1);
  _expect_string("example_test_printf", "temporary_buffer",
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/jhrozek/cmocka/refs/heads/"
                 "master/example/calculator_test.c",
                 446, (const char *)("  + 3 = 4\n"), 1);
  _expect_string("example_test_printf", "temporary_buffer",
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/jhrozek/cmocka/refs/heads/"
                 "master/example/calculator_test.c",
                 447, (const char *)("  * 10 = 40\n"), 1);
  _expect_string("example_test_printf", "temporary_buffer",
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/jhrozek/cmocka/refs/heads/"
                 "master/example/calculator_test.c",
                 448, (const char *)("= 40\n"), 1);
  _assert_int_equal(((unsigned long long)((size_t)(example_main(
                        (sizeof(args) / sizeof((args)[0])), (char **)args)))),
                    ((unsigned long long)((size_t)(0))),
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jhrozek/cmocka/refs/"
                    "heads/master/example/calculator_test.c",
                    450);
}


x86 assembly (clang, -O0):
<test_example_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
lea    0xe9d(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe9a(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe91(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe88(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe7f(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe76(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe6e(%rip),%rdi
lea    0xe7b(%rip),%rsi
lea    0xe85(%rip),%rdx
mov    $0x1bd,%ecx
lea    0xf0e(%rip),%r8
mov    $0x1,%r9d
call   1040 <_expect_string@plt>
lea    0xe42(%rip),%rdi
lea    0xe4f(%rip),%rsi
lea    0xe59(%rip),%rdx
mov    $0x1be,%ecx
lea    0xee5(%rip),%r8
mov    $0x1,%r9d
call   1040 <_expect_string@plt>
lea    0xe16(%rip),%rdi
lea    0xe23(%rip),%rsi
lea    0xe2d(%rip),%rdx
mov    $0x1bf,%ecx
lea    0xec4(%rip),%r8
mov    $0x1,%r9d
call   1040 <_expect_string@plt>
lea    0xdea(%rip),%rdi
lea    0xdf7(%rip),%rsi
lea    0xe01(%rip),%rdx
mov    $0x1c0,%ecx
lea    0xe9f(%rip),%r8
mov    $0x1,%r9d
call   1040 <_expect_string@plt>
lea    -0x40(%rbp),%rsi
mov    $0x6,%edi
call   1060 <example_main@plt>
mov    %rax,%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    0xdce(%rip),%rdx
mov    $0x1c2,%ecx
call   1050 <_assert_int_equal@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_example_main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xec0(%rip),%rax
mov    %rax,(%rsp)
lea    0xebd(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xeb3(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xea9(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe9f(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0xe95(%rip),%rax
mov    %rax,0x28(%rsp)
lea    0xe8c(%rip),%rbx
lea    0xe99(%rip),%r15
lea    0xea3(%rip),%r14
lea    0xf31(%rip),%r8
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1bd,%ecx
mov    $0x1,%r9d
call   1030 <_expect_string@plt>
lea    0xf14(%rip),%r8
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1be,%ecx
mov    $0x1,%r9d
call   1030 <_expect_string@plt>
lea    0xeff(%rip),%r8
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1bf,%ecx
mov    $0x1,%r9d
call   1030 <_expect_string@plt>
lea    0xee6(%rip),%r8
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x1c0,%ecx
mov    $0x1,%r9d
call   1030 <_expect_string@plt>
mov    %rsp,%rsi
mov    $0x6,%edi
call   1050 <example_main@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
mov    $0x1c2,%ecx
call   1040 <_assert_int_equal@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"example\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [2 x i8] c"+\00"
@.str.3 = [2 x i8] c"3\00"
@.str.4 = [2 x i8] c"*\00"
@.str.5 = [3 x i8] c"10\00"
@.str.6 = [20 x i8] c"example_test_printf\00"
@.str.7 = [17 x i8] c"temporary_buffer\00"
@.str.8 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jhrozek/cmocka/refs/heads/master/example/calculator_test.c\00"
@.str.9 = [3 x i8] c"1\0A\00"
@.str.10 = [11 x i8] c" + 3 = 4\0A\00"
@.str.11 = [13 x i8] c" * 10 = 40\0A\00"
@.str.12 = [6 x i8] c"= 40\0A\00"
define void @test_example_main(i8** %0) {
%2 = alloca i8**
%3 = alloca [6 x i8*]
store i8** %0, i8*** %2
%4 = bitcast [6 x i8*]* %3 to i8*
%5 = bitcast i8* %4 to [6 x i8*]*
%6 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i32 0, i32 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8** %6
%7 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i32 0, i32 1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8** %7
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i32 0, i32 2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i32 0, i32 3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i32 0, i32 4
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i32 0, i32 5
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8** %11
%12 = load i8**, i8*** %2
%13 = call i32 @_expect_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.8, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 1)
%14 = call i32 @_expect_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.8, i64 0, i64 0), i32 446, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32 1)
%15 = call i32 @_expect_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.8, i64 0, i64 0), i32 447, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 1)
%16 = call i32 @_expect_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.8, i64 0, i64 0), i32 448, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 1)
%17 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 0
%18 = call i64 @example_main(i32 6, i8** %17)
%19 = call i32 @_assert_int_equal(i64 %18, i64 0, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.8, i64 0, i64 0), i32 450)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"example\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [2 x i8] c"+\00"
@.str.3 = [2 x i8] c"3\00"
@.str.4 = [2 x i8] c"*\00"
@.str.5 = [3 x i8] c"10\00"
@.str.6 = [20 x i8] c"example_test_printf\00"
@.str.7 = [17 x i8] c"temporary_buffer\00"
@.str.8 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jhrozek/cmocka/refs/heads/master/example/calculator_test.c\00"
@.str.9 = [3 x i8] c"1\0A\00"
@.str.10 = [11 x i8] c" + 3 = 4\0A\00"
@.str.11 = [13 x i8] c" * 10 = 40\0A\00"
@.str.12 = [6 x i8] c"= 40\0A\00"
define void @test_example_main(i8** nocapture readnone %0) {
%2 = alloca [6 x i8*]
%3 = bitcast [6 x i8*]* %2 to i8*
%4 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 4
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 5
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8** %9
%10 = tail call i32 @_expect_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.8, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 1)
%11 = tail call i32 @_expect_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.8, i64 0, i64 0), i32 446, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32 1)
%12 = tail call i32 @_expect_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.8, i64 0, i64 0), i32 447, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 1)
%13 = tail call i32 @_expect_string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.8, i64 0, i64 0), i32 448, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 1)
%14 = call i64 @example_main(i32 6, i8** %4)
%15 = call i32 @_assert_int_equal(i64 %14, i64 0, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.8, i64 0, i64 0), i32 450)
ret void
}