#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 */
struct printf_info {
  scalar_t__ wide;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fprintf(int /*<<< orphan*/ *, char *, char *);
int handle_printf_atsign(FILE *stream, const struct printf_info *info,
                         const void *const *args) {
  const void *ptr = *args;
  char *string_object;
  int len = 0;
  string_object = *((char **)ptr);
  if (info->wide == 0)
    len = fprintf(stream, "%s", string_object);
  return len;
}


x86 assembly (clang, -O0):
<handle_printf_atsign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1166 <handle_printf_atsign+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_printf_atsign>:
cmpq   $0x0,(%rsi)
je     1119 <handle_printf_atsign+0x9>
xor    %eax,%eax
ret
mov    (%rdx),%rax
mov    (%rax),%rdx
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.printf_info = type { i64 }
@.str = [3 x i8] c"%s\00"
define i32 @handle_printf_atsign(i32* %0, %struct.printf_info* %1, i8** %2) {
%4 = alloca i32*
%5 = alloca %struct.printf_info*
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i32* %0, i32** %4
store %struct.printf_info* %1, %struct.printf_info** %5
store i8** %2, i8*** %6
%10 = load i8**, i8*** %6
%11 = load i8*, i8** %10
store i8* %11, i8** %7
store i32 0, i32* %9
%12 = load i8*, i8** %7
%13 = bitcast i8* %12 to i8**
%14 = load i8*, i8** %13
store i8* %14, i8** %8
%15 = load %struct.printf_info*, %struct.printf_info** %5
%16 = getelementptr inbounds %struct.printf_info, %struct.printf_info* %15, i32 0, i32 0
%17 = load i64, i64* %16
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %3
%20 = load i32*, i32** %4
%21 = load i8*, i8** %8
%22 = call i32 @fprintf(i32* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %21)
store i32 %22, i32* %9
br label %23
23: ; preds = %19, %3
%24 = load i32, i32* %9
ret i32 %24
}

LLVM IR (-O2):
%struct.printf_info = type { i64 }
@.str = [3 x i8] c"%s\00"
define i32 @handle_printf_atsign(i32* nocapture %0, %struct.printf_info* nocapture %1, i8** nocapture %2) {
%4 = getelementptr inbounds %struct.printf_info, %struct.printf_info* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = bitcast i8** %2 to i8***
%9 = load i8**, i8*** %8
%10 = load i8*, i8** %9
%11 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %7, %3
%13 = phi i32 [ %11, %7 ], [ 0, %3 ]
ret i32 %13
}