xunge/DecIR huggingface dataset:
char *strsep(char **stringp, const char *delim) {
  char *s = *stringp;
  char *e;
  if (!s)
    return ((void *)0);
  e = strpbrk(s, delim);
  if (e)
    *e++ = '\0';
  *stringp = e;
  return s;
}


x86 assembly (clang, -O0):
<strsep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1143 <strsep+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1184 <strsep+0x74>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1171 <strsep+0x61>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movb   $0x0,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsep>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rbx
test   %rbx,%rbx
je     113d <strsep+0x2d>
mov    %rdi,%r14
mov    %rbx,%rdi
call   1030 <strpbrk@plt>
test   %rax,%rax
je     1138 <strsep+0x28>
mov    %rax,%rcx
add    $0x1,%rcx
movb   $0x0,(%rax)
jmp    113a <strsep+0x2a>
xor    %ecx,%ecx
mov    %rcx,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strsep(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i8* @strpbrk(i8* %3, i8* %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8 0, i8* %6
br label %10
10: ; preds = %8, %5
%11 = phi i8* [ %9, %8 ], [ null, %5 ]
store i8* %11, i8** %0
br label %12
12: ; preds = %2, %10
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fwrite(char const *, int, int, int /*<<< orphan*/ *);
int strlen(char const *);
int fputs(const char *s, FILE *stream) {
  int c, len = strlen(s);
  c = fwrite(s, 1, len, stream);
  if (c < len) {
    return EOF;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1171 <fputs+0x51>
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <fputs+0x58>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    $0x1,%r15d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1040 <fwrite@plt>
cmp    %ebp,%eax
jge    115a <fputs+0x3a>
mov    0x2e91(%rip),%rax
mov    (%rax),%r15d
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @fputs(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %7
%10 = load i8*, i8** %4
%11 = load i32, i32* %7
%12 = load i32*, i32** %5
%13 = call i32 @fwrite(i8* %10, i32 1, i32 %11, i32* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = load i32, i32* @EOF
store i32 %18, i32* %3
br label %20
19: ; preds = %2
store i32 1, i32* %3
br label %20
20: ; preds = %19, %17
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fputs(i8* %0, i32* nocapture %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @fwrite(i8* %0, i32 1, i32 %3, i32* %1)
%5 = icmp slt i32 %4, %3
%6 = load i32, i32* @EOF
%7 = select i1 %5, i32 %6, i32 1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ init_pcap_mmap(int);
int /*<<< orphan*/ init_pcap_rw(int);
int /*<<< orphan*/ init_pcap_sg(int);
int init_pcap(int jumbo_support) {
  init_pcap_rw(jumbo_support);
  init_pcap_sg(jumbo_support);
  init_pcap_mmap(jumbo_support);
  return 0;
}


x86 assembly (clang, -O0):
<init_pcap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <init_pcap_rw@plt>
mov    -0x4(%rbp),%edi
call   1040 <init_pcap_sg@plt>
mov    -0x4(%rbp),%edi
call   1050 <init_pcap_mmap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_pcap>:
push   %rbx
mov    %edi,%ebx
call   1030 <init_pcap_rw@plt>
mov    %ebx,%edi
call   1040 <init_pcap_sg@plt>
mov    %ebx,%edi
call   1050 <init_pcap_mmap@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @init_pcap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @init_pcap_rw(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @init_pcap_sg(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @init_pcap_mmap(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @init_pcap(i32 %0) {
%2 = tail call i32 @init_pcap_rw(i32 %0)
%3 = tail call i32 @init_pcap_sg(i32 %0)
%4 = tail call i32 @init_pcap_mmap(i32 %0)
ret i32 0
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < 0U) {
      state[local1] *= state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] * 809088178UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xff660b45,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jae    114d <RandomFunc+0x4d>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp,%rax,4),%ecx
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp,%rax,4),%ecx
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%eax
imul   $0x3039b4b2,%rax,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
imul   $0x3039b4b2,(%rdi),%eax
add    $0xc73d59fa,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add i32 %9, -10089659
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %10, i32* %11
store i32 0, i32* %6
br label %12
12: ; preds = %15, %2
%13 = load i32, i32* %6
%14 = icmp ult i32 %13, 0
br i1 %14, label %15, label %29
15: ; preds = %12
%16 = load i32, i32* %6
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %6
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = mul i32 %23, %19
store i32 %24, i32* %22
%25 = load i32, i32* %6
%26 = zext i32 %25 to i64
%27 = add i64 %26, 2
%28 = trunc i64 %27 to i32
store i32 %28, i32* %6
br label %12
29: ; preds = %12
%30 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%31 = load i32, i32* %30
%32 = zext i32 %31 to i64
%33 = mul i64 %32, 809088178
%34 = trunc i64 %33 to i32
%35 = load i32*, i32** %4
%36 = getelementptr inbounds i32, i32* %35, i64 0
store i32 %34, i32* %36
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = mul i32 %3, 809088178
%5 = add i32 %4, -952280582
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hal_DbgAssert(char const *);
void __assert(const char *fmt) { hal_DbgAssert(fmt); }


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

x86 assembly (clang, -O2):
<__assert>:
jmp    1030 <hal_DbgAssert@plt>

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

LLVM IR (-O2):
define void @__assert(i8* %0) {
%2 = tail call i32 @hal_DbgAssert(i8* %0)
ret void
}
/* Variables and functions */
char *malloc(int);
scalar_t__ strcmp(char *, char *);
int checkURL(char *ligne) {
  char *buffer = malloc(6 * sizeof(char));
  int i;
  for (i = 0; i < 6; ++i) {
    buffer[i] = ligne[i];
  }
  if (strcmp(buffer, "GET / ") != 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkURL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x6,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jge    116f <checkURL+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1141 <checkURL+0x21>
mov    -0x18(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1195 <checkURL+0x75>
movl   $0xffffffff,-0x4(%rbp)
jmp    119c <checkURL+0x7c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkURL>:
push   %rbx
mov    %rdi,%rbx
mov    $0x6,%edi
call   1040 <malloc@plt>
mov    (%rbx),%ecx
mov    %ecx,(%rax)
movzwl 0x4(%rbx),%ecx
mov    %cx,0x4(%rax)
lea    0xebf(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"GET / \00"
define i32 @checkURL(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
%6 = call i8* @malloc(i32 6)
store i8* %6, i8** %4
store i32 0, i32* %5
br label %7
7: ; preds = %20, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 6
br i1 %9, label %10, label %23
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = load i8*, i8** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 %15, i8* %19
br label %20
20: ; preds = %10
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %7
23: ; preds = %7
%24 = load i8*, i8** %4
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 -1, i32* %2
br label %29
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
@.str = [7 x i8] c"GET / \00"
define i32 @checkURL(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(6) i8* @malloc(i32 6)
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timeval {
  scalar_t__ tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct eloop_ctx {
  int dummy;
};

/* Variables and functions */
int eloop_q_timeout_add_tv(struct eloop_ctx *, int, struct timeval *,
                           void (*)(void *), void *);
int eloop_q_timeout_add_sec(struct eloop_ctx *ctx, int queue, time_t when,
                            void (*callback)(void *), void *arg) {
  struct timeval tv;
  tv.tv_sec = when;
  tv.tv_usec = 0;
  return eloop_q_timeout_add_tv(ctx, queue, &tv, callback, arg);
}


x86 assembly (clang, -O0):
<eloop_q_timeout_add_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    -0x30(%rbp),%rdx
call   1030 <eloop_q_timeout_add_tv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eloop_q_timeout_add_sec>:
sub    $0x18,%rsp
mov    %edx,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdx
call   1030 <eloop_q_timeout_add_tv@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.eloop_ctx = type { i32 }
%struct.timeval = type { i64, i32 }
define i32 @eloop_q_timeout_add_sec(%struct.eloop_ctx* %0, i32 %1, i32 %2, void (i8*)* %3, i8* %4) {
%6 = alloca %struct.eloop_ctx*
%7 = alloca i32
%8 = alloca i32
%9 = alloca void (i8*)*
%10 = alloca i8*
%11 = alloca %struct.timeval
store %struct.eloop_ctx* %0, %struct.eloop_ctx** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store void (i8*)* %3, void (i8*)** %9
store i8* %4, i8** %10
%12 = load i32, i32* %8
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 1
store i32 %12, i32* %13
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 0
store i64 0, i64* %14
%15 = load %struct.eloop_ctx*, %struct.eloop_ctx** %6
%16 = load i32, i32* %7
%17 = load void (i8*)*, void (i8*)** %9
%18 = load i8*, i8** %10
%19 = call i32 @eloop_q_timeout_add_tv(%struct.eloop_ctx* %15, i32 %16, %struct.timeval* %11, void (i8*)* %17, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.eloop_ctx = type { i32 }
%struct.timeval = type { i64, i32 }
define i32 @eloop_q_timeout_add_sec(%struct.eloop_ctx* %0, i32 %1, i32 %2, void (i8*)* %3, i8* %4) {
%6 = alloca %struct.timeval
%7 = bitcast %struct.timeval* %6 to i8*
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 1
store i32 %2, i32* %8
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 0
store i64 0, i64* %9
%10 = call i32 @eloop_q_timeout_add_tv(%struct.eloop_ctx* %0, i32 %1, %struct.timeval* %6, void (i8*)* %3, i8* %4)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void explain(void) {
  fprintf(stderr, "Usage: ... sfq [ perturb SECS ] [ quantum BYTES ]\n");
}


x86 assembly (clang, -O0):
<explain>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<explain>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: ... sfq [ perturb SECS ] [ quantum BYTES ]\0A\00"
define void @explain() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: ... sfq [ perturb SECS ] [ quantum BYTES ]\0A\00"
define void @explain() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}
OP(fd, c4) {
  illegal_1();
  op_c4();
}


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

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_c4@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_c4()
ret i32 undef
}
int _sasl_done_with_plugins(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_sasl_done_with_plugins() {
ret i32 0
}
unsigned long int gcd(x, y)
unsigned long int x, y;
{
  for (;;) {
    x = x % y;
    if (x == 0)
      return y;
    y = y % x;
    if (y == 0)
      return x;
  }
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <gcd+0x34>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <gcd+0x61>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115c <gcd+0x5c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <gcd+0x61>
jmp    110c <gcd+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
jmp    1120 <gcd+0x20>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rsi,%rax
xor    %edx,%edx
div    %rdi
mov    %rdx,%rsi
test   %rsi,%rsi
je     1166 <gcd+0x66>
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1140 <gcd+0x40>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
mov    %rdx,%rdi
test   %rdi,%rdi
jne    114d <gcd+0x4d>
jmp    116a <gcd+0x6a>
xchg   %ax,%ax
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%edi
test   %rdi,%rdi
je     116a <gcd+0x6a>
mov    %rsi,%rax
or     %rdi,%rax
shr    $0x20,%rax
jne    1110 <gcd+0x10>
mov    %esi,%eax
xor    %edx,%edx
div    %edi
mov    %edx,%esi
test   %rsi,%rsi
jne    1120 <gcd+0x20>
mov    %rdi,%rax
ret
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i64 [ %0, %2 ], [ %6, %8 ]
%5 = phi i64 [ %1, %2 ], [ %9, %8 ]
%6 = urem i64 %4, %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = urem i64 %5, %6
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %8, %3
%12 = phi i64 [ %5, %3 ], [ %6, %8 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void version() {
  printf("chex %s\n", "1.0");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"chex %s\0A\00"
@.str.1 = [4 x i8] c"1.0\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"chex %s\0A\00"
@.str.1 = [4 x i8] c"1.0\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int ui_keyboard_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ui_keyboard_init() {
ret i32 0
}
int nlm_irt_to_irq(int irt) { return (8 + (irt)); }


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

x86 assembly (clang, -O2):
<nlm_irt_to_irq>:
lea    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @nlm_irt_to_irq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 8, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @nlm_irt_to_irq(i32 %0) {
%2 = add nsw i32 %0, 8
ret i32 %2
}
int is_prime(unsigned int n) {
  unsigned int div = 3;
  while (div * div < n && n % div != 0)
    div += 2;
  return n % div != 0;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x9(%rbp)
jae    1134 <is_prime+0x34>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
cmp    $0x0,%edx
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1144 <is_prime+0x44>
jmp    1152 <is_prime+0x52>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <is_prime+0xe>
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
cmp    $0x0,%edx
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x3,%ecx
cmp    $0xa,%edi
jb     1126 <is_prime+0x26>
mov    $0x3,%ecx
nop
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
test   %edx,%edx
je     1126 <is_prime+0x26>
add    $0x2,%ecx
mov    %ecx,%eax
imul   %ecx,%eax
cmp    %edi,%eax
jb     1110 <is_prime+0x10>
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
xor    %eax,%eax
test   %edx,%edx
setne  %al
ret

LLVM IR (-O0):
define i32 @is_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 3, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = mul i32 %5, %6
%8 = load i32, i32* %2
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %4
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = urem i32 %11, %12
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %10, %4
%16 = phi i1 [ false, %4 ], [ %14, %10 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = load i32, i32* %3
%19 = add i32 %18, 2
store i32 %19, i32* %3
br label %4
20: ; preds = %15
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = urem i32 %21, %22
%24 = icmp ne i32 %23, 0
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp ugt i32 %0, 9
br i1 %2, label %3, label %11
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ 3, %1 ]
%5 = urem i32 %0, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = add i32 %4, 2
%9 = mul i32 %8, %8
%10 = icmp ult i32 %9, %0
br i1 %10, label %3, label %11
11: ; preds = %3, %7, %1
%12 = phi i32 [ 3, %1 ], [ %8, %7 ], [ %4, %3 ]
%13 = urem i32 %0, %12
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M450_f(char *s) {
  debug("M450_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [47 x i8] c"M450_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M450_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
checktype(s) char *s;
{
  register len;
  len = strlen(s);
  if (len < 3 || len > 4)
    fatal("bad type");
  if (len == 3) {
    s[3] = ' ';
    s[4] = 0;
  }
}


x86 assembly (clang, -O0):
<checktype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jl     114c <checktype+0x2c>
cmpl   $0x4,-0x14(%rbp)
jle    115a <checktype+0x3a>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
cmpl   $0x3,-0x14(%rbp)
jne    1174 <checktype+0x54>
mov    -0x10(%rbp),%rax
movb   $0x20,0x3(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x4(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checktype>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    -0x5(%rax),%ecx
cmp    $0xfffffffd,%ecx
ja     1141 <checktype+0x21>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <fatal@plt>
pop    %rbx
ret
cmp    $0x3,%eax
jne    114c <checktype+0x2c>
movw   $0x20,0x3(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"bad type\00"
define i32 @checktype(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 3
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 4
br i1 %12, label %13, label %15
13: ; preds = %10, %1
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 3
store i8 32, i8* %20
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 4
store i8 0, i8* %22
br label %23
23: ; preds = %18, %15
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
@.str = [9 x i8] c"bad type\00"
define i32 @checktype(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add i32 %3, -5
%5 = icmp ult i32 %4, -2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %13
8: ; preds = %1
%9 = icmp eq i32 %3, 3
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = getelementptr inbounds i8, i8* %0, i64 3
store i8 32, i8* %11
%12 = getelementptr inbounds i8, i8* %0, i64 4
store i8 0, i8* %12
br label %13
13: ; preds = %6, %10, %8
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_hex(uint32_t value) { printf("%x", value); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define void @print_hex(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void EMACTimestampPPSCommand(uint32_t ui32Base, uint8_t ui8Cmd) {
  ASSERT(ui32Base == 0x400EC000);
  while ((*((volatile uint32_t *)(ui32Base + 0x0000072C))) & 0x0000000F) {
  }
  (*((volatile uint32_t *)(ui32Base + 0x0000072C))) = (0x00000010 | ui8Cmd);
}


x86 assembly (clang, -O0):
<EMACTimestampPPSCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x400ec000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x72c,%eax
cltq
mov    (%rax),%eax
and    $0xf,%eax
cmp    $0x0,%eax
je     114f <EMACTimestampPPSCommand+0x3f>
jmp    1132 <EMACTimestampPPSCommand+0x22>
mov    -0x8(%rbp),%ecx
or     $0x10,%ecx
mov    -0x4(%rbp),%eax
add    $0x72c,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACTimestampPPSCommand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x400ec000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
nopl   0x0(%rax,%rax,1)
testl  $0xf,0x72c(%rax)
jne    1130 <EMACTimestampPPSCommand+0x20>
or     $0x10,%ebx
mov    %ebx,0x72c(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @EMACTimestampPPSCommand(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 = icmp eq i32 %5, 1074708480
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1836
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, 15
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %9
br label %9
18: ; preds = %9
%19 = load i32, i32* %4
%20 = or i32 16, %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1836
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
store volatile i32 %20, i32* %24
ret void
}

LLVM IR (-O2):
define void @EMACTimestampPPSCommand(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074708480
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 1836
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
br label %9
9: ; preds = %9, %2
%10 = load volatile i32, i32* %8
%11 = and i32 %10, 15
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %9
13: ; preds = %9
%14 = or i32 %1, 16
store volatile i32 %14, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char string[30];
  gets(string);
  printf("%s", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x30(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rtp_set_hdr(uint8_t *p_rtp) { p_rtp[0] = 0x80; }


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

x86 assembly (clang, -O2):
<rtp_set_hdr>:
movl   $0x80,(%rdi)
ret

LLVM IR (-O0):
define void @rtp_set_hdr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 128, i32* %4
ret void
}

LLVM IR (-O2):
define void @rtp_set_hdr(i32* nocapture writeonly %0) {
store i32 128, i32* %0
ret void
}
int fun557() { return 557; }


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

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

LLVM IR (-O0):
define i32 @fun557() {
ret i32 557
}

LLVM IR (-O2):
define i32 @fun557() {
ret i32 557
}
int test_imm_08int16_reg(short val) {
  return ((val) & (0x08 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_08int16_reg(i16 signext %0) {
%2 = and i16 %0, 8
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void h(void) {}


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

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

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

LLVM IR (-O2):
define void @h() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ prog1();
int /*<<< orphan*/ prog2();
int main(void) {
  printf("Hello from main.c\n");
  prog1();
  prog2();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <prog1@plt>
xor    %eax,%eax
call   1050 <prog2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Hello from main.c\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @prog1()
%4 = call i32 (...) @prog2()
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"Hello from main.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @prog1()
%3 = tail call i32 (...) @prog2()
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello World!\n");
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
char *normalize(char *);
int /*<<< orphan*/ sflap_send(char *, int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void serv_get_info(char *name) {
  char buf[2048];
  snprintf(buf, 2048, "toc_get_info %s", normalize(name));
  sflap_send(buf, -1, 2);
}


x86 assembly (clang, -O0):
<serv_get_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x810(%rbp),%rax
mov    %rax,-0x818(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <normalize@plt>
mov    -0x818(%rbp),%rdi
mov    %rax,%rcx
mov    $0x800,%esi
lea    0xe94(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x810(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1050 <sflap_send@plt>
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serv_get_info>:
push   %rbx
sub    $0x800,%rsp
call   1040 <normalize@plt>
lea    0xebc(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x800,%esi
mov    %rax,%rcx
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1050 <sflap_send@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"toc_get_info %s\00"
define void @serv_get_info(i8* %0) {
%2 = alloca i8*
%3 = alloca [2048 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i8* @normalize(i8* %5)
%7 = call i32 @snprintf(i8* %4, i32 2048, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%9 = call i32 @sflap_send(i8* %8, i32 -1, i32 2)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"toc_get_info %s\00"
define void @serv_get_info(i8* %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = tail call i8* @normalize(i8* %0)
%5 = call i32 @snprintf(i8* %3, i32 2048, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @sflap_send(i8* %3, i32 -1, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void exec_once_0_block(void) { printf("hello from test 4\n"); }


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"hello from test 4\00"
define void @exec_once_0_block() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *info) {
  printf("Usage: %s <srv IP>:<srv PORT>\n", info);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Usage: %s <srv IP>:<srv PORT>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"Usage: %s <srv IP>:<srv PORT>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ T3D_OutputMessage(char *);
void T3D_PrintHeader(void) {
  T3D_OutputMessage("Syntax : photo23d -l <left images> -r <right images> -o "
                    "<output file pattern> [options]\n"
                    "\nValid options are :\n\n");
}


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

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

LLVM IR (-O0):
@.str = [111 x i8] c"Syntax : photo23d -l <left images> -r <right images> -o <output file pattern> [options]\0A\0AValid options are :\0A\0A\00"
define void @T3D_PrintHeader() {
%1 = call i32 @T3D_OutputMessage(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [111 x i8] c"Syntax : photo23d -l <left images> -r <right images> -o <output file pattern> [options]\0A\0AValid options are :\0A\0A\00"
define void @T3D_PrintHeader() {
%1 = tail call i32 @T3D_OutputMessage(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0))
ret void
}
long rq_date_event_is_holiday(long event_mask) {
  return event_mask & 0x80000000;
}


x86 assembly (clang, -O0):
<rq_date_event_is_holiday>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x80000000,%rax
and    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_date_event_is_holiday>:
mov    %rdi,%rax
and    $0x80000000,%eax
ret

LLVM IR (-O0):
define i64 @rq_date_event_is_holiday(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 2147483648
ret i64 %4
}

LLVM IR (-O2):
define i64 @rq_date_event_is_holiday(i64 %0) {
%2 = and i64 %0, 2147483648
ret i64 %2
}
garbage() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @garbage() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ hgetHdr(void *);
void hfree(void *ptr) { free(hgetHdr(ptr)); }


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

x86 assembly (clang, -O2):
<hfree>:
push   %rax
call   1040 <hgetHdr@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @hfree(i8* %0) {
%2 = tail call i32 @hgetHdr(i8* %0)
%3 = tail call i32 @free(i32 %2)
ret void
}
void I422ToNV21() {}


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

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

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

LLVM IR (-O2):
define void @I422ToNV21() {
ret void
}
float ajAnneal(float tmprimer, float tmproduct) {
  return ((float).7 * tmproduct) - (float)14.9 + ((float).3 * tmprimer);
}


x86 assembly (clang, -O0):
<ajAnneal>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  0xee9(%rip),%xmm0
mulss  %xmm0,%xmm1
movss  0xee1(%rip),%xmm0
addss  %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
movss  0xec8(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ajAnneal>:
mulss  0xef8(%rip),%xmm1
addss  0xef4(%rip),%xmm1
mulss  0xef0(%rip),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ajAnneal(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = call float @llvm.fmuladd.f32(float 0x3FE6666660000000, float %5, float 0xC02DCCCCC0000000)
%7 = load float, float* %3
%8 = call float @llvm.fmuladd.f32(float 0x3FD3333340000000, float %7, float %6)
ret float %8
}

LLVM IR (-O2):
define float @ajAnneal(float %0, float %1) {
%3 = tail call float @llvm.fmuladd.f32(float %1, float 0x3FE6666660000000, float 0xC02DCCCCC0000000)
%4 = tail call float @llvm.fmuladd.f32(float %0, float 0x3FD3333340000000, float %3)
ret float %4
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int cfsetospeed(struct termios *, unsigned int);
int termios_cfsetospeed(struct termios *t, unsigned int b) {
  return cfsetospeed(t, b);
}


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

x86 assembly (clang, -O2):
<termios_cfsetospeed>:
jmp    1030 <cfsetospeed@plt>

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

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @termios_cfsetospeed(%struct.termios* %0, i32 %1) {
%3 = tail call i32 @cfsetospeed(%struct.termios* %0, i32 %1)
ret i32 %3
}
void local_bh_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @local_bh_enable() {
ret void
}
void FEBanner() {}


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

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

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

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