#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__ image_exists(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *);
char *get_images_tag(char *station, char *uname) {
  static char images_tag[256];
  *images_tag = '\0';
  if (image_exists(station)) {
    sprintf(images_tag,
            "<tr><td align=center><img border=2 src=http://%s/%s/%s/%s.png "
            "width=200>",
            uname, "hydrology", "station_images_medium", station);
  }
  return images_tag;
}


x86 assembly (clang, -O0):
<get_images_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,0x2f09(%rip)
mov    -0x8(%rbp),%rdi
call   1030 <image_exists@plt>
cmp    $0x0,%rax
je     1173 <get_images_tag+0x53>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r9
lea    0x2ee7(%rip),%rdi
lea    0xea0(%rip),%rsi
lea    0xee2(%rip),%rcx
lea    0xee5(%rip),%r8
call   1040 <sprintf@plt>
lea    0x2ec6(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_images_tag>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movb   $0x0,0x2f0f(%rip)
call   1030 <image_exists@plt>
test   %rax,%rax
je     1162 <get_images_tag+0x42>
lea    0x2efe(%rip),%rdi
lea    0xeb7(%rip),%rsi
lea    0xef9(%rip),%rcx
lea    0xefc(%rip),%r8
mov    %r14,%rdx
mov    %rbx,%r9
call   1040 <sprintf@plt>
lea    0x2ed7(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@get_images_tag.images_tag = internal global [256 x i8] zeroinitializer
@.str = [73 x i8] c"<tr><td align=center><img border=2 src=http://%s/%s/%s/%s.png width=200>\00"
@.str.1 = [10 x i8] c"hydrology\00"
@.str.2 = [22 x i8] c"station_images_medium\00"
define i8* @get_images_tag(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8 0, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_images_tag.images_tag, i64 0, i64 0)
%5 = load i8*, i8** %3
%6 = call i64 @image_exists(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i8*, i8** %3
%11 = call i32 @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_images_tag.images_tag, i64 0, i64 0), i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %2
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_images_tag.images_tag, i64 0, i64 0)
}

LLVM IR (-O2):
@get_images_tag.images_tag = internal global [256 x i8] zeroinitializer
@.str = [73 x i8] c"<tr><td align=center><img border=2 src=http://%s/%s/%s/%s.png width=200>\00"
@.str.1 = [10 x i8] c"hydrology\00"
@.str.2 = [22 x i8] c"station_images_medium\00"
define i8* @get_images_tag(i8* %0, i8* %1) {
store i8 0, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_images_tag.images_tag, i64 0, i64 0)
%3 = tail call i64 @image_exists(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @get_images_tag.images_tag, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @get_images_tag.images_tag, i64 0, i64 0)
}