#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*/ exif_cmd;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
int system(char *);
void copy_tags_from_source(const char *source, const char *dest) {
  char exif_cmd[1000];
  snprintf(exif_cmd, sizeof(exif_cmd),
           "exiftool -tagsFromFile \"%s\" -all:all \"-xmp:subject=Dual-ISO\" "
           "\"-UniqueCameraModel<Model\" \"%s\" -overwrite_original",
           source, dest);
  int r = system(exif_cmd);
  if (r != 0) {
    printf("**WARNING** exiftool couldn't update DNG tag data\n");
  }
}


x86 assembly (clang, -O0):
<copy_tags_from_source>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0x3e8,%esi
lea    0xea2(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x400(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x404(%rbp)
cmpl   $0x0,-0x404(%rbp)
je     118e <copy_tags_from_source+0x5e>
lea    0xee8(%rip),%rdi
call   1040 <printf@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_tags_from_source>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xebb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
test   %eax,%eax
je     116d <copy_tags_from_source+0x3d>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [113 x i8] c"exiftool -tagsFromFile \22%s\22 -all:all \22-xmp:subject=Dual-ISO\22 \22-UniqueCameraModel<Model\22 \22%s\22 -overwrite_original\00"
@.str.1 = [51 x i8] c"**WARNING** exiftool couldn't update DNG tag data\0A\00"
define void @copy_tags_from_source(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1000 x i8]
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @snprintf(i8* %7, i32 1000, i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%12 = call i32 @system(i8* %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
ret void
}

LLVM IR (-O2):
@.str = [113 x i8] c"exiftool -tagsFromFile \22%s\22 -all:all \22-xmp:subject=Dual-ISO\22 \22-UniqueCameraModel<Model\22 \22%s\22 -overwrite_original\00"
@str = [50 x i8] c"**WARNING** exiftool couldn't update DNG tag data\00"
define void @copy_tags_from_source(i8* %0, i8* %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 1000, i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @system(i8* %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}