xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isLittleEndian();
unsigned long little2bigul(unsigned long);
unsigned long little2hostul(unsigned long num) {
  if (isLittleEndian())
    return num;
  return little2bigul(num);
}


x86 assembly (clang, -O0):
<little2hostul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <isLittleEndian@plt>
cmp    $0x0,%rax
je     114a <little2hostul+0x2a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <little2hostul+0x37>
mov    -0x10(%rbp),%rdi
call   1040 <little2bigul@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<little2hostul>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <isLittleEndian@plt>
test   %rax,%rax
je     1135 <little2hostul+0x15>
mov    %rbx,%rax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <little2bigul@plt>

LLVM IR (-O0):
define i64 @little2hostul(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = call i64 (...) @isLittleEndian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i64, i64* %3
store i64 %7, i64* %2
br label %11
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i64 @little2bigul(i64 %9)
store i64 %10, i64* %2
br label %11
11: ; preds = %8, %6
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
define i64 @little2hostul(i64 %0) {
%2 = tail call i64 (...) @isLittleEndian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i64 @little2bigul(i64 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i64 [ %5, %4 ], [ %0, %1 ]
ret i64 %7
}
void av_write_uncoded_frame() {}


x86 assembly (clang, -O0):
<av_write_uncoded_frame>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_write_uncoded_frame>:
ret

LLVM IR (-O0):
define void @av_write_uncoded_frame() {
ret void
}

LLVM IR (-O2):
define void @av_write_uncoded_frame() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ api_end();
int /*<<< orphan*/ api_putchar(char);
void HariMain(void) {
  char a[100];
  a[10] = 'A';
  api_putchar(a[10]);
  a[102] = 'B';
  api_putchar(a[102]);
  a[123] = 'C';
  api_putchar(a[123]);
  api_end();
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movb   $0x41,-0x66(%rbp)
movsbl -0x66(%rbp),%edi
call   1040 <api_putchar@plt>
movb   $0x42,-0xa(%rbp)
movsbl -0xa(%rbp),%edi
call   1040 <api_putchar@plt>
movb   $0x43,0xb(%rbp)
movsbl 0xb(%rbp),%edi
call   1040 <api_putchar@plt>
mov    $0x0,%al
call   1030 <api_end@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HariMain>:
push   %rax
mov    $0x41,%edi
call   1040 <api_putchar@plt>
xor    %edi,%edi
call   1040 <api_putchar@plt>
xor    %edi,%edi
call   1040 <api_putchar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <api_end@plt>

LLVM IR (-O0):
define void @HariMain() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 10
store i8 65, i8* %2
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 10
%4 = load i8, i8* %3
%5 = call i32 @api_putchar(i8 signext %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 102
store i8 66, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 102
%8 = load i8, i8* %7
%9 = call i32 @api_putchar(i8 signext %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 123
store i8 67, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 123
%12 = load i8, i8* %11
%13 = call i32 @api_putchar(i8 signext %12)
%14 = call i32 (...) @api_end()
ret void
}

LLVM IR (-O2):
define void @HariMain() {
%1 = tail call i32 @api_putchar(i8 signext 65)
%2 = tail call i32 @api_putchar(i8 signext poison)
%3 = tail call i32 @api_putchar(i8 signext poison)
%4 = tail call i32 (...) @api_end()
ret void
}
void LPCIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000100))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<LPCIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x100(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x100(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCIntEnable>:
or     %rsi,0x100(%rdi)
ret

LLVM IR (-O0):
define void @LPCIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 256
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @LPCIntEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 256
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DecodeAAs_xxxxdddxssxxxrrr();
int /*<<< orphan*/ DoBinOpAddX(int /*<<< orphan*/);
void DoCodeAddXm(void) { DoBinOpAddX(DecodeAAs_xxxxdddxssxxxrrr()); }


x86 assembly (clang, -O0):
<DoCodeAddXm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <DecodeAAs_xxxxdddxssxxxrrr@plt>
mov    %eax,%edi
call   1030 <DoBinOpAddX@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoCodeAddXm>:
push   %rax
xor    %eax,%eax
call   1040 <DecodeAAs_xxxxdddxssxxxrrr@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <DoBinOpAddX@plt>

LLVM IR (-O0):
define void @DoCodeAddXm() {
%1 = call i32 (...) @DecodeAAs_xxxxdddxssxxxrrr()
%2 = call i32 @DoBinOpAddX(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DoCodeAddXm() {
%1 = tail call i32 (...) @DecodeAAs_xxxxdddxssxxxrrr()
%2 = tail call i32 @DoBinOpAddX(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ be64_to_cpu(int /*<<< orphan*/ const);
uint64_t be64_to_cpup(const uint64_t *p) { return be64_to_cpu(*p); }


x86 assembly (clang, -O0):
<be64_to_cpup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <be64_to_cpu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be64_to_cpup>:
mov    (%rdi),%edi
jmp    1030 <be64_to_cpu@plt>

LLVM IR (-O0):
define i32 @be64_to_cpup(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @be64_to_cpu(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @be64_to_cpup(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @be64_to_cpu(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
int32_t OS_waitpid(int32_t childpid, int32_t *statusp, int32_t flags) {
  return (waitpid(childpid, statusp, flags));
}


x86 assembly (clang, -O0):
<OS_waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <waitpid@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OS_waitpid>:
jmp    1030 <waitpid@plt>

LLVM IR (-O0):
define i32 @OS_waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 @waitpid(i32 %7, i32* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @OS_waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @waitpid(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ md5_hash_ascii(char *, char *, int);
void NAS_Hash_Ascii(char *in, char *out, int o_size, int algm) {
  if (algm == 1)
    md5_hash_ascii(in, out, o_size);
}


x86 assembly (clang, -O0):
<NAS_Hash_Ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1140 <NAS_Hash_Ascii+0x30>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <md5_hash_ascii@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NAS_Hash_Ascii>:
cmp    $0x1,%ecx
jne    111a <NAS_Hash_Ascii+0xa>
jmp    1030 <md5_hash_ascii@plt>
ret

LLVM IR (-O0):
define void @NAS_Hash_Ascii(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = call i32 @md5_hash_ascii(i8* %12, i8* %13, i32 %14)
br label %16
16: ; preds = %11, %4
ret void
}

LLVM IR (-O2):
define void @NAS_Hash_Ascii(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @md5_hash_ascii(i8* %0, i8* %1, i32 %2)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
unsigned char *xsalsa8poly1305_decrypt(unsigned char *, size_t *,
                                       unsigned char const *, size_t,
                                       unsigned char const *,
                                       unsigned char const *);
unsigned char *crypt_decrypt_xsalsa8poly1305(
    unsigned char *out, size_t *out_len, const unsigned char *in, size_t in_len,
    const unsigned char *nonce, const unsigned char *key) {
  return xsalsa8poly1305_decrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_decrypt_xsalsa8poly1305>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <xsalsa8poly1305_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_decrypt_xsalsa8poly1305>:
jmp    1030 <xsalsa8poly1305_decrypt@plt>

LLVM IR (-O0):
define i8* @crypt_decrypt_xsalsa8poly1305(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @xsalsa8poly1305_decrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_decrypt_xsalsa8poly1305(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @xsalsa8poly1305_decrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char const *, int);
char *blStrncat(char *out, const char *in, size_t len) {
  int lenOut, cpLen;
  lenOut = strlen(out);
  cpLen = len - lenOut;
  strncat(out, in, cpLen);
  return (out);
}


x86 assembly (clang, -O0):
<blStrncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1040 <strncat@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blStrncat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
sub    %eax,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <strncat@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @blStrncat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %7
%11 = load i64, i64* %6
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = sub i64 %11, %13
%15 = trunc i64 %14 to i32
store i32 %15, i32* %8
%16 = load i8*, i8** %4
%17 = load i8*, i8** %5
%18 = load i32, i32* %8
%19 = call i32 @strncat(i8* %16, i8* %17, i32 %18)
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
define i8* @blStrncat(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = trunc i64 %2 to i32
%6 = sub i32 %5, %4
%7 = tail call i32 @strncat(i8* %0, i8* %1, i32 %6)
ret i8* %0
}
void langInit() {}


x86 assembly (clang, -O0):
<langInit>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<langInit>:
ret

LLVM IR (-O0):
define void @langInit() {
ret void
}

LLVM IR (-O2):
define void @langInit() {
ret void
}
/* Variables and functions */
char *calloc(scalar_t__, int);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *getstringcopy1(char *string) {
  char *copy;
  copy = calloc(strlen(string) + 1, sizeof(char));
  strcpy(copy, string);
  return copy;
}


x86 assembly (clang, -O0):
<getstringcopy1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getstringcopy1>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @getstringcopy1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @calloc(i64 %6, i32 1)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @getstringcopy1(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @calloc(i64 %3, i32 1)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
void ff_hevc_put_hevc_uni_epel_v12_10_sse4() {}


x86 assembly (clang, -O0):
<ff_hevc_put_hevc_uni_epel_v12_10_sse4>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_hevc_put_hevc_uni_epel_v12_10_sse4>:
ret

LLVM IR (-O0):
define void @ff_hevc_put_hevc_uni_epel_v12_10_sse4() {
ret void
}

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v12_10_sse4() {
ret void
}
/* Type definitions */
struct passwd {
  int /*<<< orphan*/ pw_passwd;
};

/* Variables and functions */
struct passwd *getpwnam(char const *);
char *strdup(int /*<<< orphan*/);
char *get_admin_hash(const char *username) {
  char *admin_hash = NULL;
  if (username) {
    struct passwd *pw;
    if ((pw = getpwnam(username)) != NULL) {
      admin_hash = strdup(pw->pw_passwd);
    }
  }
  return admin_hash;
}


x86 assembly (clang, -O0):
<get_admin_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116a <get_admin_hash+0x4a>
mov    -0x8(%rbp),%rdi
call   1030 <getpwnam@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1165 <get_admin_hash+0x45>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
jmp    116a <get_admin_hash+0x4a>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_admin_hash>:
push   %rax
test   %rdi,%rdi
je     1138 <get_admin_hash+0x18>
call   1030 <getpwnam@plt>
test   %rax,%rax
je     1138 <get_admin_hash+0x18>
mov    (%rax),%edi
pop    %rax
jmp    1040 <strdup@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i8* @get_admin_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca %struct.passwd*
store i8* %0, i8** %2
store i8* null, i8** %3
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call %struct.passwd* @getpwnam(i8* %8)
store %struct.passwd* %9, %struct.passwd** %4
%10 = icmp ne %struct.passwd* %9, null
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load %struct.passwd*, %struct.passwd** %4
%13 = getelementptr inbounds %struct.passwd, %struct.passwd* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i8* @strdup(i32 %14)
store i8* %15, i8** %3
br label %16
16: ; preds = %11, %7
br label %17
17: ; preds = %16, %1
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i8* @get_admin_hash(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call %struct.passwd* @getpwnam(i8* %0)
%5 = icmp eq %struct.passwd* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = getelementptr inbounds %struct.passwd, %struct.passwd* %4, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i8* @strdup(i32 %8)
br label %10
10: ; preds = %3, %6, %1
%11 = phi i8* [ null, %1 ], [ %9, %6 ], [ null, %3 ]
ret i8* %11
}
/* Variables and functions */
int LOCK_EX;
int LOCK_NB;
int LOCK_UN;
int flock(int /*<<< orphan*/, int);
int main(void) { return flock(0, LOCK_EX | LOCK_UN | LOCK_NB); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
mov    0x2ea9(%rip),%rax
or     (%rax),%esi
mov    0x2e90(%rip),%rax
or     (%rax),%esi
xor    %edi,%edi
call   1030 <flock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9f(%rip),%rax
or     (%rax),%esi
xor    %edi,%edi
jmp    1030 <flock@plt>

LLVM IR (-O0):
@LOCK_EX = global i32 0
@LOCK_UN = global i32 0
@LOCK_NB = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @LOCK_EX
%3 = load i32, i32* @LOCK_UN
%4 = or i32 %2, %3
%5 = load i32, i32* @LOCK_NB
%6 = or i32 %4, %5
%7 = call i32 @flock(i32 0, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@LOCK_EX = global i32 0
@LOCK_UN = global i32 0
@LOCK_NB = global i32 0
define i32 @main() {
%1 = load i32, i32* @LOCK_EX
%2 = load i32, i32* @LOCK_UN
%3 = or i32 %2, %1
%4 = load i32, i32* @LOCK_NB
%5 = or i32 %3, %4
%6 = tail call i32 @flock(i32 0, i32 %5)
ret i32 %6
}
/* Variables and functions */
char *strchr(char const *, int);
const char *nexttoken(const char *p, int sep) {
  if (p)
    p = strchr(p, sep);
  if (p)
    p++;
  return (p);
}


x86 assembly (clang, -O0):
<nexttoken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <nexttoken+0x2a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <nexttoken+0x41>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nexttoken>:
test   %rdi,%rdi
je     1121 <nexttoken+0x11>
push   %rax
call   1030 <strchr@plt>
add    $0x8,%rsp
jmp    1123 <nexttoken+0x13>
xor    %eax,%eax
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rax,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @nexttoken(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i8* @strchr(i8* %8, i32 %9)
store i8* %10, i8** %3
br label %11
11: ; preds = %7, %2
%12 = load i8*, i8** %3
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %17
17: ; preds = %14, %11
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @nexttoken(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @strchr(i8* %0, i32 %1)
br label %6
6: ; preds = %4, %2
%7 = phi i8* [ %5, %4 ], [ null, %2 ]
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = select i1 %8, i8* null, i8* %9
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t ev3_speaker_set_volume(uint8_t vol) { return 0; }


x86 assembly (clang, -O0):
<ev3_speaker_set_volume>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ev3_speaker_set_volume>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ev3_speaker_set_volume(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @ev3_speaker_set_volume(i32 %0) {
ret i32 0
}
int gcd(int m, int n) {
  while (m != n) {
    if (m > n)
      return gcd(m - n, n);
    else
      return gcd(m, n - m);
  }
  return m;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1162 <gcd+0x52>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    114c <gcd+0x3c>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <gcd+0x58>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <gcd+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
cmp    %esi,%edi
jne    1107 <gcd+0x7>
mov    %edi,%eax
ret
mov    %esi,%eax
mov    %eax,%ecx
nopl   0x0(%rax,%rax,1)
sub    %edi,%ecx
jl     1120 <gcd+0x20>
mov    %ecx,%eax
cmp    %ecx,%edi
jne    1110 <gcd+0x10>
jmp    1104 <gcd+0x4>
nopl   0x0(%rax)
sub    %eax,%edi
cmp    %edi,%eax
jne    1109 <gcd+0x9>
jmp    1106 <gcd+0x6>

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
br label %6
6: ; preds = %2
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %26
10: ; preds = %6
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = sub nsw i32 %15, %16
%18 = load i32, i32* %5
%19 = call i32 @gcd(i32 %17, i32 %18)
store i32 %19, i32* %3
br label %28
20: ; preds = %10
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = sub nsw i32 %22, %23
%25 = call i32 @gcd(i32 %21, i32 %24)
store i32 %25, i32* %3
br label %28
26: ; preds = %6
%27 = load i32, i32* %4
store i32 %27, i32* %3
br label %28
28: ; preds = %26, %20, %14
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %16, label %4
4: ; preds = %2, %10
%5 = phi i32 [ %8, %10 ], [ %1, %2 ]
%6 = phi i32 [ %11, %10 ], [ %0, %2 ]
br label %7
7: ; preds = %4, %13
%8 = phi i32 [ %5, %4 ], [ %14, %13 ]
%9 = icmp slt i32 %8, %6
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = sub nsw i32 %6, %8
%12 = icmp eq i32 %11, %8
br i1 %12, label %16, label %4
13: ; preds = %7
%14 = sub nsw i32 %8, %6
%15 = icmp eq i32 %6, %14
br i1 %15, label %16, label %7
16: ; preds = %10, %13, %2
%17 = phi i32 [ %0, %2 ], [ %6, %13 ], [ %8, %10 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(int, size_t);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
int /*<<< orphan*/ stderr;
void *xcalloc(size_t s) {
  void *p;
  p = calloc(1, s);
  if (!p) {
    fprintf(stderr, "out of memory allocating %zd bytes.\n", s);
    abort();
  }
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1179 <xcalloc+0x49>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe93(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
call   1040 <calloc@plt>
test   %rax,%rax
je     1148 <xcalloc+0x18>
pop    %rbx
ret
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"out of memory allocating %zd bytes.\0A\00"
define i8* @xcalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"out of memory allocating %zd bytes.\0A\00"
define i8* @xcalloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int timer_milliseconds(unsigned int);
bool timer_elapsed_minutes(unsigned index, uint32_t minutes) {
  return ((timer_milliseconds(index) / (1000 * 60)) >= minutes);
}


x86 assembly (clang, -O0):
<timer_elapsed_minutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <timer_milliseconds@plt>
mov    $0xea60,%ecx
cltd
idiv   %ecx
cmp    -0x8(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_elapsed_minutes>:
push   %rbx
mov    %esi,%ebx
call   1030 <timer_milliseconds@plt>
cltq
imul   $0x45e7b273,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x2e,%rcx
add    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setge  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @timer_elapsed_minutes(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @timer_milliseconds(i32 %5)
%7 = sdiv i32 %6, 60000
%8 = load i32, i32* %4
%9 = icmp sge i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @timer_elapsed_minutes(i32 %0, i32 %1) {
%3 = tail call i32 @timer_milliseconds(i32 %0)
%4 = sdiv i32 %3, 60000
%5 = icmp sge i32 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ scrputs(char *);
void csrrestore(void) { scrputs("\033[u"); }


x86 assembly (clang, -O0):
<csrrestore>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <scrputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<csrrestore>:
lea    0xee9(%rip),%rdi
jmp    1030 <scrputs@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[u\00"
define void @csrrestore() {
%1 = call i32 @scrputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[u\00"
define void @csrrestore() {
%1 = tail call i32 @scrputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double core_shell_fq(double, double, double, double, double, double);
double core_shell_kernel(double q, double radius, double thickness,
                         double core_sld, double shell_sld,
                         double solvent_sld) {
  const double fq =
      core_shell_fq(q, radius, thickness, core_sld, shell_sld, solvent_sld);
  return 1.0e-4 * fq * fq;
}


x86 assembly (clang, -O0):
<core_shell_kernel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
call   1030 <core_shell_fq@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xe9a(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<core_shell_kernel>:
push   %rax
call   1030 <core_shell_fq@plt>
movsd  0xee2(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @core_shell_kernel(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%14 = load double, double* %7
%15 = load double, double* %8
%16 = load double, double* %9
%17 = load double, double* %10
%18 = load double, double* %11
%19 = load double, double* %12
%20 = call double @core_shell_fq(double %14, double %15, double %16, double %17, double %18, double %19)
store double %20, double* %13
%21 = load double, double* %13
%22 = fmul double 1.000000e-04, %21
%23 = load double, double* %13
%24 = fmul double %22, %23
ret double %24
}

LLVM IR (-O2):
define double @core_shell_kernel(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @core_shell_fq(double %0, double %1, double %2, double %3, double %4, double %5)
%8 = fmul double %7, 1.000000e-04
%9 = fmul double %7, %8
ret double %9
}
void *test_anti_range_58(int n) {
  extern void *alloc_anti_range_58(int) __attribute__((alloc_size(1)));
  if (1 <= n && n <= 0x7fffffff - 1)
    n = 1 - 1;
  return alloc_anti_range_58(n);
}


x86 assembly (clang, -O0):
<test_anti_range_58>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
cmp    -0x4(%rbp),%eax
jg     113d <test_anti_range_58+0x2d>
cmpl   $0x7ffffffe,-0x4(%rbp)
jg     113d <test_anti_range_58+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_58@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_58>:
lea    -0x1(%rdi),%eax
xor    %ecx,%ecx
cmp    $0x7ffffffe,%eax
cmovb  %ecx,%edi
jmp    1030 <alloc_anti_range_58@plt>

LLVM IR (-O0):
define i8* @test_anti_range_58(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 1, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 2147483646
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 0, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_58(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_58(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2147483646
%4 = select i1 %3, i32 0, i32 %0
%5 = tail call i8* @alloc_anti_range_58(i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ _fw_echo(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  char *foo = " world\n";
  printf("Hello");
  _fw_echo(foo);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <_fw_echo@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
call   1040 <_fw_echo@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c" world\0A\00"
@.str.1 = [6 x i8] c"Hello\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = load i8*, i8** %6
%9 = call i32 @_fw_echo(i8* %8)
ret i32 1
}

LLVM IR (-O2):
@.str = [8 x i8] c" world\0A\00"
@.str.1 = [6 x i8] c"Hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @_fw_echo(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
void XkbSelectEvents() {}


x86 assembly (clang, -O0):
<XkbSelectEvents>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XkbSelectEvents>:
ret

LLVM IR (-O0):
define void @XkbSelectEvents() {
ret void
}

LLVM IR (-O2):
define void @XkbSelectEvents() {
ret void
}
void H444ToARGB() {}


x86 assembly (clang, -O0):
<H444ToARGB>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<H444ToARGB>:
ret

LLVM IR (-O0):
define void @H444ToARGB() {
ret void
}

LLVM IR (-O2):
define void @H444ToARGB() {
ret void
}
int main(void) {
  int counter1;
  int counter2;
  {
    counter1 = 0;
  LOOPSTART1:
    if (counter1 < 5) {
      counter2 = 0;
    LOOPSTART2:
      if (counter2 < 8) {
        counter2 = counter2 + 1;
        goto LOOPSTART2;
      } else {
      }
      counter1 = counter1 + 1;
      goto LOOPSTART1;
    } else {
    }
    if (counter1 == 4) {
      goto ERROR;
    } else {
      goto END;
    }
  ERROR:
    goto ERROR;
  END:
    return (0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    114e <main+0x4e>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    113b <main+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <main+0x23>
jmp    1140 <main+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
jmp    1153 <main+0x53>
cmpl   $0x4,-0x8(%rbp)
jne    1162 <main+0x62>
jmp    1167 <main+0x67>
jmp    116c <main+0x6c>
jmp    1167 <main+0x67>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %18
7: ; preds = %4
store i32 0, i32* %3
br label %8
8: ; preds = %11, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %8
14: ; preds = %8
br label %15
15: ; preds = %14
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %4
18: ; preds = %4
br label %19
19: ; preds = %18
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 4
br i1 %21, label %22, label %23
22: ; preds = %19
br label %24
23: ; preds = %19
br label %25
24: ; preds = %24, %22
br label %24
25: ; preds = %23
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void tray_update(struct tray *tray) {}


x86 assembly (clang, -O0):
<tray_update>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tray_update>:
ret

LLVM IR (-O0):
%struct.tray = type opaque
define void @tray_update(%struct.tray* %0) {
%2 = alloca %struct.tray*
store %struct.tray* %0, %struct.tray** %2
ret void
}

LLVM IR (-O2):
%struct.tray = type opaque
define void @tray_update(%struct.tray* nocapture %0) {
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exec_changed_keys(struct __test_metadata *);
void wrapper_exec_changed_keys(struct __test_metadata *_metadata,
                               struct __fixture_variant_metadata *variant) {
  exec_changed_keys(_metadata);
}


x86 assembly (clang, -O0):
<wrapper_exec_changed_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <exec_changed_keys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapper_exec_changed_keys>:
jmp    1030 <exec_changed_keys@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_exec_changed_keys(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @exec_changed_keys(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_exec_changed_keys(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @exec_changed_keys(%struct.__test_metadata* %0)
ret void
}
void ve_rpc_data_put(struct ve_struct *ve) {}


x86 assembly (clang, -O0):
<ve_rpc_data_put>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ve_rpc_data_put>:
ret

LLVM IR (-O0):
%struct.ve_struct = type opaque
define void @ve_rpc_data_put(%struct.ve_struct* %0) {
%2 = alloca %struct.ve_struct*
store %struct.ve_struct* %0, %struct.ve_struct** %2
ret void
}

LLVM IR (-O2):
%struct.ve_struct = type opaque
define void @ve_rpc_data_put(%struct.ve_struct* nocapture %0) {
ret void
}
void tsp_free_grid(int x, short ***grid) {
  int i;
  for (i = 0; i < x; i++) {
    free(grid[0][i]);
  }
  free(grid[0]);
}


x86 assembly (clang, -O0):
<tsp_free_grid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <tsp_free_grid+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <tsp_free_grid+0x16>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsp_free_grid>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1145 <tsp_free_grid+0x35>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14),%rax
mov    (%rax,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <tsp_free_grid+0x20>
mov    (%r14),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @tsp_free_grid(i32 %0, i16*** %1) {
%3 = alloca i32
%4 = alloca i16***
%5 = alloca i32
store i32 %0, i32* %3
store i16*** %1, i16**** %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i16***, i16**** %4
%12 = getelementptr inbounds i16**, i16*** %11, i64 0
%13 = load i16**, i16*** %12
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i16*, i16** %13, i64 %15
%17 = load i16*, i16** %16
%18 = bitcast i16* %17 to i8*
br label %19
19: ; preds = %10
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
%23 = load i16***, i16**** %4
%24 = getelementptr inbounds i16**, i16*** %23, i64 0
%25 = load i16**, i16*** %24
%26 = bitcast i16** %25 to i8*
ret void
}

LLVM IR (-O2):
define void @tsp_free_grid(i32 %0, i16*** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = load i16**, i16*** %1
%9 = getelementptr inbounds i16*, i16** %8, i64 %7
%10 = bitcast i16** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = bitcast i16*** %1 to i8**
%16 = load i8*, i8** %15
tail call void @free(i8* %16)
ret void
}
void UART9BitAddrSet(unsigned long ulBase, unsigned char ucAddr,
                     unsigned char ucMask) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x000000A4))) = ucAddr << 0;
  (*((volatile unsigned long *)(ulBase + 0x000000A8))) = ucMask << 0;
}


x86 assembly (clang, -O0):
<UART9BitAddrSet>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
shl    $0x0,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xa4(%rax)
movzbl -0xa(%rbp),%eax
shl    $0x0,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xa8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART9BitAddrSet>:
mov    %esi,%eax
mov    %rax,0xa4(%rdi)
mov    %edx,%eax
mov    %rax,0xa8(%rdi)
ret

LLVM IR (-O0):
define void @UART9BitAddrSet(i64 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i64
%5 = alloca i8
%6 = alloca i8
store i64 %0, i64* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 0
%10 = sext i32 %9 to i64
%11 = load i64, i64* %4
%12 = add i64 %11, 164
%13 = inttoptr i64 %12 to i64*
store volatile i64 %10, i64* %13
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = shl i32 %15, 0
%17 = sext i32 %16 to i64
%18 = load i64, i64* %4
%19 = add i64 %18, 168
%20 = inttoptr i64 %19 to i64*
store volatile i64 %17, i64* %20
ret void
}

LLVM IR (-O2):
define void @UART9BitAddrSet(i64 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %1 to i64
%5 = add i64 %0, 164
%6 = inttoptr i64 %5 to i64*
store volatile i64 %4, i64* %6
%7 = zext i8 %2 to i64
%8 = add i64 %0, 168
%9 = inttoptr i64 %8 to i64*
store volatile i64 %7, i64* %9
ret void
}
void resetLedOffEffect(short ledNumber, short *data) {}


x86 assembly (clang, -O0):
<resetLedOffEffect>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetLedOffEffect>:
ret

LLVM IR (-O0):
define void @resetLedOffEffect(i16 signext %0, i16* %1) {
%3 = alloca i16
%4 = alloca i16*
store i16 %0, i16* %3
store i16* %1, i16** %4
ret void
}

LLVM IR (-O2):
define void @resetLedOffEffect(i16 signext %0, i16* nocapture %1) {
ret void
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
int serializer_get_file_size(const char *filename) {
  struct stat st;
  stat(filename, &st);
  return st.st_size;
}


x86 assembly (clang, -O0):
<serializer_get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serializer_get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @serializer_get_file_size(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @serializer_get_file_size(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ gprintef(char *);
int map_global(const char *name, int section, int *ret_addr[]) {
  gprintef("GETSECT: DAE Access not available\n");
  return 1;
}


x86 assembly (clang, -O0):
<map_global>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <gprintef@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_global>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <gprintef@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"GETSECT: DAE Access not available\0A\00"
define i32 @map_global(i8* %0, i32 %1, i32** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32** %2, i32*** %6
%7 = call i32 @gprintef(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [35 x i8] c"GETSECT: DAE Access not available\0A\00"
define i32 @map_global(i8* nocapture readnone %0, i32 %1, i32** nocapture readnone %2) {
%4 = tail call i32 @gprintef(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 1
}