xunge/DecIR huggingface dataset:
/* Type definitions */
struct datagram {
  int dummy;
};

/* Variables and functions */
struct datagram *datagram_create_address(int /*<<< orphan*/ *, int);
struct datagram *datagram_create(int port) {
  return datagram_create_address(NULL, port);
}


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

x86 assembly (clang, -O2):
<datagram_create>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <datagram_create_address@plt>

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

LLVM IR (-O2):
%struct.datagram = type { i32 }
define %struct.datagram* @datagram_create(i32 %0) {
%2 = tail call %struct.datagram* @datagram_create_address(i32* null, i32 %0)
ret %struct.datagram* %2
}
/* Variables and functions */
int ENOSYS;
int errno;
int lremovexattr(const char *path, const char *name) {
  return (errno = ENOSYS, -1);
}


x86 assembly (clang, -O0):
<lremovexattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lremovexattr>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @lremovexattr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @lremovexattr(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int fwrite(unsigned short *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void writeShort(unsigned short value, FILE *f) {
  if (fwrite(&value, sizeof(unsigned short), 1, f) != 1) {
    fprintf(stderr, "fwrite() failed -- exiting!\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<writeShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
cmp    $0x1,%eax
je     1182 <writeShort+0x52>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeShort>:
push   %rax
mov    %rsi,%rcx
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
cmp    $0x1,%eax
jne    1154 <writeShort+0x24>
pop    %rax
ret
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"fwrite() failed -- exiting!\0A\00"
define void @writeShort(i16 zeroext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @fwrite(i16* %3, i32 2, i32 1, i32* %5)
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"fwrite() failed -- exiting!\0A\00"
define void @writeShort(i16 zeroext %0, i32* nocapture %1) {
%3 = alloca i16
store i16 %0, i16* %3
%4 = call i32 @fwrite(i16* %3, i32 2, i32 1, i32* %1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %2
ret void
}
void g_strdup() {}


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

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

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

LLVM IR (-O2):
define void @g_strdup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RegWrite(unsigned char, unsigned char, unsigned char);
void RegWriteA(unsigned short RegAddr, unsigned char RegData) {
  unsigned char RegAddrH = RegAddr >> 8;
  unsigned char RegAddrL = RegAddr & 0xFF;
  RegWrite(RegAddrH, RegAddrL, RegData);
}


x86 assembly (clang, -O0):
<RegWriteA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%cl
mov    -0x5(%rbp),%al
movzbl %cl,%edi
movzbl %al,%esi
movzbl -0x3(%rbp),%edx
call   1030 <RegWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RegWriteA>:
mov    %esi,%edx
movzbl %dil,%esi
shr    $0x8,%edi
jmp    1030 <RegWrite@plt>

LLVM IR (-O0):
define void @RegWriteA(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%7 = load i16, i16* %3
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %5
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
store i8 %14, i8* %6
%15 = load i8, i8* %5
%16 = load i8, i8* %6
%17 = load i8, i8* %4
%18 = call i32 @RegWrite(i8 zeroext %15, i8 zeroext %16, i8 zeroext %17)
ret void
}

LLVM IR (-O2):
define void @RegWriteA(i16 zeroext %0, i8 zeroext %1) {
%3 = lshr i16 %0, 8
%4 = trunc i16 %3 to i8
%5 = trunc i16 %0 to i8
%6 = tail call i32 @RegWrite(i8 zeroext %4, i8 zeroext %5, i8 zeroext %1)
ret void
}
int tiff_tag_type_size(const int type) {
  switch (type) {
  case 1:
  case 2:
  case 6:
  case 7:
    return 1;
  case 3:
  case 8:
    return 2;
  case 4:
  case 9:
  case 11:
  case 13:
    return 4;
  case 5:
  case 10:
  case 12:
  case 16:
  case 17:
  case 18:
    return 8;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tiff_tag_type_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x11,%eax
ja     1160 <tiff_tag_type_size+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1167 <tiff_tag_type_size+0x67>
movl   $0x2,-0x4(%rbp)
jmp    1167 <tiff_tag_type_size+0x67>
movl   $0x4,-0x4(%rbp)
jmp    1167 <tiff_tag_type_size+0x67>
movl   $0x8,-0x4(%rbp)
jmp    1167 <tiff_tag_type_size+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tiff_tag_type_size>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x11,%edi
ja     1117 <tiff_tag_type_size+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @tiff_tag_type_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 1, label %5
i32 2, label %5
i32 6, label %5
i32 7, label %5
i32 3, label %6
i32 8, label %6
i32 4, label %7
i32 9, label %7
i32 11, label %7
i32 13, label %7
i32 5, label %8
i32 10, label %8
i32 12, label %8
i32 16, label %8
i32 17, label %8
i32 18, label %8
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %10
6: ; preds = %1, %1
store i32 2, i32* %2
br label %10
7: ; preds = %1, %1, %1, %1
store i32 4, i32* %2
br label %10
8: ; preds = %1, %1, %1, %1, %1, %1
store i32 8, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.tiff_tag_type_size = [18 x i32] [i32 1, i32 1, i32 2, i32 4, i32 8, i32 1, i32 1, i32 2, i32 4, i32 8, i32 4, i32 8, i32 4, i32 0, i32 0, i32 8, i32 8, i32 8]
define i32 @tiff_tag_type_size(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 18
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [18 x i32], [18 x i32]* @switch.table.tiff_tag_type_size, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ zero();
void one(void) { zero(); }


x86 assembly (clang, -O0):
<one>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <zero@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<one>:
xor    %eax,%eax
jmp    1030 <zero@plt>

LLVM IR (-O0):
define void @one() {
%1 = call i32 (...) @zero()
ret void
}

LLVM IR (-O2):
define void @one() {
%1 = tail call i32 (...) @zero()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ preload_seq(int);
void main(void) {
  preload_seq(173);
  preload_seq(54);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xad,%edi
call   1030 <preload_seq@plt>
mov    $0x36,%edi
call   1030 <preload_seq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xad,%edi
call   1030 <preload_seq@plt>
mov    $0x36,%edi
pop    %rax
jmp    1030 <preload_seq@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @preload_seq(i32 173)
%2 = call i32 @preload_seq(i32 54)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @preload_seq(i32 173)
%2 = tail call i32 @preload_seq(i32 54)
ret void
}
void hb_stack_unlock(void) {}


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

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

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

LLVM IR (-O2):
define void @hb_stack_unlock() {
ret void
}
const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
                                          struct mm_struct *mm,
                                          unsigned long start,
                                          unsigned long end, unsigned int cpu) {
  return cpumask;
}


x86 assembly (clang, -O0):
<uv_flush_tlb_others>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv_flush_tlb_others>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.cpumask = type opaque
%struct.mm_struct = type opaque
define %struct.cpumask* @uv_flush_tlb_others(%struct.cpumask* %0, %struct.mm_struct* %1, i64 %2, i64 %3, i32 %4) {
%6 = alloca %struct.cpumask*
%7 = alloca %struct.mm_struct*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
store %struct.cpumask* %0, %struct.cpumask** %6
store %struct.mm_struct* %1, %struct.mm_struct** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load %struct.cpumask*, %struct.cpumask** %6
ret %struct.cpumask* %11
}

LLVM IR (-O2):
%struct.cpumask = type opaque
%struct.mm_struct = type opaque
define %struct.cpumask* @uv_flush_tlb_others(%struct.cpumask* readnone returned %0, %struct.mm_struct* nocapture readnone %1, i64 %2, i64 %3, i32 %4) {
ret %struct.cpumask* %0
}
/* Type definitions */
struct domainlist {
  int dummy;
};
struct dev_policy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dev_policy_free(struct dev_policy *);
struct dev_policy *devid_policy(int);
int /*<<< orphan*/ domain_merge(struct domainlist **, struct dev_policy *,
                                char const *);
void domainlist_add_dev(struct domainlist **dom, int devid,
                        const char *metadata) {
  struct dev_policy *pol = devid_policy(devid);
  domain_merge(dom, pol, metadata);
  dev_policy_free(pol);
}


x86 assembly (clang, -O0):
<domainlist_add_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <devid_policy@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <domain_merge@plt>
mov    -0x20(%rbp),%rdi
call   1050 <dev_policy_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<domainlist_add_dev>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%edi
call   1030 <devid_policy@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1040 <domain_merge@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <dev_policy_free@plt>

LLVM IR (-O0):
%struct.domainlist = type { i32 }
%struct.dev_policy = type { i32 }
define void @domainlist_add_dev(%struct.domainlist** %0, i32 %1, i8* %2) {
%4 = alloca %struct.domainlist**
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.dev_policy*
store %struct.domainlist** %0, %struct.domainlist*** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %5
%9 = call %struct.dev_policy* @devid_policy(i32 %8)
store %struct.dev_policy* %9, %struct.dev_policy** %7
%10 = load %struct.domainlist**, %struct.domainlist*** %4
%11 = load %struct.dev_policy*, %struct.dev_policy** %7
%12 = load i8*, i8** %6
%13 = call i32 @domain_merge(%struct.domainlist** %10, %struct.dev_policy* %11, i8* %12)
%14 = load %struct.dev_policy*, %struct.dev_policy** %7
%15 = call i32 @dev_policy_free(%struct.dev_policy* %14)
ret void
}

LLVM IR (-O2):
%struct.domainlist = type { i32 }
%struct.dev_policy = type { i32 }
define void @domainlist_add_dev(%struct.domainlist** %0, i32 %1, i8* %2) {
%4 = tail call %struct.dev_policy* @devid_policy(i32 %1)
%5 = tail call i32 @domain_merge(%struct.domainlist** %0, %struct.dev_policy* %4, i8* %2)
%6 = tail call i32 @dev_policy_free(%struct.dev_policy* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ l_message(int /*<<< orphan*/ *, char *);
void print_version(void) {
  l_message(NULL, "Lua 5.1.4"
                  "  "
                  "Copyright (C) 1994-2008 Lua.org, PUC-Rio");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
lea    0xee1(%rip),%rsi
call   1030 <l_message@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <l_message@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio\00"
define void @print_version() {
%1 = call i32 @l_message(i32* null, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio\00"
define void @print_version() {
%1 = tail call i32 @l_message(i32* null, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int _uiCommLogOut(unsigned int uiCommType) { return (0x0000); }


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

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

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

LLVM IR (-O2):
define i32 @_uiCommLogOut(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rotl_32e(long dummy, uint32_t x) { return (x << 24) | (x >> 8); }


x86 assembly (clang, -O0):
<rotl_32e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x18,%eax
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl_32e>:
mov    %esi,%eax
shl    $0x18,%eax
sar    $0x8,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @rotl_32e(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32, i32* %4
%8 = ashr i32 %7, 8
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rotl_32e(i64 %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr i32 %1, 8
%5 = or i32 %3, %4
ret i32 %5
}
void dly(int iCnt) {
  while (--iCnt > 0)
    ;
}


x86 assembly (clang, -O0):
<dly>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jle    111e <dly+0x1e>
jmp    1107 <dly+0x7>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dly(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @dly(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void FreeLibrary(void *hModule) { dlclose(hModule); }


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

x86 assembly (clang, -O2):
<FreeLibrary>:
jmp    1030 <dlclose@plt>

LLVM IR (-O0):
define void @FreeLibrary(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @dlclose(i8* %3)
ret void
}

LLVM IR (-O2):
define void @FreeLibrary(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nibble_sort_david(unsigned long *);
void nibble_sort_mentre(unsigned long *buf) {
  unsigned long *b = buf;
  for (int i = 0; i < 1024; i++) {
    nibble_sort_david(&b[i]);
  }
}


x86 assembly (clang, -O0):
<nibble_sort_mentre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    115a <nibble_sort_mentre+0x4a>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <nibble_sort_david@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <nibble_sort_mentre+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_sort_mentre>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    (%r14,%rbx,1),%rdi
call   1030 <nibble_sort_david@plt>
add    $0x8,%rbx
cmp    $0x2000,%rbx
jne    1120 <nibble_sort_mentre+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @nibble_sort_mentre(i64* %0) {
%2 = alloca i64*
%3 = alloca i64*
%4 = alloca i32
store i64* %0, i64** %2
%5 = load i64*, i64** %2
store i64* %5, i64** %3
store i32 0, i32* %4
br label %6
6: ; preds = %15, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 1024
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i64*, i64** %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %10, i64 %12
%14 = call i32 @nibble_sort_david(i64* %13)
br label %15
15: ; preds = %9
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @nibble_sort_mentre(i64* %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %7, %3 ]
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = tail call i32 @nibble_sort_david(i64* %5)
%7 = add nuw nsw i64 %4, 1
%8 = icmp eq i64 %7, 1024
br i1 %8, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
void main() {
  printf("L = %f\nS = %f\n", 2 * 3.14159265 * 3.0, 3.14159265 * 3.0 * 3.0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeed(%rip),%rdi
mov    $0x12,%esi
movsd  0xed8(%rip),%xmm0
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xef1(%rip),%rdi
movsd  0xee1(%rip),%xmm0
mov    $0x12,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"L = %f\0AS = %f\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 18, double 0x403C463ABE41EF90)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"L = %f\0AS = %f\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 18, double 0x403C463ABE41EF90)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reader_exit();
int cmd_exit(char **arg) {
  (void)arg;
  reader_exit();
  return 0;
}


x86 assembly (clang, -O0):
<cmd_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <reader_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_exit>:
push   %rax
xor    %eax,%eax
call   1030 <reader_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cmd_exit(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i32 (...) @reader_exit()
ret i32 0
}

LLVM IR (-O2):
define i32 @cmd_exit(i8** nocapture readnone %0) {
%2 = tail call i32 (...) @reader_exit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
void write_buffer(char **dest_ptr, char *src, size_t size) {
  memcpy(*dest_ptr, src, size);
  *dest_ptr += size;
}


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

x86 assembly (clang, -O2):
<write_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <memcpy@plt>
add    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @write_buffer(i8** %0, i8* %1, i64 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i64
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @memcpy(i8* %8, i8* %9, i64 %10)
%12 = load i64, i64* %6
%13 = load i8**, i8*** %4
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i64 %12
store i8* %15, i8** %13
ret void
}

LLVM IR (-O2):
define void @write_buffer(i8** nocapture %0, i8* %1, i64 %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @memcpy(i8* %4, i8* %1, i64 %2)
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 %2
store i8* %7, i8** %0
ret void
}
/* Variables and functions */
char const *strdup(char const *);
const char *dagutil_strdup(const char *source) { return strdup(source); }


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

x86 assembly (clang, -O2):
<dagutil_strdup>:
jmp    1030 <strdup@plt>

LLVM IR (-O0):
define i8* @dagutil_strdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strdup(i8* %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @dagutil_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ path_basename(char const *);
char *strrchr(int /*<<< orphan*/, char);
const char *path_get_extension(const char *path) {
  const char *ext = strrchr(path_basename(path), '.');
  if (ext)
    return ext + 1;
  else
    return "";
}


x86 assembly (clang, -O0):
<path_get_extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <path_basename@plt>
mov    %eax,%edi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <path_get_extension+0x41>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116c <path_get_extension+0x4c>
lea    0xe98(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_get_extension>:
push   %rax
call   1030 <path_basename@plt>
mov    %eax,%edi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
lea    0xec0(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @path_get_extension(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @path_basename(i8* %5)
%7 = call i8* @strrchr(i32 %6, i8 signext 46)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8* %12, i8** %2
br label %14
13: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %14
14: ; preds = %13, %10
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @path_get_extension(i8* %0) {
%2 = tail call i32 @path_basename(i8* %0)
%3 = tail call i8* @strrchr(i32 %2, i8 signext 46)
%4 = icmp eq i8* %3, null
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
main() {
  int n_sigs = 2 * 64;
  int rtmin = 0;
  exit(rtmin < n_sigs);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x80,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 128, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = icmp slt i32 %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
decode_i_pn(int a, int b) {
  b = (b >> 5) & 31;
  return (a & 0xfff0000f) | 1 << (b + 4);
}


x86 assembly (clang, -O0):
<decode_i_pn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x5,%eax
and    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfff0000f,%eax
mov    -0x8(%rbp),%ecx
add    $0x4,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_i_pn>:
mov    %esi,%ecx
shr    $0x5,%ecx
and    $0xfff0000f,%edi
mov    $0x10,%eax
shl    %cl,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @decode_i_pn(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 5
%7 = and i32 %6, 31
store i32 %7, i32* %4
%8 = load i32, i32* %3
%9 = and i32 %8, -1048561
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 4
%12 = shl i32 1, %11
%13 = or i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @decode_i_pn(i32 %0, i32 %1) {
%3 = lshr i32 %1, 5
%4 = and i32 %3, 31
%5 = and i32 %0, -1048561
%6 = shl i32 16, %4
%7 = or i32 %6, %5
ret i32 %7
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
uid_t geteuid(void) {
  ;
  return 1;
}


x86 assembly (clang, -O0):
<geteuid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @geteuid() {
ret i32 1
}

LLVM IR (-O2):
define i32 @geteuid() {
ret i32 1
}
int main() { return (0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double RadToDeg(double num) {
  return (num /
          (3.14159265358979323846264338327950288419716939937510582097494459 /
           180.0));
}


x86 assembly (clang, -O0):
<RadToDeg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<RadToDeg>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @RadToDeg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 0x3F91DF46A2529D39
ret double %4
}

LLVM IR (-O2):
define double @RadToDeg(double %0) {
%2 = fdiv double %0, 0x3F91DF46A2529D39
ret double %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ checkInput(int *);
int /*<<< orphan*/ isOverTwentyAndODD(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int number;
  printf("Enter number: ");
  checkInput(&number);
  isOverTwentyAndODD(number);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <checkInput@plt>
mov    -0x8(%rbp),%edi
call   1050 <isOverTwentyAndODD@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <checkInput@plt>
mov    0x4(%rsp),%edi
call   1050 <isOverTwentyAndODD@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter number: \00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @checkInput(i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @isOverTwentyAndODD(i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter number: \00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @checkInput(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @isOverTwentyAndODD(i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
void testClosureFrV(void (*closure)(float), float a1) { (*closure)(a1); }


x86 assembly (clang, -O0):
<testClosureFrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFrV>:
jmp    *%rdi

LLVM IR (-O0):
define void @testClosureFrV(void (float)* %0, float %1) {
%3 = alloca void (float)*
%4 = alloca float
store void (float)* %0, void (float)** %3
store float %1, float* %4
%5 = load void (float)*, void (float)** %3
%6 = load float, float* %4
ret void
}

LLVM IR (-O2):
define void @testClosureFrV(void (float)* nocapture %0, float %1) {
tail call void %0(float %1)
ret void
}
void usr_background(void) {}


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

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

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

LLVM IR (-O2):
define void @usr_background() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rev(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ swap(char *, char *);
main() {
  char *name = "ravindra";
  char x = 'a', y = 'b';
  swap(name + 1, name + 3);
  printf("name is %s\n", name);
  fflush(stdout);
  exit(1);
  rev(name);
  name[7] = '\0';
  rev(name);
  printf("name is %s\n", name);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x10(%rbp)
movb   $0x61,-0x11(%rbp)
movb   $0x62,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
add    $0x3,%rsi
call   1060 <swap@plt>
mov    -0x10(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb9(%rip),%rdi
lea    0xeb4(%rip),%rsi
call   1060 <swap@plt>
lea    0xea5(%rip),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ravindra\00"
@.str.1 = [12 x i8] c"name is %s\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i32 0, i32* %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
store i8 97, i8* %3
store i8 98, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 3
%9 = call i32 @swap(i8* %6, i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @stdout
%13 = call i32 @fflush(i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"ravindra\00"
@.str.1 = [12 x i8] c"name is %s\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 @swap(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 1), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 3))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int floor(int);
int log(int);
int msb_orig(unsigned int inp) { return floor((log(inp) / log(2))) + 1; }


x86 assembly (clang, -O0):
<msb_orig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <log@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <floor@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msb_orig>:
push   %rbx
call   1030 <log@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1030 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <floor@plt>
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @msb_orig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @log(i32 %3)
%5 = call i32 @log(i32 2)
%6 = sdiv i32 %4, %5
%7 = call i32 @floor(i32 %6)
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @msb_orig(i32 %0) {
%2 = tail call i32 @log(i32 %0)
%3 = tail call i32 @log(i32 2)
%4 = sdiv i32 %2, %3
%5 = tail call i32 @floor(i32 %4)
%6 = add nsw i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ mtrace();
int /*<<< orphan*/ muntrace();
int /*<<< orphan*/ setenv(char *, char *, int);
int main(void) {
  int *a = NULL;
  setenv("MALLOC_TRACE", "malloc_output.txt", 1);
  mtrace();
  a = malloc(sizeof(int));
  if (a == NULL) {
    return 1;
  }
  muntrace();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xea2(%rip),%rdi
lea    0xea8(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
mov    $0x0,%al
call   1060 <mtrace@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    119b <main+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    11a9 <main+0x69>
mov    $0x0,%al
call   1040 <muntrace@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xebe(%rip),%rsi
mov    $0x1,%ebx
mov    $0x1,%edx
call   1030 <setenv@plt>
xor    %eax,%eax
call   1060 <mtrace@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     117d <main+0x3d>
xor    %eax,%eax
call   1040 <muntrace@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"MALLOC_TRACE\00"
@.str.1 = [18 x i8] c"malloc_output.txt\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
%3 = call i32 @setenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = call i32 (...) @mtrace()
%5 = call i32* @malloc(i32 4)
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %11
9: ; preds = %0
%10 = call i32 (...) @muntrace()
store i32 0, i32* %1
br label %11
11: ; preds = %9, %8
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [13 x i8] c"MALLOC_TRACE\00"
@.str.1 = [18 x i8] c"malloc_output.txt\00"
define i32 @main() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = tail call i32 (...) @mtrace()
%3 = tail call i32* @malloc(i32 4)
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 (...) @muntrace()
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ 0, %5 ], [ 1, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__18__IO__selectModuleFunc();
void HplMsp430Usart0P__SOMI__selectModuleFunc(void) {
  HplMsp430GeneralIOP__18__IO__selectModuleFunc();
}


x86 assembly (clang, -O0):
<HplMsp430Usart0P__SOMI__selectModuleFunc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HplMsp430GeneralIOP__18__IO__selectModuleFunc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HplMsp430Usart0P__SOMI__selectModuleFunc>:
xor    %eax,%eax
jmp    1030 <HplMsp430GeneralIOP__18__IO__selectModuleFunc@plt>

LLVM IR (-O0):
define void @HplMsp430Usart0P__SOMI__selectModuleFunc() {
%1 = call i32 (...) @HplMsp430GeneralIOP__18__IO__selectModuleFunc()
ret void
}

LLVM IR (-O2):
define void @HplMsp430Usart0P__SOMI__selectModuleFunc() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__18__IO__selectModuleFunc()
ret void
}
void ScaleRowDown34_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_C() {
ret void
}
/* Variables and functions */
int ssds_get_gen_num(int, int /*<<< orphan*/ *, char *, char *);
int ssds_get_num_classes(int pcfd) {
  return ssds_get_gen_num(pcfd, NULL, "num_classes", "reply");
}


x86 assembly (clang, -O0):
<ssds_get_num_classes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
lea    0xed7(%rip),%rdx
lea    0xedc(%rip),%rcx
call   1030 <ssds_get_gen_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_get_num_classes>:
lea    0xee9(%rip),%rdx
lea    0xeee(%rip),%rcx
xor    %esi,%esi
jmp    1030 <ssds_get_gen_num@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"num_classes\00"
@.str.1 = [6 x i8] c"reply\00"
define i32 @ssds_get_num_classes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ssds_get_gen_num(i32 %3, i32* null, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"num_classes\00"
@.str.1 = [6 x i8] c"reply\00"
define i32 @ssds_get_num_classes(i32 %0) {
%2 = tail call i32 @ssds_get_gen_num(i32 %0, i32* null, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SMUSD(uint32_t x, uint32_t y) {
  return ((uint32_t)(((((int32_t)x << 16) >> 16) * (((int32_t)y << 16) >> 16)) -
                     ((((int32_t)x) >> 16) * (((int32_t)y) >> 16))));
}


x86 assembly (clang, -O0):
<__SMUSD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
sar    $0x10,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%rcx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rdx
sar    $0x10,%edx
imul   %edx,%ecx
sub    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SMUSD>:
movswl %di,%eax
movswl %si,%ecx
imul   %eax,%ecx
sar    $0x10,%edi
sar    $0x10,%esi
imul   %edi,%esi
sub    %esi,%ecx
movslq %ecx,%rax
ret

LLVM IR (-O0):
define i64 @__SMUSD(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 16
%8 = ashr i32 %7, 16
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 16
%12 = ashr i32 %11, 16
%13 = mul nsw i32 %8, %12
%14 = load i64, i64* %3
%15 = trunc i64 %14 to i32
%16 = ashr i32 %15, 16
%17 = load i64, i64* %4
%18 = trunc i64 %17 to i32
%19 = ashr i32 %18, 16
%20 = mul nsw i32 %16, %19
%21 = sub nsw i32 %13, %20
%22 = sext i32 %21 to i64
ret i64 %22
}

LLVM IR (-O2):
define i64 @__SMUSD(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = shl i32 %3, 16
%5 = ashr exact i32 %4, 16
%6 = trunc i64 %1 to i32
%7 = shl i32 %6, 16
%8 = ashr exact i32 %7, 16
%9 = mul nsw i32 %8, %5
%10 = ashr i32 %3, 16
%11 = ashr i32 %6, 16
%12 = mul nsw i32 %11, %10
%13 = sub nsw i32 %9, %12
%14 = sext i32 %13 to i64
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void printHelp(char *programName) {
  fprintf(stderr,
          "Usage : %s [OPTION]...\n"
          "  -b,--bank\t bank id\n"
          "  -n,--num\t number of card id to generate (mandatory)\n"
          "  -u,--unrandomize\t set the last four digit of card to have a less "
          "random id\n",
          programName);
}


x86 assembly (clang, -O0):
<printHelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHelp>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [176 x i8] c"Usage : %s [OPTION]...\0A -b,--bank\09 bank id\0A -n,--num\09 number of card id to generate (mandatory)\0A -u,--unrandomize\09 set the last four digit of card to have a less random id\0A\00"
define void @printHelp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [176 x i8] c"Usage : %s [OPTION]...\0A -b,--bank\09 bank id\0A -n,--num\09 number of card id to generate (mandatory)\0A -u,--unrandomize\09 set the last four digit of card to have a less random id\0A\00"
define void @printHelp(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ t();
void function_declaration_both_after(void) { t(); }


x86 assembly (clang, -O0):
<function_declaration_both_after>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <t@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_declaration_both_after>:
xor    %eax,%eax
jmp    1030 <t@plt>

LLVM IR (-O0):
define void @function_declaration_both_after() {
%1 = call i32 (...) @t()
ret void
}

LLVM IR (-O2):
define void @function_declaration_both_after() {
%1 = tail call i32 (...) @t()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ sorter_grail_common_sort(int /*<<< orphan*/ *, int,
                                            int /*<<< orphan*/ *, int);
void sorter_grail_sort_fixed_buffer(int64_t *arr, size_t Len) {
  int64_t ExtBuf[512];
  sorter_grail_common_sort(arr, (int)Len, ExtBuf, 512);
}


x86 assembly (clang, -O0):
<sorter_grail_sort_fixed_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    -0x810(%rbp),%rdx
mov    $0x200,%ecx
call   1030 <sorter_grail_common_sort@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sorter_grail_sort_fixed_buffer>:
sub    $0x808,%rsp
mov    %rsp,%rdx
mov    $0x200,%ecx
call   1030 <sorter_grail_common_sort@plt>
add    $0x808,%rsp
ret

LLVM IR (-O0):
define void @sorter_grail_sort_fixed_buffer(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca [512 x i32]
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i32*, i32** %3
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = getelementptr inbounds [512 x i32], [512 x i32]* %5, i64 0, i64 0
%10 = call i32 @sorter_grail_common_sort(i32* %6, i32 %8, i32* %9, i32 512)
ret void
}

LLVM IR (-O2):
define void @sorter_grail_sort_fixed_buffer(i32* %0, i64 %1) {
%3 = alloca [512 x i32]
%4 = bitcast [512 x i32]* %3 to i8*
%5 = trunc i64 %1 to i32
%6 = getelementptr inbounds [512 x i32], [512 x i32]* %3, i64 0, i64 0
%7 = call i32 @sorter_grail_common_sort(i32* %0, i32 %5, i32* %6, i32 512)
ret void
}
double KPAtoHPA(double KPA) {
  double HPA = KPA * 10;
  return HPA;
}


x86 assembly (clang, -O0):
<KPAtoHPA>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<KPAtoHPA>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @KPAtoHPA(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 1.000000e+01
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @KPAtoHPA(double %0) {
%2 = fmul double %0, 1.000000e+01
ret double %2
}
OP(fd, c6) { op_c6(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_c6@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_c6@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @op_c6()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_c6()
ret i32 undef
}
float finish(void) {
  float res;
  __asm__ volatile("fstps %0\n" : "=m"(res));
  return res;
}


x86 assembly (clang, -O0):
<finish>:
push   %rbp
mov    %rsp,%rbp
fstps  -0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<finish>:
fstps  -0x4(%rsp)
movss  -0x4(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @finish() {
%1 = alloca float
%2 = load float, float* %1
ret float %2
}

LLVM IR (-O2):
define float @finish() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = load float, float* %1
ret float %3
}