xunge/DecIR huggingface dataset:
/* Variables and functions */
int open(char *, int);
int posix_openpt(int oflag) { return open("/dev/ptmx", oflag); }


x86 assembly (clang, -O0):
<posix_openpt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_openpt>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/ptmx\00"
define i32 @posix_openpt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/ptmx\00"
define i32 @posix_openpt(i32 %0) {
%2 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char const *, char *);
void greenm(const char *green_msg) {
  printf("%s%s%s\n", "\033[32m", green_msg, "\033[0m");
}


x86 assembly (clang, -O0):
<greenm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xeda(%rip),%rsi
lea    0xed9(%rip),%rcx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greenm>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xee6(%rip),%rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s%s%s\0A\00"
@.str.1 = [6 x i8] c"\1B[32m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @greenm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s%s%s\0A\00"
@.str.1 = [6 x i8] c"\1B[32m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @greenm(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int fstat(int des, void *buf) { return -1; }


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fstat(i32 %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
unsigned int time_ticks_passed(unsigned int);
unsigned int time_ms_passed(unsigned int ref) {
  unsigned int passed = time_ticks_passed(ref);
  return passed * 1000 / 25;
}


x86 assembly (clang, -O0):
<time_ms_passed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <time_ticks_passed@plt>
mov    %eax,-0x8(%rbp)
imul   $0x3e8,-0x8(%rbp),%eax
mov    $0x19,%ecx
xor    %edx,%edx
div    %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_ms_passed>:
push   %rax
call   1030 <time_ticks_passed@plt>
imul   $0x3e8,%eax,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x23,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @time_ms_passed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @time_ticks_passed(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = mul i32 %6, 1000
%8 = udiv i32 %7, 25
ret i32 %8
}

LLVM IR (-O2):
define i32 @time_ms_passed(i32 %0) {
%2 = tail call i32 @time_ticks_passed(i32 %0)
%3 = mul i32 %2, 1000
%4 = udiv i32 %3, 25
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct packet_s {
  int dummy;
};

/* Variables and functions */
struct packet_s *genPack(int /*<<< orphan*/ *, int, int);
int strlen(char *);
struct packet_s *genSys_Dbg(char *ptr) {
  struct packet_s *pack = NULL;
  int len;
  len = strlen(ptr);
  pack = genPack((uint8_t *)ptr, 4, len);
  return pack;
}


x86 assembly (clang, -O0):
<genSys_Dbg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    $0x4,%esi
call   1040 <genPack@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genSys_Dbg>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <genPack@plt>

LLVM IR (-O0):
%struct.packet_s = type { i32 }
define %struct.packet_s* @genSys_Dbg(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.packet_s*
%4 = alloca i32
store i8* %0, i8** %2
store %struct.packet_s* null, %struct.packet_s** %3
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %4
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %4
%10 = call %struct.packet_s* @genPack(i32* %8, i32 4, i32 %9)
store %struct.packet_s* %10, %struct.packet_s** %3
%11 = load %struct.packet_s*, %struct.packet_s** %3
ret %struct.packet_s* %11
}

LLVM IR (-O2):
%struct.packet_s = type { i32 }
define %struct.packet_s* @genSys_Dbg(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = bitcast i8* %0 to i32*
%4 = tail call %struct.packet_s* @genPack(i32* %3, i32 4, i32 %2)
ret %struct.packet_s* %4
}
char *xrealloc(old, size)
char *old;
int size;
{
  char *p = (char *)realloc(old, size);
  if (!p)
    fatal_error("Not enough memory");
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1159 <xrealloc+0x39>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <fatal_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
movslq %esi,%rsi
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xrealloc+0x1f>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <fatal_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Not enough memory\00"
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = call i8* @realloc(i8* %6, i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [18 x i8] c"Not enough memory\00"
define i8* @xrealloc(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = tail call i8* @realloc(i8* %0, i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ WriteUnVarint(int);
void WriteVarint(int v) { WriteUnVarint((v << 1) ^ (v >> 31)); }


x86 assembly (clang, -O0):
<WriteVarint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
xor    %eax,%edi
call   1030 <WriteUnVarint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteVarint>:
lea    (%rdi,%rdi,1),%eax
sar    $0x1f,%edi
xor    %eax,%edi
jmp    1030 <WriteUnVarint@plt>

LLVM IR (-O0):
define void @WriteVarint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 31
%7 = xor i32 %4, %6
%8 = call i32 @WriteUnVarint(i32 %7)
ret void
}

LLVM IR (-O2):
define void @WriteVarint(i32 %0) {
%2 = shl i32 %0, 1
%3 = ashr i32 %0, 31
%4 = xor i32 %2, %3
%5 = tail call i32 @WriteUnVarint(i32 %4)
ret void
}
int ints_len(void *container) { return 15; }


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

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

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

LLVM IR (-O2):
define i32 @ints_len(i8* nocapture readnone %0) {
ret i32 15
}
/* Variables and functions */
int /*<<< orphan*/ mexMakeMemoryPersistent(void *);
scalar_t__ mxMalloc(size_t);
void *__wrap_malloc(size_t bytes) {
  void *ptr;
  ptr = (void *)mxMalloc(bytes);
  if (ptr != 0)
    mexMakeMemoryPersistent(ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<__wrap_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mxMalloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <__wrap_malloc+0x2d>
mov    -0x10(%rbp),%rdi
call   1030 <mexMakeMemoryPersistent@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_malloc>:
push   %rbx
call   1040 <mxMalloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1136 <__wrap_malloc+0x16>
mov    %rbx,%rdi
call   1030 <mexMakeMemoryPersistent@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @__wrap_malloc(i64 %0) {
%2 = tail call i64 @mxMalloc(i64 %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @mexMakeMemoryPersistent(i8* %3)
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Variables and functions */
float sinus(float, int /*<<< orphan*/);
float sinf(float arg) { return sinus(arg, 0); }


x86 assembly (clang, -O0):
<sinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %edi,%edi
call   1030 <sinus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinf>:
xor    %edi,%edi
jmp    1030 <sinus@plt>

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

LLVM IR (-O2):
define float @sinf(float %0) {
%2 = tail call float @sinus(float %0, i32 0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int warterm_hilite(int mode) {
  printf("H\01%d\01\n", mode);
  return mode;
}


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

x86 assembly (clang, -O2):
<warterm_hilite>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"H\01%d\01\0A\00"
define i32 @warterm_hilite(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [7 x i8] c"H\01%d\01\0A\00"
define i32 @warterm_hilite(i32 returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
setuid(u) { return setreuid(u, u); }


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

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

LLVM IR (-O0):
define i32 @setuid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @setreuid to i32 (i32, i32, ...)*)(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @setuid(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @setreuid to i32 (i32, i32, ...)*)(i32 %0, i32 %0)
ret i32 %2
}
int dbg_check_synced_i_size(struct inode *inode) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @dbg_check_synced_i_size(%struct.inode* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
__attribute__((unused)) size_t ZBUFFv06_limitCopy(void *dst, size_t dstCapacity,
                                                  const void *src,
                                                  size_t srcSize) {
  size_t length = ((dstCapacity) < (srcSize) ? (dstCapacity) : (srcSize));
  memcpy(dst, src, length);
  return length;
}


x86 assembly (clang, -O0):
<ZBUFFv06_limitCopy>:
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    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1143 <ZBUFFv06_limitCopy+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    114b <ZBUFFv06_limitCopy+0x3b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZBUFFv06_limitCopy>:
push   %rbx
mov    %rcx,%rbx
cmp    %rcx,%rsi
cmovb  %rsi,%rbx
mov    %rdx,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @ZBUFFv06_limitCopy(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i64, i64* %6
%11 = load i64, i64* %8
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i64, i64* %6
br label %17
15: ; preds = %4
%16 = load i64, i64* %8
br label %17
17: ; preds = %15, %13
%18 = phi i64 [ %14, %13 ], [ %16, %15 ]
store i64 %18, i64* %9
%19 = load i8*, i8** %5
%20 = load i8*, i8** %7
%21 = load i64, i64* %9
%22 = call i32 @memcpy(i8* %19, i8* %20, i64 %21)
%23 = load i64, i64* %9
ret i64 %23
}

LLVM IR (-O2):
define i64 @ZBUFFv06_limitCopy(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = icmp ult i64 %1, %3
%6 = select i1 %5, i64 %1, i64 %3
%7 = tail call i32 @memcpy(i8* %0, i8* %2, i64 %6)
ret i64 %6
}
int __attribute__((cold)) foo(int a) {
  if (a == 1729)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x6c1,-0x8(%rbp)
jne    1120 <foo+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1127 <foo+0x27>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0x6c1,%edi
setne  %al
ret
nopl   0x0(%rax)

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp ne i32 %0, 1729
%3 = zext i1 %2 to i32
ret i32 %3
}
void harmonic_value(const double r, const double *p, double *f) {
  *f = p[0] * (r - p[1]) * (r - p[1]);
}


x86 assembly (clang, -O0):
<harmonic_value>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<harmonic_value>:
subsd  0x8(%rdi),%xmm0
movsd  (%rdi),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @harmonic_value(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double, double* %4
%11 = load double*, double** %5
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fsub double %10, %13
%15 = fmul double %9, %14
%16 = load double, double* %4
%17 = load double*, double** %5
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fsub double %16, %19
%21 = fmul double %15, %20
%22 = load double*, double** %6
store double %21, double* %22
ret void
}

LLVM IR (-O2):
define void @harmonic_value(double %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = fsub double %0, %6
%8 = fmul double %4, %7
%9 = fmul double %7, %8
store double %9, double* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ NID_ripemd160;
int jksengine_digests_update(int /*<<< orphan*/ *, void const *, unsigned long,
                             int /*<<< orphan*/);
int jksengine_ripemd160_update(EVP_MD_CTX *ctx, const void *data,
                               unsigned long count) {
  ;
  return (jksengine_digests_update(ctx, data, count, NID_ripemd160));
}


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

x86 assembly (clang, -O2):
<jksengine_ripemd160_update>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <jksengine_digests_update@plt>

LLVM IR (-O0):
@NID_ripemd160 = global i32 0
define i32 @jksengine_ripemd160_update(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i32, i32* @NID_ripemd160
%11 = call i32 @jksengine_digests_update(i32* %7, i8* %8, i64 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@NID_ripemd160 = global i32 0
define i32 @jksengine_ripemd160_update(i32* %0, i8* %1, i64 %2) {
%4 = load i32, i32* @NID_ripemd160
%5 = tail call i32 @jksengine_digests_update(i32* %0, i8* %1, i64 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int sum(int, int);
int main(int argc, char *argv[]) {
  printf("max "
         "thread = %d\n",
         10);
  int mysum, a, b;
  a = 9, b = 2;
  mysum = sum(a, b);
  printf("%d + %d = %d\n", a, b, mysum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x9,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1040 <sum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x9,%edi
mov    $0x2,%esi
call   1040 <sum@plt>
lea    0xec7(%rip),%rdi
mov    $0x9,%esi
mov    $0x2,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"max thread = %d\0A\00"
@.str.1 = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 10)
store i32 9, i32* %7
store i32 2, i32* %8
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i32 @sum(i32 %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %6
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"max thread = %d\0A\00"
@.str.1 = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = tail call i32 @sum(i32 9, i32 2)
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 9, i32 2, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int /*<<< orphan*/);
void putmsg(int f, void *p, void *p2, void *p3) { sleep(0); }


x86 assembly (clang, -O0):
<putmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %edi,%edi
call   1030 <sleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putmsg>:
xor    %edi,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @putmsg(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = call i32 @sleep(i32 0)
ret void
}

LLVM IR (-O2):
define void @putmsg(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 @sleep(i32 0)
ret void
}
void init_fm_king(int fm[][2]) {
  int i;
  for (i = 0; i < 12; i++) {
    fm[i][0] = -1;
    fm[i][1] = -1;
  }
}


x86 assembly (clang, -O0):
<init_fm_king>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xc,-0xc(%rbp)
jge    1146 <init_fm_king+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,0x4(%rax,%rcx,8)
ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init_fm_king+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_fm_king>:
pcmpeqd %xmm0,%xmm0
movdqu %xmm0,0x50(%rdi)
movdqu %xmm0,0x40(%rdi)
movdqu %xmm0,0x30(%rdi)
movdqu %xmm0,0x20(%rdi)
movdqu %xmm0,0x10(%rdi)
movdqu %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @init_fm_king([2 x i32]* nocapture writeonly %0) {
%2 = bitcast [2 x i32]* %0 to i8*
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void nn_puts(uint8_t *buf, uint16_t val) {
  buf[0] = (uint8_t)(((val) >> 8) & 0xff);
  buf[1] = (uint8_t)(val & 0xff);
}


x86 assembly (clang, -O0):
<nn_puts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_puts>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %rcx,(%rdi)
movzbl %al,%eax
mov    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @nn_puts(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 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = sext i32 %7 to i64
%9 = load i64*, i64** %3
%10 = getelementptr inbounds i64, i64* %9, i64 0
store i64 %8, i64* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = sext i32 %12 to i64
%14 = load i64*, i64** %3
%15 = getelementptr inbounds i64, i64* %14, i64 1
store i64 %13, i64* %15
ret void
}

LLVM IR (-O2):
define void @nn_puts(i64* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = zext i32 %4 to i64
store i64 %5, i64* %0
%6 = and i32 %1, 255
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %0, i64 1
store i64 %7, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void printd(int number) {
  if (number < 0) {
    putchar('-');
    number = -number;
  }
  if (number / 10)
    printd(number / 10);
  putchar(number % 10 + '0');
}


x86 assembly (clang, -O0):
<printd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1147 <printd+0x27>
mov    $0x2d,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     116d <printd+0x4d>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <printd@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printd>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
jns    1136 <printd+0x16>
mov    $0x2d,%edi
call   1030 <putchar@plt>
neg    %ebx
mov    %ebx,%r14d
cmp    $0xa,%ebx
jb     1150 <printd+0x30>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1040 <printd@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @printd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @putchar(i32 45)
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %9
9: ; preds = %5, %1
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %2
%15 = sdiv i32 %14, 10
br label %16
16: ; preds = %13, %9
%17 = load i32, i32* %2
%18 = srem i32 %17, 10
%19 = add nsw i32 %18, 48
%20 = call i32 @putchar(i32 %19)
ret void
}

LLVM IR (-O2):
define void @printd(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @putchar(i32 45)
%5 = sub nsw i32 0, %0
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
%8 = icmp ult i32 %7, 10
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = udiv i32 %7, 10
tail call void @printd(i32 %10)
br label %11
11: ; preds = %9, %6
%12 = urem i32 %7, 10
%13 = or i32 %12, 48
%14 = tail call i32 @putchar(i32 %13)
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *path_get_extension(const char *path) {
  const char *ext = strrchr(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
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <path_get_extension+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <path_get_extension+0x45>
lea    0xeaf(%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
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
lea    0xed7(%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 i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %13
12: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %13
13: ; preds = %12, %9
%14 = load i8*, i8** %2
ret i8* %14
}

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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pr_array2@plt>
mov    $0x0,%al
call   1040 <find_biggest@plt>
mov    $0x0,%al
call   1030 <pr_array2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <pr_array2@plt>
xor    %eax,%eax
call   1040 <find_biggest@plt>
xor    %eax,%eax
call   1030 <pr_array2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i32 (...) @pr_array2()
%3 = call i32 (...) @find_biggest()
%4 = call i32 (...) @pr_array2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pr_array2()
%2 = tail call i32 (...) @find_biggest()
%3 = tail call i32 (...) @pr_array2()
ret i32 0
}
/* Variables and functions */
size_t GetOpenMPMaximumThreads(void) {
  static size_t maximum_threads = 1;
  return (maximum_threads);
}


x86 assembly (clang, -O0):
<GetOpenMPMaximumThreads>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@GetOpenMPMaximumThreads.maximum_threads = internal global i64 1
define i64 @GetOpenMPMaximumThreads() {
%1 = load i64, i64* @GetOpenMPMaximumThreads.maximum_threads
ret i64 %1
}

LLVM IR (-O2):
define i64 @GetOpenMPMaximumThreads() {
ret i64 1
}
int in_def_set_config(void *drv_data, int what, int val) { return -1; }


x86 assembly (clang, -O0):
<in_def_set_config>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @in_def_set_config(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @in_def_set_config(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t bmin_uint32(uint32_t a, uint32_t b) { return (a < b ? a : b); }


x86 assembly (clang, -O0):
<bmin_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <bmin_uint32+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <bmin_uint32+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmin_uint32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @bmin_uint32(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 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @bmin_uint32(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int xor3(int i, int j) { return ((i + j) % 3) ? 0 : 1; }


x86 assembly (clang, -O0):
<xor3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor3>:
add    %esi,%edi
imul   $0xaaaaaaab,%edi,%ecx
add    $0x2aaaaaaa,%ecx
xor    %eax,%eax
cmp    $0x55555555,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @xor3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = srem i32 %7, 3
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 1
ret i32 %11
}

LLVM IR (-O2):
define i32 @xor3(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = srem i32 %3, 3
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XSelectionEvent;

/* Variables and functions */
unsigned long get_XSelectionEvent_serial(void *_p) {
  return (unsigned long)((XSelectionEvent *)_p)->serial;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XSelectionEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int cdAppByte(unsigned char *es, short int addme) {
  *es = (unsigned char)addme & 0377;
  return 1;
}


x86 assembly (clang, -O0):
<cdAppByte>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%ax
movzbl %al,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cdAppByte(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = trunc i16 %5 to i8
%7 = zext i8 %6 to i32
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
ret i32 1
}

LLVM IR (-O2):
define i32 @cdAppByte(i8* nocapture writeonly %0, i16 signext %1) {
%3 = trunc i16 %1 to i8
store i8 %3, i8* %0
ret i32 1
}
float per_paralilog(float mik, float plat) { return 2 * mik + 2 * plat; }


x86 assembly (clang, -O0):
<per_paralilog>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee5(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<per_paralilog>:
addss  %xmm1,%xmm1
addss  %xmm0,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @per_paralilog(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 = fmul float 2.000000e+00, %6
%8 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %5, float %7)
ret float %8
}

LLVM IR (-O2):
define float @per_paralilog(float %0, float %1) {
%3 = fmul float %1, 2.000000e+00
%4 = tail call float @llvm.fmuladd.f32(float %0, float 2.000000e+00, float %3)
ret float %4
}
char *tsi2fd(isec)
int isec;
{ return (ts2fd(tsi2ts(isec))); }


x86 assembly (clang, -O0):
<tsi2fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <tsi2ts@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <ts2fd@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsi2fd>:
push   %rax
xor    %eax,%eax
call   1030 <tsi2ts@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <ts2fd@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @tsi2fd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @tsi2ts to i32 (i32, ...)*)(i32 %3)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @ts2fd to i32 (i32, ...)*)(i32 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @tsi2fd(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @tsi2ts to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @ts2fd to i32 (i32, ...)*)(i32 %2)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
unsigned char readBit(unsigned char data, int position) {
  unsigned char bit = data & (1 << position);
  if (bit != 0)
    bit = 1;
  return bit;
}


x86 assembly (clang, -O0):
<readBit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
je     1133 <readBit+0x33>
movb   $0x1,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readBit>:
bt     %esi,%edi
setb   %al
ret

LLVM IR (-O0):
define zeroext i8 @readBit(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i8
store i8 %0, i8* %3
store i32 %1, i32* %4
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = load i32, i32* %4
%9 = shl i32 1, %8
%10 = and i32 %7, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %5
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %2
store i8 1, i8* %5
br label %16
16: ; preds = %15, %2
%17 = load i8, i8* %5
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @readBit(i8 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i8
%5 = and i8 %4, %0
%6 = icmp ne i8 %5, 0
%7 = zext i1 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
int main() {
  unsigned int i = 0;
  for (; i <= 255; i++)
    printf("%c:%d\n", i, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
ja     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c:%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
int test_imm_10uint8_mem(unsigned char *val) {
  return ((*val) & (-0x10 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_10uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xfffffff0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_10uint8_mem>:
cmpb   $0x10,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_10uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 16
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int min2(int, int);
int min3(int a, int b, int c) { return min2(min2(a, b), c); }


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

x86 assembly (clang, -O2):
<min3>:
push   %rbx
mov    %edx,%ebx
call   1030 <min2@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <min2@plt>

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

LLVM IR (-O2):
define i32 @min3(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @min2(i32 %0, i32 %1)
%5 = tail call i32 @min2(i32 %4, i32 %2)
ret i32 %5
}
/* Type definitions */
typedef int __int64_t;

/* Variables and functions */
int sqr(int);
__int64_t power2(int n) {
  if (n == 0) {
    return 1;
  }
  return (n & 1) ? sqr(power2(n >> 1)) << 1 : sqr(power2(n >> 1));
}


x86 assembly (clang, -O0):
<power2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <power2+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1188 <power2+0x68>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     116d <power2+0x4d>
mov    -0x8(%rbp),%edi
sar    $0x1,%edi
call   1030 <power2@plt>
mov    %eax,%edi
call   1040 <sqr@plt>
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1182 <power2+0x62>
mov    -0x8(%rbp),%edi
sar    $0x1,%edi
call   1030 <power2@plt>
mov    %eax,%edi
call   1040 <sqr@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power2>:
test   %edi,%edi
je     113e <power2+0x1e>
push   %rbx
mov    %edi,%ebx
sar    %edi
call   1030 <power2@plt>
mov    %eax,%edi
call   1040 <sqr@plt>
and    $0x1,%bl
mov    %ebx,%ecx
shl    %cl,%eax
pop    %rbx
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @power2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %24
7: ; preds = %1
%8 = load i32, i32* %3
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32, i32* %3
%13 = ashr i32 %12, 1
%14 = call i32 @power2(i32 %13)
%15 = call i32 @sqr(i32 %14)
%16 = shl i32 %15, 1
br label %22
17: ; preds = %7
%18 = load i32, i32* %3
%19 = ashr i32 %18, 1
%20 = call i32 @power2(i32 %19)
%21 = call i32 @sqr(i32 %20)
br label %22
22: ; preds = %17, %11
%23 = phi i32 [ %16, %11 ], [ %21, %17 ]
store i32 %23, i32* %2
br label %24
24: ; preds = %22, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @power2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = ashr i32 %0, 1
%6 = tail call i32 @power2(i32 %5)
%7 = tail call i32 @sqr(i32 %6)
%8 = shl i32 %7, %4
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %8, %3 ]
ret i32 %10
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("The value of EOF is %d\n\n", EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"The value of EOF is %d\0A\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @EOF
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"The value of EOF is %d\0A\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}