xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_cleanse(void *, size_t);
int /*<<< orphan*/ munmap(void *, size_t);
void mfree(void *addr, size_t size) {
  if (addr) {
    OPENSSL_cleanse(addr, size);
    munmap(addr, size);
  }
}


x86 assembly (clang, -O0):
<mfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1155 <mfree+0x35>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <OPENSSL_cleanse@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <munmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mfree>:
test   %rdi,%rdi
je     1146 <mfree+0x26>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <OPENSSL_cleanse@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <munmap@plt>
ret

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

LLVM IR (-O2):
define void @mfree(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @OPENSSL_cleanse(i8* %0, i64 %1)
%6 = tail call i32 @munmap(i8* %0, i64 %1)
br label %7
7: ; preds = %4, %2
ret void
}
void bmp280_start_ut(void) {}


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

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

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

LLVM IR (-O2):
define void @bmp280_start_ut() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fputc(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void bde_fputs(char *str, FILE *f) {
  if (!str) {
    fprintf(stderr, "Error in bde_fputs(): string pointer is NULL\n");
    return;
  }
  fputc(0, f);
  fputs(str, f);
  fputc(0, f);
}


x86 assembly (clang, -O0):
<bde_fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1165 <bde_fputs+0x35>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1188 <bde_fputs+0x58>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1040 <fputc@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1040 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bde_fputs>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1162 <bde_fputs+0x32>
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <fputc@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fputs@plt>
xor    %edi,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fputc@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe8e(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Error in bde_fputs(): string pointer is NULL\0A\00"
define void @bde_fputs(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 %10, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %18
10: ; preds = %2
%11 = load i32*, i32** %4
%12 = call i32 @fputc(i32 0, i32* %11)
%13 = load i8*, i8** %3
%14 = load i32*, i32** %4
%15 = call i32 @fputs(i8* %13, i32* %14)
%16 = load i32*, i32** %4
%17 = call i32 @fputc(i32 0, i32* %16)
br label %18
18: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Error in bde_fputs(): string pointer is NULL\0A\00"
define void @bde_fputs(i8* %0, i32* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %2
%8 = tail call i32 @fputc(i32 0, i32* %1)
%9 = tail call i32 @fputs(i8* %0, i32* %1)
%10 = tail call i32 @fputc(i32 0, i32* %1)
br label %11
11: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
system() { error("The function \"system\" is called"); }


x86 assembly (clang, -O0):
<system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"The function \22system\22 is called\00"
define i32 @system() {
%1 = alloca i32
%2 = call i32 @error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [32 x i8] c"The function \22system\22 is called\00"
define i32 @system() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int f2(int x) { return (x != 0) ? 0U : x; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111b <f2+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <f2+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 0, %5 ], [ %7, %6 ]
ret i32 %9
}

LLVM IR (-O2):
define i32 @f2(i32 %0) {
ret i32 0
}
int pbl_VarBufSize(unsigned char *buffer) {
  int c = 0xff & *buffer;
  if (!(c & 0x80)) {
    return (1);
  }
  if (!(c & 0x40)) {
    return (2);
  }
  if (!(c & 0x20)) {
    return (3);
  }
  if (!(c & 0x10)) {
    return (4);
  }
  return (5);
}


x86 assembly (clang, -O0):
<pbl_VarBufSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    1134 <pbl_VarBufSize+0x34>
movl   $0x1,-0x4(%rbp)
jmp    118c <pbl_VarBufSize+0x8c>
mov    -0x14(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
jne    114f <pbl_VarBufSize+0x4f>
movl   $0x2,-0x4(%rbp)
jmp    118c <pbl_VarBufSize+0x8c>
mov    -0x14(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    116a <pbl_VarBufSize+0x6a>
movl   $0x3,-0x4(%rbp)
jmp    118c <pbl_VarBufSize+0x8c>
mov    -0x14(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
jne    1185 <pbl_VarBufSize+0x85>
movl   $0x4,-0x4(%rbp)
jmp    118c <pbl_VarBufSize+0x8c>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbl_VarBufSize>:
movzbl (%rdi),%ecx
mov    $0x1,%eax
test   $0x80,%cl
je     112f <pbl_VarBufSize+0x2f>
mov    $0x2,%eax
test   $0x40,%cl
je     112f <pbl_VarBufSize+0x2f>
mov    $0x3,%eax
test   $0x20,%cl
je     112f <pbl_VarBufSize+0x2f>
and    $0x10,%ecx
cmp    $0x1,%ecx
mov    $0x5,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @pbl_VarBufSize(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 255, %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = and i32 %9, 128
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %1
store i32 1, i32* %2
br label %29
13: ; preds = %1
%14 = load i32, i32* %4
%15 = and i32 %14, 64
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13
store i32 2, i32* %2
br label %29
18: ; preds = %13
%19 = load i32, i32* %4
%20 = and i32 %19, 32
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %18
store i32 3, i32* %2
br label %29
23: ; preds = %18
%24 = load i32, i32* %4
%25 = and i32 %24, 16
%26 = icmp ne i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %23
store i32 4, i32* %2
br label %29
28: ; preds = %23
store i32 5, i32* %2
br label %29
29: ; preds = %28, %27, %22, %17, %12
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @pbl_VarBufSize(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = and i32 %3, 128
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = and i32 %3, 64
%8 = icmp eq i32 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = and i32 %3, 32
%11 = icmp eq i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %9
%13 = and i32 %3, 16
%14 = icmp eq i32 %13, 0
%15 = select i1 %14, i32 4, i32 5
br label %16
16: ; preds = %12, %9, %6, %1
%17 = phi i32 [ 1, %1 ], [ 2, %6 ], [ 3, %9 ], [ %15, %12 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void print_svar(const char *name, const char *val) {
  if (name && val)
    printf("export %s=\"%s\"\n", name, val);
}


x86 assembly (clang, -O0):
<print_svar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114a <print_svar+0x3a>
cmpq   $0x0,-0x10(%rbp)
je     114a <print_svar+0x3a>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_svar>:
test   %rdi,%rdi
je     112c <print_svar+0x1c>
mov    %rsi,%rdx
test   %rsi,%rsi
je     112c <print_svar+0x1c>
mov    %rdi,%rsi
lea    0xed9(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [16 x i8] c"export %s=\22%s\22\0A\00"
define void @print_svar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
br label %14
14: ; preds = %10, %7, %2
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"export %s=\22%s\22\0A\00"
define void @print_svar(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %8
8: ; preds = %6, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int height;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_height(void *_p, int _v) {
  ((XWindowAttributes *)_p)->height = (int)_v;
}


x86 assembly (clang, -O0):
<set_XWindowAttributes_height>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XWindowAttributes_height>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XWindowAttributes_height(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XWindowAttributes_height(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
unsigned int w5100_readSn_byte(unsigned int, int);
unsigned w5100_readSnTX_FSR(unsigned sock) {
  unsigned res = w5100_readSn_byte(sock, 0x0020);
  res = (res << 8) + w5100_readSn_byte(sock, 0x0020 + 1);
  return res;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x21,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x20,%esi
call   1030 <w5100_readSn_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %ebx,%edi
mov    $0x21,%esi
call   1030 <w5100_readSn_byte@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @w5100_readSnTX_FSR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @w5100_readSn_byte(i32 %4, i32 32)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = shl i32 %6, 8
%8 = load i32, i32* %2
%9 = call i32 @w5100_readSn_byte(i32 %8, i32 33)
%10 = add i32 %7, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @w5100_readSnTX_FSR(i32 %0) {
%2 = tail call i32 @w5100_readSn_byte(i32 %0, i32 32)
%3 = shl i32 %2, 8
%4 = tail call i32 @w5100_readSn_byte(i32 %0, i32 33)
%5 = add i32 %3, %4
ret i32 %5
}
int avrasm_hll_post_setup(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @avrasm_hll_post_setup() {
ret i32 0
}

LLVM IR (-O2):
define i32 @avrasm_hll_post_setup() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strbprk(char *, char *);
void uninivar_strbprk(void) {
  char *cs;
  char *ct;
  (void)strbprk(cs, ct);
}


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

x86 assembly (clang, -O2):
<uninivar_strbprk>:
jmp    1030 <strbprk@plt>

LLVM IR (-O0):
define void @uninivar_strbprk() {
%1 = alloca i8*
%2 = alloca i8*
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strbprk(i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
define void @uninivar_strbprk() {
%1 = tail call i32 @strbprk(i8* undef, i8* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *);
void Jump_Ret(void) {
  Inst_Printf("jmp", "%%o0");
  Inst_Printf("nop", "");
}


x86 assembly (clang, -O0):
<Jump_Ret>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1030 <Inst_Printf@plt>
lea    0xedb(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <Inst_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Jump_Ret>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee5(%rip),%rsi
call   1030 <Inst_Printf@plt>
lea    0xede(%rip),%rdi
lea    0xed6(%rip),%rsi
pop    %rax
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"jmp\00"
@.str.1 = [5 x i8] c"%%o0\00"
@.str.2 = [4 x i8] c"nop\00"
@.str.3 = [1 x i8] zeroinitializer
define void @Jump_Ret() {
%1 = call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"jmp\00"
@.str.1 = [5 x i8] c"%%o0\00"
@.str.2 = [4 x i8] c"nop\00"
@.str.3 = [1 x i8] zeroinitializer
define void @Jump_Ret() {
%1 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int abs(int x) {
  if (x < 0)
    return x * -1;
  else
    return x;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <abs+0x1d>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1123 <abs+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, -1
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int list_get_length(void *list) {
  void **l = list;
  int n = 0;
  if (!list)
    return 0;
  while (*(l++))
    n++;
  return n;
}


x86 assembly (clang, -O0):
<list_get_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112e <list_get_length+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1160 <list_get_length+0x60>
jmp    1133 <list_get_length+0x33>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
cmpq   $0x0,(%rax)
je     115a <list_get_length+0x5a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1133 <list_get_length+0x33>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_get_length>:
xor    %eax,%eax
test   %rdi,%rdi
je     111c <list_get_length+0x1c>
cmpq   $0x0,(%rdi)
je     111c <list_get_length+0x1c>
xor    %eax,%eax
nop
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <list_get_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @list_get_length(i8* %0) {
%2 = bitcast i8* %0 to i8**
%3 = icmp eq i8* %0, null
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %14, label %7
7: ; preds = %4, %7
%8 = phi i32 [ %11, %7 ], [ 0, %4 ]
%9 = phi i8** [ %10, %7 ], [ %2, %4 ]
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = add nuw nsw i32 %8, 1
%12 = load i8*, i8** %10
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %7
14: ; preds = %7, %4, %1
%15 = phi i32 [ 0, %1 ], [ 0, %4 ], [ %11, %7 ]
ret i32 %15
}
void *_dlopen(const char *str, int x) { return (void *)0; }


x86 assembly (clang, -O0):
<_dlopen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @_dlopen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_dlopen(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Variables and functions */
scalar_t__ test_2files_dir();
int test_empty_dir();
int tests_dir_list(void) {
  int failures;
  failures = test_empty_dir();
  failures += test_2files_dir();
  return failures;
}


x86 assembly (clang, -O0):
<tests_dir_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <test_empty_dir@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_2files_dir@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tests_dir_list>:
push   %rbx
xor    %eax,%eax
call   1030 <test_empty_dir@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <test_2files_dir@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tests_dir_list() {
%1 = alloca i32
%2 = call i32 (...) @test_empty_dir()
store i32 %2, i32* %1
%3 = call i64 (...) @test_2files_dir()
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @tests_dir_list() {
%1 = tail call i32 (...) @test_empty_dir()
%2 = tail call i64 (...) @test_2files_dir()
%3 = trunc i64 %2 to i32
%4 = add i32 %1, %3
ret i32 %4
}
unsigned int get_temporal_sector_addr(int size) {
  return 0x081e0000;
  (void)size;
}


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

x86 assembly (clang, -O2):
<get_temporal_sector_addr>:
mov    $0x81e0000,%eax
ret

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

LLVM IR (-O2):
define i32 @get_temporal_sector_addr(i32 %0) {
ret i32 136183808
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
uint8_t qsub8(uint8_t i, uint8_t j) {
  int16_t t = i - j;
  if (t < 0)
    t = 0;
  return t;
}


x86 assembly (clang, -O0):
<qsub8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    112b <qsub8+0x2b>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsub8>:
xor    %eax,%eax
sub    %rsi,%rdi
cmovns %rdi,%rax
ret

LLVM IR (-O0):
define i64 @qsub8(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = sub nsw i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i64 0, i64* %5
br label %12
12: ; preds = %11, %2
%13 = load i64, i64* %5
ret i64 %13
}

LLVM IR (-O2):
define i64 @qsub8(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = icmp sgt i64 %3, 0
%5 = select i1 %4, i64 %3, i64 0
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M580_f(char *s) {
  debug("M580_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M580_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M580_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M580_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M580_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M580_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M580_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ d;
typedef int /*<<< orphan*/ c;
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a;
  float b;
  double c;
  char d;
  printf("Size of int: %ul bytes\n", sizeof(a));
  printf("Size of float: %d bytes\n", sizeof(b));
  printf("Size of double: %d bytes\n", sizeof(c));
  printf("Size of char: %d byte\n", sizeof(d));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Size of int: %ul bytes\0A\00"
@.str.1 = [25 x i8] c"Size of float: %d bytes\0A\00"
@.str.2 = [26 x i8] c"Size of double: %d bytes\0A\00"
@.str.3 = [23 x i8] c"Size of char: %d byte\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca double
%5 = alloca i8
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 4)
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 8)
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Size of int: %ul bytes\0A\00"
@.str.1 = [25 x i8] c"Size of float: %d bytes\0A\00"
@.str.2 = [26 x i8] c"Size of double: %d bytes\0A\00"
@.str.3 = [23 x i8] c"Size of char: %d byte\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 0
}
void tophat_drive_follow_left() {}


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

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

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

LLVM IR (-O2):
define void @tophat_drive_follow_left() {
ret void
}
/* Variables and functions */
int strtol(char const *, char **, int);
int atoi(const char *s) { return (strtol(s, (char **)0, 10)); }


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strtol(i8* %3, i8** null, i32 10)
ret i32 %4
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = tail call i32 @strtol(i8* nocapture %0, i8** null, i32 10)
ret i32 %2
}
void foo232() {}


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

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

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

LLVM IR (-O2):
define void @foo232() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void init_fun(void) { printf("I am in init_fun\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"I am in init_fun\0A\00"
define void @init_fun() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"I am in init_fun\00"
define void @init_fun() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Bar();
unsigned long getSP();
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  unsigned long sp;
  sp = getSP();
  printf("Application stack pointer = 0x%lx\n", sp);
  Bar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getSP@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <Bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <getSP@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <Bar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Application stack pointer = 0x%lx\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 (...) @getSP()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = call i32 (...) @Bar()
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Application stack pointer = 0x%lx\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getSP()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %1)
%3 = tail call i32 (...) @Bar()
ret i32 0
}
/* Variables and functions */
unsigned int f28(unsigned int);
unsigned int f29(unsigned int a) { return f28(f28(a)); }


x86 assembly (clang, -O0):
<f29>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f28@plt>
mov    %eax,%edi
call   1030 <f28@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f29>:
push   %rax
call   1030 <f28@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f28@plt>

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

LLVM IR (-O2):
define i32 @f29(i32 %0) {
%2 = tail call i32 @f28(i32 %0)
%3 = tail call i32 @f28(i32 %2)
ret i32 %3
}
void UI_get_ex_new_index(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_get_ex_new_index() {
ret void
}
int test_imm_3Dint16_reg(short val) {
  return ((val) & (-0x3D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Dint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffc3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Dint16_reg>:
test   $0xffc3,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Dint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -61
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_3Dint16_reg(i16 signext %0) {
%2 = and i16 %0, -61
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct variable {
  int dummy;
};
struct lexer {
  int dummy;
};
struct dictionary {
  int dummy;
};

/* Variables and functions */
int parse_variables(struct lexer *, struct dictionary const *,
                    struct variable ***, size_t *, int);
bool parse_variables_const(struct lexer *l, const struct dictionary *d,
                           const struct variable ***v, size_t *s, int opts) {
  return parse_variables(l, d, (struct variable ***)v, s, opts);
}


x86 assembly (clang, -O0):
<parse_variables_const>:
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    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <parse_variables@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_variables_const>:
jmp    1030 <parse_variables@plt>

LLVM IR (-O0):
%struct.lexer = type { i32 }
%struct.dictionary = type { i32 }
%struct.variable = type { i32 }
define i32 @parse_variables_const(%struct.lexer* %0, %struct.dictionary* %1, %struct.variable*** %2, i64* %3, i32 %4) {
%6 = alloca %struct.lexer*
%7 = alloca %struct.dictionary*
%8 = alloca %struct.variable***
%9 = alloca i64*
%10 = alloca i32
store %struct.lexer* %0, %struct.lexer** %6
store %struct.dictionary* %1, %struct.dictionary** %7
store %struct.variable*** %2, %struct.variable**** %8
store i64* %3, i64** %9
store i32 %4, i32* %10
%11 = load %struct.lexer*, %struct.lexer** %6
%12 = load %struct.dictionary*, %struct.dictionary** %7
%13 = load %struct.variable***, %struct.variable**** %8
%14 = load i64*, i64** %9
%15 = load i32, i32* %10
%16 = call i32 @parse_variables(%struct.lexer* %11, %struct.dictionary* %12, %struct.variable*** %13, i64* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.lexer = type { i32 }
%struct.dictionary = type { i32 }
%struct.variable = type { i32 }
define i32 @parse_variables_const(%struct.lexer* %0, %struct.dictionary* %1, %struct.variable*** %2, i64* %3, i32 %4) {
%6 = tail call i32 @parse_variables(%struct.lexer* %0, %struct.dictionary* %1, %struct.variable*** %2, i64* %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void usage(int exit_status) {
  puts("EasyLogo 1.0 (C) 2000 by Paolo Scaffardi\n"
       "\n"
       "Syntax:	easylogo [options] inputfile [outputvar [outputfile]]\n"
       "\n"
       "Options:\n"
       "  -r     Output RGB888 instead of YUYV\n"
       "  -s     Output RGB565 instead of YUYV\n"
       "  -g     Compress with gzip\n"
       "  -l     Compress with lzma\n"
       "  -b     Preallocate space in bss for decompressing image\n"
       "  -h     Help output\n"
       "\n"
       "Where: 'inputfile'   is the TGA image to load\n"
       "       'outputvar'   is the variable name to create\n"
       "       'outputfile'  is the output header file (default is "
       "'inputfile.h')");
  exit(exit_status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [500 x i8] c"EasyLogo 1.0 (C) 2000 by Paolo Scaffardi\0A\0ASyntax:\09easylogo [options] inputfile [outputvar [outputfile]]\0A\0AOptions:\0A -r Output RGB888 instead of YUYV\0A -s Output RGB565 instead of YUYV\0A -g Compress with gzip\0A -l Compress with lzma\0A -b Preallocate space in bss for decompressing image\0A -h Help output\0A\0AWhere: 'inputfile' is the TGA image to load\0A 'outputvar' is the variable name to create\0A 'outputfile' is the output header file (default is 'inputfile.h')\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([500 x i8], [500 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@.str = [500 x i8] c"EasyLogo 1.0 (C) 2000 by Paolo Scaffardi\0A\0ASyntax:\09easylogo [options] inputfile [outputvar [outputfile]]\0A\0AOptions:\0A -r Output RGB888 instead of YUYV\0A -s Output RGB565 instead of YUYV\0A -g Compress with gzip\0A -l Compress with lzma\0A -b Preallocate space in bss for decompressing image\0A -h Help output\0A\0AWhere: 'inputfile' is the TGA image to load\0A 'outputvar' is the variable name to create\0A 'outputfile' is the output header file (default is 'inputfile.h')\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([500 x i8], [500 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
void RTStrPurgeEncoding(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrPurgeEncoding() {
ret void
}
adrreg0adr1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (p0[10000000]) = (*((short *)11111111)); }


x86 assembly (clang, -O0):
<adrreg0adr1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0xa98ac7,%eax
mov    (%rax),%cx
mov    -0x18(%rbp),%rax
mov    %cx,0x1312d00(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0adr1_set>:
movzwl 0xa98ac7,%eax
mov    %ax,0x1312d00(%r8)
01
ret

LLVM IR (-O0):
define i32 @adrreg0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* inttoptr (i64 11111111 to i16*)
%17 = load i16*, i16** %12
%18 = getelementptr inbounds i16, i16* %17, i64 10000000
store i16 %16, i16* %18
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @adrreg0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture readnone %5) {
%7 = load i16, i16* inttoptr (i64 11111111 to i16*)
%8 = getelementptr inbounds i16, i16* %4, i64 10000000
store i16 %7, i16* %8
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
void fc_forward(float a, float b) { printf("fc_forward: %f, %f\n", a, b); }


x86 assembly (clang, -O0):
<fc_forward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"fc_forward: %f, %f\0A\00"
define void @fc_forward(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), float %5, float %6)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"fc_forward: %f, %f\0A\00"
define void @fc_forward(float %0, float %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), float %0, float %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void default_assign(void *dst, void *src, int size) { memcpy(dst, src, size); }


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

x86 assembly (clang, -O2):
<default_assign>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @default_assign(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ funcao(int, int);
int /*<<< orphan*/ funcao2(int, int);
int main(void) {
  funcao(1, 2);
  funcao2(1, 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <funcao@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <funcao2@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <funcao@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <funcao2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @funcao(i32 1, i32 2)
%2 = call i32 @funcao2(i32 1, i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @funcao(i32 1, i32 2)
%2 = tail call i32 @funcao2(i32 1, i32 2)
ret i32 0
}
int f_blt_rm1(float a1, float *a2) { return (__builtin_isless(a1, *a2)); }


x86 assembly (clang, -O0):
<f_blt_rm1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_blt_rm1>:
movss  (%rdi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @f_blt_rm1(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = load float*, float** %4
%7 = load float, float* %6
%8 = fcmp olt float %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_blt_rm1(float %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fcmp ogt float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct _RegionHandle {
  int dummy;
};

/* Variables and functions */
int region_get_free_bytes(struct _RegionHandle *);
int region_free_bytes(struct _RegionHandle *r) {
  return region_get_free_bytes(r);
}


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

x86 assembly (clang, -O2):
<region_free_bytes>:
jmp    1030 <region_get_free_bytes@plt>

LLVM IR (-O0):
%struct._RegionHandle = type { i32 }
define i32 @region_free_bytes(%struct._RegionHandle* %0) {
%2 = alloca %struct._RegionHandle*
store %struct._RegionHandle* %0, %struct._RegionHandle** %2
%3 = load %struct._RegionHandle*, %struct._RegionHandle** %2
%4 = call i32 @region_get_free_bytes(%struct._RegionHandle* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct._RegionHandle = type { i32 }
define i32 @region_free_bytes(%struct._RegionHandle* %0) {
%2 = tail call i32 @region_get_free_bytes(%struct._RegionHandle* %0)
ret i32 %2
}
int AST_comparer(const void *a, const void *b) {
  if (a == b) {
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<AST_comparer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1126 <AST_comparer+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112d <AST_comparer+0x2d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AST_comparer>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @AST_comparer(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
int test_imm_85int32_reg(int val) { return ((val) & (0x85 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_85int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x85,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_85int32_reg>:
test   $0x85,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_85int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 133
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_85int32_reg(i32 %0) {
%2 = and i32 %0, 133
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ apathmax(char **, long *);
int /*<<< orphan*/ eprintf(char *);
int /*<<< orphan*/ getcwd(char *, long);
char *agetcwd(void) {
  char *buf;
  long size;
  apathmax(&buf, &size);
  if (!getcwd(buf, size))
    eprintf("getcwd:");
  return buf;
}


x86 assembly (clang, -O0):
<agetcwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <apathmax@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <getcwd@plt>
cmp    $0x0,%eax
jne    1167 <agetcwd+0x37>
lea    0xe9e(%rip),%rdi
call   1050 <eprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agetcwd>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <apathmax@plt>
mov    0x8(%rsp),%rdi
mov    0x10(%rsp),%rsi
call   1030 <getcwd@plt>
test   %eax,%eax
jne    1162 <agetcwd+0x32>
lea    0xea3(%rip),%rdi
call   1050 <eprintf@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"getcwd:\00"
define i8* @agetcwd() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i32 @apathmax(i8** %1, i64* %2)
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = call i32 @getcwd(i8* %4, i64 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 @eprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"getcwd:\00"
define i8* @agetcwd() {
%1 = alloca i8*
%2 = alloca i64
%3 = bitcast i8** %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @apathmax(i8** %1, i64* %2)
%6 = load i8*, i8** %1
%7 = load i64, i64* %2
%8 = call i32 @getcwd(i8* %6, i64 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @eprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %0
%13 = load i8*, i8** %1
ret i8* %13
}