#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*/ __assert_int_equal(char *, int /*<<< orphan*/, int, int,
                                      char *);
int puts(char *);
int /*<<< orphan*/ strlen(char *);
void testPuts() {
  char m[] = "hello world\n";
  int written = puts(m);
  __assert_int_equal("puts(str) returns strlen(str)", strlen(m), written, 137,
                     "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/morningsend/zkernel/"
                     "refs/heads/master/user/test/test.c");
  ;
}


x86 assembly (clang, -O0):
<testPuts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeba(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0xd(%rbp),%rdi
call   1030 <puts@plt>
mov    %eax,-0x14(%rbp)
lea    -0xd(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%esi
mov    -0x14(%rbp),%edx
lea    0xe97(%rip),%rdi
mov    $0x89,%ecx
lea    0xea9(%rip),%r8
call   1050 <__assert_int_equal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testPuts>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movabs $0xa646c726f7720,%rax
mov    %rax,0xd(%rsp)
movabs $0x6f77206f6c6c6568,%rax
20 77 6f
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe9b(%rip),%rdi
lea    0xeb2(%rip),%r8
mov    %eax,%esi
mov    %ebp,%edx
mov    $0x89,%ecx
call   1050 <__assert_int_equal@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.testPuts.m = [13 x i8] c"hello world\0A\00"
@.str = [30 x i8] c"puts(str) returns strlen(str)\00"
@.str.1 = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/morningsend/zkernel/refs/heads/master/user/test/test.c\00"
define void @testPuts() {
%1 = alloca [13 x i8]
%2 = alloca i32
%3 = bitcast [13 x i8]* %1 to i8*
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%5 = call i32 @puts(i8* %4)
store i32 %5, i32* %2
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = load i32, i32* %2
%9 = call i32 @__assert_int_equal(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 137, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.testPuts.m = [13 x i8] c"hello world\0A\00"
@.str = [30 x i8] c"puts(str) returns strlen(str)\00"
@.str.1 = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/morningsend/zkernel/refs/heads/master/user/test/test.c\00"
define void @testPuts() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @puts(i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @__assert_int_equal(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %3, i32 137, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0))
ret void
}