#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 fib(int);
int /*<<< orphan*/ num(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ ps(char *);
void string_test() {
  int b;
  printf("string:\n");
  printf("\141\1423\143\n");
  printf("\x41\x42\x43\x3a\n");
  printf("c=%c\n", 'r');
  printf("wc=%C 0x%lx %C\n", L'a', L'\x1234', L'c');
  ps("test\n");
  b = 32;
  while ((b = b + 1) < 96) {
    printf("%c", b);
  }
  printf("\n");
  printf("fib=%d\n", fib(33));
  b = 262144;
  while (b != 0x80000000) {
    num(b);
    b = b * 2;
  }
}


x86 assembly (clang, -O0):
<string_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9c(%rip),%rdi
mov    $0x72,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
mov    $0x61,%esi
mov    $0x1234,%edx
mov    $0x63,%ecx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe82(%rip),%rdi
call   1060 <ps@plt>
movl   $0x20,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x60,%eax
jge    11dd <string_test+0x9d>
mov    -0x4(%rbp),%esi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b5 <string_test+0x75>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x21,%edi
call   1050 <fib@plt>
mov    %eax,%esi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x40000,-0x4(%rbp)
cmpl   $0x80000000,-0x4(%rbp)
je     122f <string_test+0xef>
mov    -0x4(%rbp),%edi
call   1030 <num@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    120c <string_test+0xcc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_test>:
push   %rbx
lea    0xebc(%rip),%rdi
call   1050 <puts@plt>
lea    0xeb8(%rip),%rdi
call   1050 <puts@plt>
lea    0xeb1(%rip),%rdi
call   1050 <puts@plt>
lea    0xe74(%rip),%rdi
mov    $0x72,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe67(%rip),%rdi
mov    $0x61,%esi
mov    $0x1234,%edx
mov    $0x63,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe5a(%rip),%rdi
call   1080 <ps@plt>
mov    $0x21,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <putchar@plt>
add    $0x1,%ebx
cmp    $0x60,%ebx
jne    11d0 <string_test+0x70>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    $0x21,%edi
call   1070 <fib@plt>
lea    0xe22(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x40000,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <num@plt>
add    %ebx,%ebx
jmp    1210 <string_test+0xb0>

LLVM IR (-O0):
@.str = [9 x i8] c"string:\0A\00"
@.str.1 = [6 x i8] c"ab3c\0A\00"
@.str.2 = [6 x i8] c"ABC:\0A\00"
@.str.3 = [6 x i8] c"c=%c\0A\00"
@.str.4 = [16 x i8] c"wc=%C 0x%lx %C\0A\00"
@.str.5 = [6 x i8] c"test\0A\00"
@.str.6 = [3 x i8] c"%c\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [8 x i8] c"fib=%d\0A\00"
define void @string_test() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 114)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 97, i32 4660, i32 99)
%7 = call i32 @ps(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
store i32 32, i32* %1
br label %8
8: ; preds = %12, %0
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = icmp slt i32 %10, 96
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %1
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %13)
br label %8
15: ; preds = %8
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%17 = call i32 @fib(i32 33)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %17)
store i32 262144, i32* %1
br label %19
19: ; preds = %22, %15
%20 = load i32, i32* %1
%21 = icmp ne i32 %20, -2147483648
br i1 %21, label %22, label %27
22: ; preds = %19
%23 = load i32, i32* %1
%24 = call i32 @num(i32 %23)
%25 = load i32, i32* %1
%26 = mul nsw i32 %25, 2
store i32 %26, i32* %1
br label %19
27: ; preds = %19
ret void
}

LLVM IR (-O2):
@.str.3 = [6 x i8] c"c=%c\0A\00"
@.str.4 = [16 x i8] c"wc=%C 0x%lx %C\0A\00"
@.str.5 = [6 x i8] c"test\0A\00"
@.str.8 = [8 x i8] c"fib=%d\0A\00"
@str = [8 x i8] c"string:\00"
@str.9 = [5 x i8] c"ab3c\00"
@str.10 = [5 x i8] c"ABC:\00"
define void @string_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.9, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.10, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 114)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 97, i32 4660, i32 99)
%6 = tail call i32 @ps(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %7
7: ; preds = %0, %7
%8 = phi i32 [ 33, %0 ], [ %10, %7 ]
%9 = tail call i32 @putchar(i32 %8)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, 96
br i1 %11, label %12, label %7
12: ; preds = %7
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 @fib(i32 33)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %16, %12
%17 = phi i32 [ 262144, %12 ], [ %19, %16 ]
%18 = tail call i32 @num(i32 %17)
%19 = shl nsw i32 %17, 1
br label %16
}