xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fg_queue_put(void *, void *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *fg_producer(void *queue) {
  for (long i = 0; i < 5000000; ++i)
    fg_queue_put(queue, (void *)1);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<fg_producer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x4c4b40,-0x18(%rbp)
jge    1161 <fg_producer+0x41>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <fg_queue_put@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <fg_producer+0x14>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fg_producer>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x4c4b40,%ebx
nopl   0x0(%rax)
mov    $0x1,%esi
mov    %r14,%rdi
call   1030 <fg_queue_put@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <fg_producer+0x10>
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @fg_producer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 0, i64* %4
br label %5
5: ; preds = %11, %1
%6 = load i64, i64* %4
%7 = icmp slt i64 %6, 5000000
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = call i32 @fg_queue_put(i8* %9, i8* inttoptr (i64 1 to i8*))
br label %11
11: ; preds = %8
%12 = load i64, i64* %4
%13 = add nsw i64 %12, 1
store i64 %13, i64* %4
br label %5
14: ; preds = %5
%15 = call i32 @pthread_exit(i32* null)
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define noalias i8* @fg_producer(i8* %0) {
br label %4
2: ; preds = %4
%3 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %7, %4 ]
%6 = tail call i32 @fg_queue_put(i8* %0, i8* inttoptr (i64 1 to i8*))
%7 = add nuw nsw i64 %5, 1
%8 = icmp eq i64 %7, 5000000
br i1 %8, label %2, label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
char *ReadFirstLineInFile(char *fileName) {
  FILE *listLog;
  char buffer[4096];
  listLog = fopen(fileName, "r");
  if (listLog == NULL)
    return NULL;
  fgets(buffer, 4096, listLog);
  return buffer;
}


x86 assembly (clang, -O0):
<ReadFirstLineInFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115b <ReadFirstLineInFile+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    117b <ReadFirstLineInFile+0x5b>
lea    -0x1020(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x1000,%esi
call   1030 <fgets@plt>
lea    -0x1020(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadFirstLineInFile>:
push   %rbx
sub    $0x1000,%rsp
lea    0xed1(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     114e <ReadFirstLineInFile+0x2e>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1000,%esi
mov    %rax,%rdx
call   1030 <fgets@plt>
jmp    1150 <ReadFirstLineInFile+0x30>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x1000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i8* @ReadFirstLineInFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [4096 x i8]
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* null, i8** %2
br label %16
11: ; preds = %1
%12 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%13 = load i32*, i32** %4
%14 = call i32 @fgets(i8* %12, i32 4096, i32* %13)
%15 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
store i8* %15, i8** %2
br label %16
16: ; preds = %11, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i8* @ReadFirstLineInFile(i8* nocapture %0) {
%2 = alloca [4096 x i8]
%3 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @fgets(i8* %3, i32 4096, i32* %4)
br label %8
8: ; preds = %1, %6
%9 = phi i8* [ %3, %6 ], [ null, %1 ]
ret i8* %9
}
int size_boat(char *str) {
  if (str[0] - '0' < 2 || str[0] - 48 > 5)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<size_boat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
cmp    $0x2,%eax
jl     112e <size_boat+0x2e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
cmp    $0x5,%eax
jle    113a <size_boat+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <size_boat+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_boat>:
mov    (%rdi),%al
add    $0xca,%al
cmp    $0xfc,%al
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @size_boat(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -54
%4 = icmp ult i8 %3, -4
%5 = sext i1 %4 to i32
ret i32 %5
}
unsigned get_page_shift() { return 12; }


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

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

LLVM IR (-O0):
define i32 @get_page_shift() {
ret i32 12
}

LLVM IR (-O2):
define i32 @get_page_shift() {
ret i32 12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_message(void) { printf("hello\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @show_message() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void seedrand(void) { srand(time(NULL)); }


x86 assembly (clang, -O0):
<seedrand>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @seedrand() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @seedrand() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun2();
int /*<<< orphan*/ printf(char *);
fun1() {
  printf("fflag 1");
  fun2();
}


x86 assembly (clang, -O0):
<fun1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <fun2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <fun2@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"fflag 1\00"
define i32 @fun1() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @fun2()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"fflag 1\00"
define i32 @fun1() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @fun2()
ret i32 undef
}
void ff_hevc_put_hevc_pel_pixels32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels32_12_sse4() {
ret void
}
void RTMemAllocZVarTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemAllocZVarTag() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int main(void) { return sysconf(_SC_NPROCESSORS_ONLN); }


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

x86 assembly (clang, -O2):
<main>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @_SC_NPROCESSORS_ONLN
%3 = call i32 @sysconf(i32 %2)
ret i32 %3
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @main() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ map_islegalvert(int);
int marker_right(int pos) {
  do {
    pos += 1;
    if (pos > 63)
      pos = 2;
  } while (!map_islegalvert(pos));
  return pos;
}


x86 assembly (clang, -O0):
<marker_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x3f,-0x4(%rbp)
jle    1135 <marker_right+0x25>
movl   $0x2,-0x4(%rbp)
jmp    113a <marker_right+0x2a>
mov    -0x4(%rbp),%edi
call   1030 <map_islegalvert@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    111b <marker_right+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<marker_right>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x2,%ebp
nopw   0x0(%rax,%rax,1)
cmp    $0x3f,%ebx
lea    0x1(%rbx),%eax
mov    %eax,%ebx
cmovge %ebp,%ebx
mov    %ebx,%edi
call   1030 <map_islegalvert@plt>
test   %eax,%eax
je     1120 <marker_right+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @marker_right(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %10, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 63
br i1 %7, label %8, label %9
8: ; preds = %3
store i32 2, i32* %2
br label %9
9: ; preds = %8, %3
br label %10
10: ; preds = %9
%11 = load i32, i32* %2
%12 = call i32 @map_islegalvert(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br i1 %14, label %3, label %15
15: ; preds = %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @marker_right(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = add nsw i32 %3, 1
%5 = icmp sgt i32 %3, 62
%6 = select i1 %5, i32 2, i32 %4
%7 = tail call i32 @map_islegalvert(i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %2, label %9
9: ; preds = %2
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ u_quad_t;
typedef int /*<<< orphan*/ quad_t;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ xdr_u_quad_t(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool_t xdr_quad_t(XDR *xdrs, quad_t *llp) {
  return xdr_u_quad_t(xdrs, (u_quad_t *)llp);
}


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

x86 assembly (clang, -O2):
<xdr_quad_t>:
jmp    1030 <xdr_u_quad_t@plt>

LLVM IR (-O0):
define i32 @xdr_quad_t(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 = call i32 @xdr_u_quad_t(i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @xdr_quad_t(i32* %0, i32* %1) {
%3 = tail call i32 @xdr_u_quad_t(i32* %0, i32* %1)
ret i32 %3
}
/* Type definitions */
struct tls_config {
  int dummy;
};

/* Variables and functions */
void *tls_init(const struct tls_config *conf) { return (void *)1; }


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

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

LLVM IR (-O0):
%struct.tls_config = type { i32 }
define i8* @tls_init(%struct.tls_config* %0) {
%2 = alloca %struct.tls_config*
store %struct.tls_config* %0, %struct.tls_config** %2
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
%struct.tls_config = type { i32 }
define i8* @tls_init(%struct.tls_config* nocapture readnone %0) {
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ irc_join_channel(char *);
void irc_welcome_event(void) { irc_join_channel("#meds"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"#meds\00"
define void @irc_welcome_event() {
%1 = call i32 @irc_join_channel(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"#meds\00"
define void @irc_welcome_event() {
%1 = tail call i32 @irc_join_channel(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void adts_set_fullness(uint8_t *p_adts, uint16_t i_fullness) {
  p_adts[5] &= ~0x1f;
  p_adts[5] |= (i_fullness >> 6) & 0x1f;
  p_adts[6] &= ~0xfc;
  p_adts[6] |= (i_fullness << 2) & 0xfc;
}


x86 assembly (clang, -O0):
<adts_set_fullness>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
and    $0xffffffe0,%ecx
mov    %ecx,0x14(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x6,%ecx
and    $0x1f,%ecx
mov    -0x8(%rbp),%rax
or     0x14(%rax),%ecx
mov    %ecx,0x14(%rax)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
and    $0xffffff03,%ecx
mov    %ecx,0x18(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
and    $0xfc,%ecx
mov    -0x8(%rbp),%rax
or     0x18(%rax),%ecx
mov    %ecx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adts_set_fullness>:
mov    0x14(%rdi),%eax
and    $0xffffffe0,%eax
mov    %esi,%ecx
shr    $0x6,%ecx
and    $0x1f,%ecx
or     %eax,%ecx
mov    %ecx,0x14(%rdi)
mov    $0xffffff03,%eax
and    0x18(%rdi),%eax
and    $0x3f,%esi
lea    (%rax,%rsi,4),%eax
mov    %eax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @adts_set_fullness(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 = getelementptr inbounds i32, i32* %5, i64 5
%7 = load i32, i32* %6
%8 = and i32 %7, -32
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = ashr i32 %9, 6
%11 = and i32 %10, 31
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 5
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 6
%18 = load i32, i32* %17
%19 = and i32 %18, -253
store i32 %19, i32* %17
%20 = load i32, i32* %4
%21 = shl i32 %20, 2
%22 = and i32 %21, 252
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 6
%25 = load i32, i32* %24
%26 = or i32 %25, %22
store i32 %26, i32* %24
ret void
}

LLVM IR (-O2):
define void @adts_set_fullness(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 5
%4 = load i32, i32* %3
%5 = and i32 %4, -32
%6 = lshr i32 %1, 6
%7 = and i32 %6, 31
%8 = or i32 %5, %7
store i32 %8, i32* %3
%9 = getelementptr inbounds i32, i32* %0, i64 6
%10 = load i32, i32* %9
%11 = and i32 %10, -253
%12 = shl i32 %1, 2
%13 = and i32 %12, 252
%14 = or i32 %11, %13
store i32 %14, i32* %9
ret void
}
/* Variables and functions */
char getchar();
char *str_dup(char *);
char *input_str() {
  char buffer[4096];
  int i;
  for (i = 0; (buffer[i] = getchar()) != '\n'; i++)
    ;
  buffer[i] = '\0';
  return str_dup(buffer);
}


x86 assembly (clang, -O0):
<input_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x0,-0x1004(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
movslq -0x1004(%rbp),%rcx
mov    %al,-0x1000(%rbp,%rcx,1)
movsbl %al,%eax
cmp    $0xa,%eax
je     116f <input_str+0x4f>
jmp    115b <input_str+0x3b>
mov    -0x1004(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1004(%rbp)
jmp    1135 <input_str+0x15>
movslq -0x1004(%rbp),%rax
movb   $0x0,-0x1000(%rbp,%rax,1)
lea    -0x1000(%rbp),%rdi
call   1040 <str_dup@plt>
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_str>:
push   %rbx
sub    $0x1000,%rsp
mov    $0xffffffffffffffff,%rbx
nop
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %al,0x1(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0xa,%al
jne    1130 <input_str+0x10>
mov    %ebx,%eax
movb   $0x0,(%rsp,%rax,1)
mov    %rsp,%rdi
call   1040 <str_dup@plt>
add    $0x1000,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @input_str() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ %8, %3 ], [ 0, %0 ]
%5 = tail call signext i8 (...) @getchar()
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 %4
store i8 %5, i8* %6
%7 = icmp eq i8 %5, 10
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = and i64 %4, 4294967295
%11 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 %10
store i8 0, i8* %11
%12 = call i8* @str_dup(i8* %2)
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int Mexitq(int nargs, int *args) { exit(0); }


x86 assembly (clang, -O0):
<Mexitq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<Mexitq>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @Mexitq(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @Mexitq(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  printf("PID : %d\n", getpid());
  printf("PPID : %d\n", getppid());
  char *p;
  scanf("%s", p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getppid@plt>
mov    %eax,%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getppid@plt>
lea    0xe9c(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xe99(%rip),%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"PID : %d\0A\00"
@.str.1 = [11 x i8] c"PPID : %d\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @getppid()
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"PID : %d\0A\00"
@.str.1 = [11 x i8] c"PPID : %d\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getppid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* undef)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *timestamp(void) {
  time_t now;
  time(&now);
  static char buf[sizeof("2011-10-08T07:07:09Z")];
  strftime(buf, sizeof(buf), "%FT%TZ", gmtime(&now));
  return buf;
}


x86 assembly (clang, -O0):
<timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <time@plt>
lea    -0x4(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %eax,%ecx
lea    0x2efd(%rip),%rdi
mov    $0x15,%esi
lea    0xea1(%rip),%rdx
call   1040 <strftime@plt>
lea    0x2ee5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <time@plt>
mov    %rbx,%rdi
call   1050 <gmtime@plt>
lea    0x2eff(%rip),%rbx
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x15,%esi
mov    %eax,%ecx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@timestamp.buf = internal global [21 x i8] zeroinitializer
@.str = [7 x i8] c"%FT%TZ\00"
define i8* @timestamp() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
%3 = call i32 @gmtime(i32* %1)
%4 = call i32 @strftime(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @timestamp.buf, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @timestamp.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@timestamp.buf = internal global [21 x i8] zeroinitializer
@.str = [7 x i8] c"%FT%TZ\00"
define i8* @timestamp() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call i32 @gmtime(i32* %1)
%5 = call i32 @strftime(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @timestamp.buf, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @timestamp.buf, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_mul_sd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_mul_sd(__m128d A, __m128d B) { return _mm_mul_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_mul_sd>:
jmp    1030 <_mm_mul_sd@plt>

LLVM IR (-O0):
define i32 @test_mm_mul_sd(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 = call i32 @_mm_mul_sd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_mul_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_mul_sd(i32 %0, i32 %1)
ret i32 %3
}
char *dis_rmdash(char *s) {
  s++;
  for (; (*s == ' ') || (*s == '\t'); s++)
    ;
  return s;
}


x86 assembly (clang, -O0):
<dis_rmdash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1139 <dis_rmdash+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1149 <dis_rmdash+0x49>
jmp    115f <dis_rmdash+0x5f>
jmp    114e <dis_rmdash+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <dis_rmdash+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dis_rmdash>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <dis_rmdash+0x10>
cmp    $0x9,%cl
je     1110 <dis_rmdash+0x10>
ret

LLVM IR (-O0):
define i8* @dis_rmdash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i32 1
store i8* %4, i8** %2
br label %5
5: ; preds = %18, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 32
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 9
br label %15
15: ; preds = %10, %5
%16 = phi i1 [ true, %5 ], [ %14, %10 ]
br i1 %16, label %17, label %21
17: ; preds = %15
br label %18
18: ; preds = %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %5
21: ; preds = %15
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @dis_rmdash(i8* %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %4, %6 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %2, %2
br label %2
7: ; preds = %2
ret i8* %4
}
/* Variables and functions */
bool nrf53_errata_59(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_59() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HDR_WriteBinaryFile(unsigned char *, unsigned long, int,
                                       unsigned long);
void HDR_Translate(unsigned char *pHDRMsg, unsigned long ulMsgLen,
                   unsigned long ulScanId) {
  HDR_WriteBinaryFile(pHDRMsg, ulMsgLen, 1, ulScanId);
}


x86 assembly (clang, -O0):
<HDR_Translate>:
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),%rcx
mov    $0x1,%edx
call   1030 <HDR_WriteBinaryFile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HDR_Translate>:
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <HDR_WriteBinaryFile@plt>

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

LLVM IR (-O2):
define void @HDR_Translate(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @HDR_WriteBinaryFile(i8* %0, i64 %1, i32 1, i64 %2)
ret void
}
/* Variables and functions */
size_t SIZE_MAX;
int /*<<< orphan*/ assert(int);
size_t small_align(size_t size, size_t alignment) {
  assert((alignment & (alignment - 1)) == 0);
  assert(size <= SIZE_MAX - alignment);
  return (size - 1 + alignment) & ~(alignment - 1);
}


x86 assembly (clang, -O0):
<small_align>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    0x2e8d(%rip),%rcx
mov    (%rcx),%rcx
sub    -0x10(%rbp),%rcx
cmp    %rcx,%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
add    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<small_align>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    -0x1(%rsi),%rax
xor    %edi,%edi
test   %rax,%rsi
sete   %dil
call   1030 <assert@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%rax
sub    %rbx,%rax
xor    %edi,%edi
cmp    %r14,%rax
setae  %dil
call   1030 <assert@plt>
lea    (%r14,%rbx,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rbx
and    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIZE_MAX = global i64 0
define i64 @small_align(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %4
%7 = sub i64 %6, 1
%8 = and i64 %5, %7
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* %3
%13 = load i64, i64* @SIZE_MAX
%14 = load i64, i64* %4
%15 = sub i64 %13, %14
%16 = icmp ule i64 %12, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i64, i64* %3
%20 = sub i64 %19, 1
%21 = load i64, i64* %4
%22 = add i64 %20, %21
%23 = load i64, i64* %4
%24 = sub i64 %23, 1
%25 = xor i64 %24, -1
%26 = and i64 %22, %25
ret i64 %26
}

LLVM IR (-O2):
@SIZE_MAX = global i64 0
define i64 @small_align(i64 %0, i64 %1) {
%3 = tail call i64 @llvm.ctpop.i64(i64 %1)
%4 = icmp ult i64 %3, 2
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i64, i64* @SIZE_MAX
%8 = sub i64 %7, %1
%9 = icmp uge i64 %8, %0
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = add i64 %0, -1
%13 = add i64 %12, %1
%14 = sub i64 0, %1
%15 = and i64 %13, %14
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
int getname();
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void other(void) {
  char outputstr[32];
  snprintf(outputstr, 32, "%c", getname());
  emitln(outputstr);
}


x86 assembly (clang, -O0):
<other>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <getname@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%ecx
mov    $0x20,%esi
lea    0xea7(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <emitln@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<other>:
push   %rbx
sub    $0x20,%rsp
xor    %eax,%eax
call   1050 <getname@plt>
lea    0xebd(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %eax,%ecx
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <emitln@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @other() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 (...) @getname()
%4 = call i32 @snprintf(i8* %2, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%6 = call i32 @emitln(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @other() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @getname()
%4 = call i32 @snprintf(i8* %2, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @emitln(i8* %2)
ret void
}
int a_eflip_pack(array_in)
int array_in[12];
{
  int eflip, ii;
  eflip = 0;
  for (ii = 10; ii >= 0; ii--)
    eflip = 2 * eflip + array_in[ii];
  return eflip;
}


x86 assembly (clang, -O0):
<a_eflip_pack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1142 <a_eflip_pack+0x42>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <a_eflip_pack+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_eflip_pack>:
mov    0x28(%rdi),%eax
add    %eax,%eax
add    0x24(%rdi),%eax
add    %eax,%eax
add    0x20(%rdi),%eax
add    %eax,%eax
add    0x1c(%rdi),%eax
add    %eax,%eax
add    0x18(%rdi),%eax
add    %eax,%eax
add    0x14(%rdi),%eax
add    %eax,%eax
add    0x10(%rdi),%eax
add    %eax,%eax
add    0xc(%rdi),%eax
add    %eax,%eax
add    0x8(%rdi),%eax
add    %eax,%eax
add    0x4(%rdi),%eax
add    %eax,%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @a_eflip_pack(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 10
%3 = load i32, i32* %2
%4 = shl nsw i32 %3, 1
%5 = getelementptr inbounds i32, i32* %0, i64 9
%6 = load i32, i32* %5
%7 = add nsw i32 %6, %4
%8 = shl nsw i32 %7, 1
%9 = getelementptr inbounds i32, i32* %0, i64 8
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
%12 = shl nsw i32 %11, 1
%13 = getelementptr inbounds i32, i32* %0, i64 7
%14 = load i32, i32* %13
%15 = add nsw i32 %14, %12
%16 = shl nsw i32 %15, 1
%17 = getelementptr inbounds i32, i32* %0, i64 6
%18 = load i32, i32* %17
%19 = add nsw i32 %18, %16
%20 = shl nsw i32 %19, 1
%21 = getelementptr inbounds i32, i32* %0, i64 5
%22 = load i32, i32* %21
%23 = add nsw i32 %22, %20
%24 = shl nsw i32 %23, 1
%25 = getelementptr inbounds i32, i32* %0, i64 4
%26 = load i32, i32* %25
%27 = add nsw i32 %26, %24
%28 = shl nsw i32 %27, 1
%29 = getelementptr inbounds i32, i32* %0, i64 3
%30 = load i32, i32* %29
%31 = add nsw i32 %30, %28
%32 = shl nsw i32 %31, 1
%33 = getelementptr inbounds i32, i32* %0, i64 2
%34 = load i32, i32* %33
%35 = add nsw i32 %34, %32
%36 = shl nsw i32 %35, 1
%37 = getelementptr inbounds i32, i32* %0, i64 1
%38 = load i32, i32* %37
%39 = add nsw i32 %38, %36
%40 = shl nsw i32 %39, 1
%41 = load i32, i32* %0
%42 = add nsw i32 %41, %40
ret i32 %42
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void c_begin(void) {
  printf(" /*\n"
         "  * File generated by 'config'\n"
         "  *\n"
         "  * ### DO NOT EDIT THIS FILE DIRECTLY ###\n"
         "  * ###     IT WILL BE OVERWRITTEN     ###\n"
         "  */\n"
         "#ifndef INCLUDE_GEN_CONFIG_H\n"
         "#define INCLUDE_GEN_CONFIG_H\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [190 x i8] c" /*\0A * File generated by 'config'\0A *\0A * ### DO NOT EDIT THIS FILE DIRECTLY ###\0A * ### IT WILL BE OVERWRITTEN ###\0A */\0A#ifndef INCLUDE_GEN_CONFIG_H\0A#define INCLUDE_GEN_CONFIG_H\0A\0A\00"
define void @c_begin() {
%1 = call i32 @printf(i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [189 x i8] c" /*\0A * File generated by 'config'\0A *\0A * ### DO NOT EDIT THIS FILE DIRECTLY ###\0A * ### IT WILL BE OVERWRITTEN ###\0A */\0A#ifndef INCLUDE_GEN_CONFIG_H\0A#define INCLUDE_GEN_CONFIG_H\0A\00"
define void @c_begin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([189 x i8], [189 x i8]* @str, i64 0, i64 0))
ret void
}
int _decodestate(int r, int c, char state) {
  int output, code;
  code = 0;
  if ((state & 0x04) == 0x04) {
    if ((state & 0x10) == 0x10)
      code = -1;
    else
      code = 1;
  } else
    code = 0;
  return code;
}


x86 assembly (clang, -O0):
<_decodestate>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x14(%rbp)
movsbl -0x9(%rbp),%eax
and    $0x4,%eax
cmp    $0x4,%eax
jne    114e <_decodestate+0x4e>
movsbl -0x9(%rbp),%eax
and    $0x10,%eax
cmp    $0x10,%eax
jne    1142 <_decodestate+0x42>
movl   $0xffffffff,-0x14(%rbp)
jmp    1149 <_decodestate+0x49>
movl   $0x1,-0x14(%rbp)
jmp    1155 <_decodestate+0x55>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_decodestate>:
mov    %edx,%ecx
shl    $0x1d,%ecx
sar    $0x1f,%ecx
and    $0x10,%edx
neg    %edx
sbb    %eax,%eax
or     $0x1,%eax
and    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_decodestate(i32 %0, i32 %1, i8 signext %2) {
%4 = zext i8 %2 to i32
%5 = and i32 %4, 4
%6 = icmp eq i32 %5, 0
%7 = and i32 %4, 16
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 1, i32 -1
%10 = select i1 %6, i32 0, i32 %9
ret i32 %10
}
void PDF_LinkCheck(void) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @PDF_LinkCheck() {
ret void
}
unsigned long count(unsigned int a, unsigned int b) { return a * b; }


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i64 @count(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 = mul i32 %5, %6
%8 = zext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @count(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, long);
const char *long_to_string(long in_int) {
  static char buffer[100];
  snprintf(buffer, 100, "%ld", in_int);
  return buffer;
}


x86 assembly (clang, -O0):
<long_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0x2f19(%rip),%rdi
mov    $0x64,%esi
lea    0xecd(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2f01(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_to_string>:
push   %rbx
mov    %rdi,%rcx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rdx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@long_to_string.buffer = internal global [100 x i8] zeroinitializer
@.str = [4 x i8] c"%ld\00"
define i8* @long_to_string(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @snprintf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @long_to_string.buffer, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @long_to_string.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@long_to_string.buffer = internal global [100 x i8] zeroinitializer
@.str = [4 x i8] c"%ld\00"
define i8* @long_to_string(i64 %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @long_to_string.buffer, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @long_to_string.buffer, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
void getvarstr(char *varstr, int offset) {
  if (offset >= 0)
    sprintf(varstr, "[%s+%d]", "ebp", offset);
  else
    sprintf(varstr, "[%s%d]", "ebp", offset);
}


x86 assembly (clang, -O0):
<getvarstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1148 <getvarstr+0x38>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xec9(%rip),%rsi
lea    0xeca(%rip),%rdx
call   1030 <sprintf@plt>
jmp    1162 <getvarstr+0x52>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xeb6(%rip),%rsi
lea    0xeab(%rip),%rdx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getvarstr>:
mov    %esi,%ecx
test   %esi,%esi
lea    0xee5(%rip),%rax
lea    0xeea(%rip),%rsi
cmovns %rax,%rsi
lea    0xedb(%rip),%rdx
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"[%s+%d]\00"
@.str.1 = [4 x i8] c"ebp\00"
@.str.2 = [7 x i8] c"[%s%d]\00"
define void @getvarstr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %15
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i32 @sprintf(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"[%s+%d]\00"
@.str.1 = [4 x i8] c"ebp\00"
@.str.2 = [7 x i8] c"[%s%d]\00"
define void @getvarstr(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
%4 = select i1 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct Utmp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroyUtmp(struct Utmp *);
int /*<<< orphan*/ free(struct Utmp *);
void deleteUtmp(struct Utmp *utmp) {
  destroyUtmp(utmp);
  free(utmp);
}


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

x86 assembly (clang, -O2):
<deleteUtmp>:
push   %rbx
mov    %rdi,%rbx
call   1040 <destroyUtmp@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.Utmp = type { i32 }
define void @deleteUtmp(%struct.Utmp* %0) {
%2 = alloca %struct.Utmp*
store %struct.Utmp* %0, %struct.Utmp** %2
%3 = load %struct.Utmp*, %struct.Utmp** %2
%4 = call i32 @destroyUtmp(%struct.Utmp* %3)
%5 = load %struct.Utmp*, %struct.Utmp** %2
%6 = call i32 @free(%struct.Utmp* %5)
ret void
}

LLVM IR (-O2):
%struct.Utmp = type { i32 }
define void @deleteUtmp(%struct.Utmp* %0) {
%2 = tail call i32 @destroyUtmp(%struct.Utmp* %0)
%3 = tail call i32 @free(%struct.Utmp* %0)
ret void
}
int clamp_float(float *val, float min, float max) {
  if (*val < min) {
    *val = min;
    return 1;
  }
  if (*val > max) {
    *val = max;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<clamp_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1141 <clamp_float+0x41>
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1173 <clamp_float+0x73>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    116c <clamp_float+0x6c>
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1173 <clamp_float+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_float>:
movss  (%rdi),%xmm2
ucomiss %xmm2,%xmm0
ja     1113 <clamp_float+0x13>
xor    %eax,%eax
ucomiss %xmm1,%xmm2
movaps %xmm1,%xmm0
jbe    111c <clamp_float+0x1c>
movss  %xmm0,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp_float(float* nocapture %0, float %1, float %2) {
%4 = load float, float* %0
%5 = fcmp olt float %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = fcmp ogt float %4, %2
br i1 %7, label %8, label %10
8: ; preds = %6, %3
%9 = phi float [ %1, %3 ], [ %2, %6 ]
store float %9, float* %0
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ 0, %6 ], [ 1, %8 ]
ret i32 %11
}