#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 utsname {
  char *machine;
  char *sysname;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ uname(struct utsname *);
void ipm_get_mach_info(char *machi, int len) {
  char buf[200];
  struct utsname mach_info;
  uname(&mach_info);
  sprintf(buf, "%s_%s", mach_info.machine, mach_info.sysname);
  strncpy(machi, buf, len);
}


x86 assembly (clang, -O0):
<ipm_get_mach_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xf0(%rbp),%rdi
call   1040 <uname@plt>
lea    -0xe0(%rbp),%rdi
mov    -0xf0(%rbp),%rdx
mov    -0xe8(%rbp),%rcx
lea    0xe96(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <strncpy@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipm_get_mach_info>:
push   %rbp
push   %r14
push   %rbx
sub    $0xe0,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1040 <uname@plt>
mov    (%rsp),%rdx
mov    0x8(%rsp),%rcx
lea    0xea7(%rip),%rsi
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
call   1030 <strncpy@plt>
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.utsname = type { i8*, i8* }
@.str = [6 x i8] c"%s_%s\00"
define void @ipm_get_mach_info(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [200 x i8]
%6 = alloca %struct.utsname
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = call i32 @uname(%struct.utsname* %6)
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 0
%10 = load i8*, i8** %9
%11 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 1
%12 = load i8*, i8** %11
%13 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %12)
%14 = load i8*, i8** %3
%15 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%16 = load i32, i32* %4
%17 = call i32 @strncpy(i8* %14, i8* %15, i32 %16)
ret void
}

LLVM IR (-O2):
%struct.utsname = type { i8*, i8* }
@.str = [6 x i8] c"%s_%s\00"
define void @ipm_get_mach_info(i8* %0, i32 %1) {
%3 = alloca [200 x i8]
%4 = alloca %struct.utsname
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%6 = bitcast %struct.utsname* %4 to i8*
%7 = call i32 @uname(%struct.utsname* %4)
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %4, i64 0, i32 0
%9 = load i8*, i8** %8
%10 = getelementptr inbounds %struct.utsname, %struct.utsname* %4, i64 0, i32 1
%11 = load i8*, i8** %10
%12 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %11)
%13 = call i32 @strncpy(i8* %0, i8* %5, i32 %1)
ret void
}