xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: pass_gen [options]\n"
         "Options:\n"
         " -h		print help\n"
         " -i		input file\n"
         " -o		output file\n"
         " -t		transform input\n"
         " -q		custom questions file\n\n"
         "Examples:\n"
         "To run using default input and output files.\n"
         "pass_gen -t\n\n"
         "To run with specifying a custom words list and custom output file.\n"
         "pass_gen -t -i mywords -o myoutput\n\n"
         "To run with a custom questions file.\n"
         "pass_gen -t -q myquestions\n\n"
         "Project Page: https://github.com/foo74/pass_gen\n");
}


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

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

LLVM IR (-O0):
@.str = [418 x i8] c"Usage: pass_gen [options]\0AOptions:\0A -h\09\09print help\0A -i\09\09input file\0A -o\09\09output file\0A -t\09\09transform input\0A -q\09\09custom questions file\0A\0AExamples:\0ATo run using default input and output files.\0Apass_gen -t\0A\0ATo run with specifying a custom words list and custom output file.\0Apass_gen -t -i mywords -o myoutput\0A\0ATo run with a custom questions file.\0Apass_gen -t -q myquestions\0A\0AProject Page: https://github.com/foo74/pass_gen\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([418 x i8], [418 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [417 x i8] c"Usage: pass_gen [options]\0AOptions:\0A -h\09\09print help\0A -i\09\09input file\0A -o\09\09output file\0A -t\09\09transform input\0A -q\09\09custom questions file\0A\0AExamples:\0ATo run using default input and output files.\0Apass_gen -t\0A\0ATo run with specifying a custom words list and custom output file.\0Apass_gen -t -i mywords -o myoutput\0A\0ATo run with a custom questions file.\0Apass_gen -t -q myquestions\0A\0AProject Page: https://github.com/foo74/pass_gen\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([417 x i8], [417 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *CSlim_BuyBuf(char const *buffer, int length) {
  if (buffer == NULL)
    return NULL;
  char *purchase = (char *)malloc(length + 1);
  strncpy(purchase, buffer, length);
  purchase[length] = 0;
  return purchase;
}


x86 assembly (clang, -O0):
<CSlim_BuyBuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1147 <CSlim_BuyBuf+0x27>
movq   $0x0,-0x8(%rbp)
jmp    117a <CSlim_BuyBuf+0x5a>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSlim_BuyBuf>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1153 <CSlim_BuyBuf+0x33>
mov    %esi,%r14d
mov    %rdi,%r15
lea    0x1(%r14),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1030 <strncpy@plt>
movslq %r14d,%rax
movb   $0x0,(%rbx,%rax,1)
jmp    1155 <CSlim_BuyBuf+0x35>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @CSlim_BuyBuf(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = add nsw i32 %1, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strncpy(i8* %7, i8* %0, i32 %1)
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %2, %4
%12 = phi i8* [ %7, %4 ], [ null, %2 ]
ret i8* %12
}
void tinylibc_start(void) {
  long ret;
  long argc;
  char **argv;
  char *rbp_reg = 0;
  asm("movq %%rbp, %0 \n" : "=r"(rbp_reg));
  argc = *(long *)(rbp_reg + 4);
  argv = (char **)(rbp_reg + 8);
  ret = main(argc, argv);
  exit(ret);
}


x86 assembly (clang, -O0):
<tinylibc_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x20(%rbp)
mov    %rbp,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <main@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<tinylibc_start>:
push   %rax
mov    %rbp,%rsi
mov    0x4(%rsi),%rdi
add    $0x8,%rsi
xor    %eax,%eax
call   1030 <main@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @tinylibc_start() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i8**
%4 = alloca i8*
store i8* null, i8** %4
%5 = call i8* asm "movq %rbp, $0 \0A", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 4
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %2
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 8
%12 = bitcast i8* %11 to i8**
store i8** %12, i8*** %3
%13 = load i64, i64* %2
%14 = load i8**, i8*** %3
%15 = call i32 (i64, i8**, ...) bitcast (i32 (...)* @main to i32 (i64, i8**, ...)*)(i64 %13, i8** %14)
%16 = sext i32 %15 to i64
store i64 %16, i64* %1
%17 = load i64, i64* %1
%18 = trunc i64 %17 to i32
unreachable
}

LLVM IR (-O2):
define void @tinylibc_start() {
%1 = tail call i8* asm "movq %rbp, $0 \0A", "=r,~{dirflag},~{fpsr},~{flags}"()
%2 = getelementptr inbounds i8, i8* %1, i64 4
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
%5 = getelementptr inbounds i8, i8* %1, i64 8
%6 = bitcast i8* %5 to i8**
%7 = tail call i32 (i64, i8**, ...) bitcast (i32 (...)* @main to i32 (i64, i8**, ...)*)(i64 %4, i8** %6)
tail call void @exit(i32 %7)
unreachable
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ asctime(struct tm const *);
void uninitvar_asctime(void) {
  const struct tm *tm;
  (void)asctime(tm);
}


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

x86 assembly (clang, -O2):
<uninitvar_asctime>:
jmp    1030 <asctime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @uninitvar_asctime() {
%1 = alloca %struct.tm*
%2 = load %struct.tm*, %struct.tm** %1
%3 = call i32 @asctime(%struct.tm* %2)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @uninitvar_asctime() {
%1 = tail call i32 @asctime(%struct.tm* undef)
ret void
}
/* Variables and functions */
char *ResizeIfNeeded(char *, int *, int /*<<< orphan*/);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strlen(char const *);
char *Append(char *pBuffer, int *size, const char *S) {
  char *p = pBuffer;
  p = ResizeIfNeeded(pBuffer, size, strlen(S));
  strcat(p, S);
  return p;
}


x86 assembly (clang, -O0):
<Append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
call   1040 <ResizeIfNeeded@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Append>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <ResizeIfNeeded@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @Append(i8* %0, i32* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
store i8* %8, i8** %7
%9 = load i8*, i8** %4
%10 = load i32*, i32** %5
%11 = load i8*, i8** %6
%12 = call i32 @strlen(i8* %11)
%13 = call i8* @ResizeIfNeeded(i8* %9, i32* %10, i32 %12)
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = load i8*, i8** %6
%16 = call i32 @strcat(i8* %14, i8* %15)
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
define i8* @Append(i8* %0, i32* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i8* @ResizeIfNeeded(i8* %0, i32* %1, i32 %4)
%6 = tail call i32 @strcat(i8* %5, i8* %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128InterruptPinP__3__IrqSignal__fired();
void HplAtm128InterruptSigP__IntSig3__fired(void) {
  HplAtm128InterruptPinP__3__IrqSignal__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplAtm128InterruptSigP__IntSig3__fired() {
%1 = tail call i32 (...) @HplAtm128InterruptPinP__3__IrqSignal__fired()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32r1(uint32_t x) { return (x >> 1) | (x << 31); }


x86 assembly (clang, -O0):
<rot32r1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot32r1>:
mov    %edi,%eax
sar    %eax
shl    $0x1f,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot32r1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = load i32, i32* %2
%6 = shl i32 %5, 31
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot32r1(i32 %0) {
%2 = ashr i32 %0, 1
%3 = shl i32 %0, 31
%4 = or i32 %2, %3
ret i32 %4
}
/* Type definitions */
struct obus_server {
  int dummy;
};
struct obus_object {
  int dummy;
};
struct net_interface {
  int dummy;
};

/* Variables and functions */
int obus_server_register_object(struct obus_server *, struct obus_object *);
int net_interface_register(struct obus_server *server,
                           struct net_interface *object) {
  struct obus_object *obj = (struct obus_object *)object;
  return obus_server_register_object(server, obj);
}


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

x86 assembly (clang, -O2):
<net_interface_register>:
jmp    1030 <obus_server_register_object@plt>

LLVM IR (-O0):
%struct.obus_server = type { i32 }
%struct.net_interface = type { i32 }
%struct.obus_object = type { i32 }
define i32 @net_interface_register(%struct.obus_server* %0, %struct.net_interface* %1) {
%3 = alloca %struct.obus_server*
%4 = alloca %struct.net_interface*
%5 = alloca %struct.obus_object*
store %struct.obus_server* %0, %struct.obus_server** %3
store %struct.net_interface* %1, %struct.net_interface** %4
%6 = load %struct.net_interface*, %struct.net_interface** %4
%7 = bitcast %struct.net_interface* %6 to %struct.obus_object*
store %struct.obus_object* %7, %struct.obus_object** %5
%8 = load %struct.obus_server*, %struct.obus_server** %3
%9 = load %struct.obus_object*, %struct.obus_object** %5
%10 = call i32 @obus_server_register_object(%struct.obus_server* %8, %struct.obus_object* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.obus_server = type { i32 }
%struct.net_interface = type { i32 }
%struct.obus_object = type { i32 }
define i32 @net_interface_register(%struct.obus_server* %0, %struct.net_interface* %1) {
%3 = bitcast %struct.net_interface* %1 to %struct.obus_object*
%4 = tail call i32 @obus_server_register_object(%struct.obus_server* %0, %struct.obus_object* %3)
ret i32 %4
}
void writeTime(unsigned char *buf, unsigned int val) {
  buf[4] = val >> 16;
  buf[5] = val >> 8;
  buf[6] = val;
  buf[7] = val >> 24;
  return;
}


x86 assembly (clang, -O0):
<writeTime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x5(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x7(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeTime>:
mov    %esi,%eax
mov    %esi,%ecx
shr    $0x10,%ecx
mov    %cl,0x4(%rdi)
mov    %ah,0x5(%rdi)
mov    %al,0x6(%rdi)
shr    $0x18,%eax
mov    %al,0x7(%rdi)
ret

LLVM IR (-O0):
define void @writeTime(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 = lshr i32 %5, 16
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 4
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 5
store i8 %12, i8* %14
%15 = load i32, i32* %4
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 6
store i8 %16, i8* %18
%19 = load i32, i32* %4
%20 = lshr i32 %19, 24
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 7
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @writeTime(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %4, i8* %5
%6 = lshr i32 %1, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %7, i8* %8
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %9, i8* %10
%11 = lshr i32 %1, 24
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %12, i8* %13
ret void
}
/* Variables and functions */
size_t get_strlen(const char str[]) {
  size_t len;
  for (len = 0; *str++ != '\0'; len++)
    ;
  return len;
}


x86 assembly (clang, -O0):
<get_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <get_strlen+0x41>
jmp    1130 <get_strlen+0x30>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <get_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_strlen>:
cmpb   $0x0,(%rdi)
je     111f <get_strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <get_strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @get_strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %11, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %4
br label %11
11: ; preds = %10
%12 = load i64, i64* %3
%13 = add i64 %12, 1
store i64 %13, i64* %3
br label %4
14: ; preds = %4
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
define i64 @get_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
int test(char const *recp __attribute__((unused)),
         int reclen __attribute__((unused)),
         char const *udata __attribute__((unused)),
         int uleng __attribute__((unused))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @test(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
void test_do_while() {
  printf("\n===== test_do_while\n");
  int result = 1;
  do {
    ++result;
  } while (result < 10);
  assert(result == 10);
}


x86 assembly (clang, -O0):
<test_do_while>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     113b <test_do_while+0x1b>
cmpl   $0xa,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_do_while>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <assert@plt>

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

LLVM IR (-O2):
@str = [21 x i8] c"\0A===== test_do_while\00"
define void @test_do_while() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 1)
ret void
}
int f(int x) {
  int lookalike = 1;
  int looka1ike = 2;
  if (x > 3) {
    int x = lookalike;
    x += looka1ike;
  }
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x3,-0x4(%rbp)
jle    112e <f+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
int test_stream_zero(void) {
  printf("%s\n", __FUNCTION__);
  return _test_stream(1);
}


x86 assembly (clang, -O0):
<test_stream_zero>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <_test_stream@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_stream_zero>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <_test_stream@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__FUNCTION__.test_stream_zero = [17 x i8] c"test_stream_zero\00"
define i32 @test_stream_zero() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.test_stream_zero, i64 0, i64 0))
%2 = call i32 (i32, ...) bitcast (i32 (...)* @_test_stream to i32 (i32, ...)*)(i32 1)
ret i32 %2
}

LLVM IR (-O2):
@__FUNCTION__.test_stream_zero = [17 x i8] c"test_stream_zero\00"
define i32 @test_stream_zero() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.test_stream_zero, i64 0, i64 0))
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @_test_stream to i32 (i32, ...)*)(i32 1)
ret i32 %2
}
void INT_TM02(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_TM02() {
ret void
}
int test_imm_ADint8_mem(signed char *val) {
  return ((*val) & (0xAD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_ADint8_mem>:
testb  $0xad,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ADint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -83
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xbe() {
  Assert_real((isupper(190) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              955, ("isupper should be 0 for 0xbe"));
}


x86 assembly (clang, -O0):
<t_isupper_0xbe>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbe,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3bb,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xbe>:
push   %rax
mov    $0xbe,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3bb,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xbe\00"
define void @t_isupper_0xbe() {
%1 = call i64 @isupper(i32 190)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 955, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xbe\00"
define void @t_isupper_0xbe() {
%1 = tail call i64 @isupper(i32 190)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 955, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double cels_to_fahr(int celsius) { return (9.0 * celsius / 5.0) + 32; }


x86 assembly (clang, -O0):
<cels_to_fahr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xefc(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed4(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cels_to_fahr>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @cels_to_fahr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double 9.000000e+00, %4
%6 = fdiv double %5, 5.000000e+00
%7 = fadd double %6, 3.200000e+01
ret double %7
}

LLVM IR (-O2):
define double @cels_to_fahr(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 9.000000e+00
%4 = fdiv double %3, 5.000000e+00
%5 = fadd double %4, 3.200000e+01
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ parseFiles();
int main(int argc, char **argv) {
  parseFiles();
  return 0;
}


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)
mov    $0x0,%al
call   1030 <parseFiles@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 (...) @parseFiles()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @parseFiles()
ret i32 0
}
unsigned int if_nametoindex(const char *ifname) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @if_nametoindex(i8* nocapture readnone %0) {
ret i32 0
}
int zerosInFactorial(int n) {
  int ret = 0;
  while (n) {
    ret += n / 5;
    n /= 5;
  }
  return ret;
}


x86 assembly (clang, -O0):
<zerosInFactorial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <zerosInFactorial+0x3c>
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <zerosInFactorial+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zerosInFactorial>:
xor    %eax,%eax
test   %edi,%edi
je     1131 <zerosInFactorial+0x31>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rdi
add    %edx,%edi
add    %edi,%eax
add    $0x4,%ecx
cmp    $0x8,%ecx
ja     1110 <zerosInFactorial+0x10>
ret

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

LLVM IR (-O2):
define i32 @zerosInFactorial(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 5
%7 = add nsw i32 %4, %6
%8 = add i32 %5, 4
%9 = icmp ult i32 %8, 9
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Type definitions */
struct link {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_clear(struct link *, void (*)(struct link *));
void list_destroy(struct link *__restrict list,
                  void (*data_delete)(struct link *)) {
  list_clear(list, data_delete);
}


x86 assembly (clang, -O0):
<list_destroy>:
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 <list_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_destroy>:
jmp    1030 <list_clear@plt>

LLVM IR (-O0):
%struct.link = type { i32 }
define void @list_destroy(%struct.link* noalias %0, void (%struct.link*)* %1) {
%3 = alloca %struct.link*
%4 = alloca void (%struct.link*)*
store %struct.link* %0, %struct.link** %3
store void (%struct.link*)* %1, void (%struct.link*)** %4
%5 = load %struct.link*, %struct.link** %3
%6 = load void (%struct.link*)*, void (%struct.link*)** %4
%7 = call i32 @list_clear(%struct.link* %5, void (%struct.link*)* %6)
ret void
}

LLVM IR (-O2):
%struct.link = type { i32 }
define void @list_destroy(%struct.link* noalias %0, void (%struct.link*)* %1) {
%3 = tail call i32 @list_clear(%struct.link* %0, void (%struct.link*)* %1)
ret void
}
int pos_bit(int num_bloque) { return (num_bloque % 8); }


x86 assembly (clang, -O0):
<pos_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos_bit>:
mov    %edi,%eax
lea    0x7(%rax),%ecx
test   %edi,%edi
cmovns %edi,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @pos_bit(i32 %0) {
%2 = srem i32 %0, 8
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fft(float *, int, int);
int /*<<< orphan*/ imprimeVetor(float *, int);
int main(void) {
  float data[8] = {0., 0., 1., 0., 2., 0., 3., 0.};
  fft(data - 1, 4, 1);
  imprimeVetor(data, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
add    $0xfffffffffffffffc,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fft@plt>
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1030 <imprimeVetor@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    -0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fft@plt>
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <imprimeVetor@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.data = [8 x float] [float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 2.000000e+00, float 0.000000e+00, float 3.000000e+00, float 0.000000e+00]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x float]
store i32 0, i32* %1
%3 = bitcast [8 x float]* %2 to i8*
%4 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 0
%5 = getelementptr inbounds float, float* %4, i64 -1
%6 = call i32 @fft(float* %5, i32 4, i32 1)
%7 = getelementptr inbounds [8 x float], [8 x float]* %2, i64 0, i64 0
%8 = call i32 @imprimeVetor(float* %7, i32 8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.data = [8 x float] [float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 2.000000e+00, float 0.000000e+00, float 3.000000e+00, float 0.000000e+00]
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 -1
%5 = call i32 @fft(float* %4, i32 4, i32 1)
%6 = call i32 @imprimeVetor(float* %3, i32 8)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int h264_is_nal_ending_tag(const uint8_t *buf) {
  if (buf[0] != 0 || buf[1] != 0) {
    return 0;
  }
  if (buf[2] == 0 || buf[2] == 0x01) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<h264_is_nal_ending_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1123 <h264_is_nal_ending_tag+0x23>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     112f <h264_is_nal_ending_tag+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115e <h264_is_nal_ending_tag+0x5e>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x8(%rax)
je     114b <h264_is_nal_ending_tag+0x4b>
mov    -0x10(%rbp),%rax
cmpl   $0x1,0x8(%rax)
jne    1157 <h264_is_nal_ending_tag+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <h264_is_nal_ending_tag+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264_is_nal_ending_tag>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
je     1108 <h264_is_nal_ending_tag+0x8>
ret
cmpl   $0x0,0x4(%rdi)
jne    1107 <h264_is_nal_ending_tag+0x7>
xor    %eax,%eax
cmpl   $0x2,0x8(%rdi)
setb   %al
ret

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

LLVM IR (-O2):
define i32 @h264_is_nal_ending_tag(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = icmp ult i32 %10, 2
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %1, %4
%14 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %12, %8 ]
ret i32 %14
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
int ceph_frag_bits(int);
__u32 ceph_frag_mask(__u32 f) {
  return (0xffffffu << (24 - ceph_frag_bits(f))) & 0xffffffu;
}


x86 assembly (clang, -O0):
<ceph_frag_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ceph_frag_bits@plt>
mov    $0x18,%ecx
sub    %eax,%ecx
mov    $0xffffff,%eax
shl    %cl,%eax
and    $0xffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceph_frag_mask>:
push   %rax
call   1030 <ceph_frag_bits@plt>
mov    $0x18,%cl
sub    %al,%cl
mov    $0xffffff,%eax
shl    %cl,%eax
and    $0xffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ceph_frag_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ceph_frag_bits(i32 %3)
%5 = sub nsw i32 24, %4
%6 = shl i32 16777215, %5
%7 = and i32 %6, 16777215
ret i32 %7
}

LLVM IR (-O2):
define i32 @ceph_frag_mask(i32 %0) {
%2 = tail call i32 @ceph_frag_bits(i32 %0)
%3 = sub nsw i32 24, %2
%4 = shl i32 16777215, %3
%5 = and i32 %4, 16777215
ret i32 %5
}
char *procprt_EXC_a(struct tstat *curstat, int avgval, int nsecs) {
  return "  -";
}


x86 assembly (clang, -O0):
<procprt_EXC_a>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<procprt_EXC_a>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [4 x i8] c" -\00"
define i8* @procprt_EXC_a(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [4 x i8] c" -\00"
define i8* @procprt_EXC_a(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *check_not_null(void *ptr) {
  if (!ptr) {
    fprintf(stderr, "Out of memory\n");
    exit(2);
  }
  return (ptr);
}


x86 assembly (clang, -O0):
<check_not_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <check_not_null+0x36>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_not_null>:
test   %rdi,%rdi
je     1129 <check_not_null+0x9>
mov    %rdi,%rax
ret
push   %rax
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define i8* @check_not_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 2)
unreachable
9: ; preds = %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
define i8* @check_not_null(i8* readnone returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello world.\n");
  return 0;
}


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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello world.\0A\00"
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))
ret i32 0
}

LLVM IR (-O2):
@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))
ret i32 0
}
void api_tcp_listener_on_terminate(struct api_tcp_listener_t *listener) {}


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

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

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

LLVM IR (-O2):
%struct.api_tcp_listener_t = type opaque
define void @api_tcp_listener_on_terminate(%struct.api_tcp_listener_t* nocapture %0) {
ret void
}
void print_fArray(Array_p, size) long size;
float *Array_p;
{
  while (size--)
    printf("%f\t", *Array_p++);
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<print_fArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1163 <print_fArray+0x53>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1120 <print_fArray+0x10>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_fArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     115d <print_fArray+0x3d>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
movss  (%r14,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_fArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\09\00"
define void @print_fArray(float* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi float* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i64 %5, -1
%8 = getelementptr inbounds float, float* %6, i64 1
%9 = load float, float* %6
%10 = fpext float %9 to double
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %10)
%12 = icmp eq i64 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
void *memset(void *, int, size_t);
void *memset_s(void *s, int c, size_t n) { return memset(s, c, n); }


x86 assembly (clang, -O0):
<memset_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset_s>:
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @memset_s(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %2, i1 false)
ret i8* %0
}
int parser_IsAlpha(char c) {
  if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<parser_IsAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1124 <parser_IsAlpha+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    113e <parser_IsAlpha+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     114a <parser_IsAlpha+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     114a <parser_IsAlpha+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <parser_IsAlpha+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_IsAlpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @parser_IsAlpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
double calc_veg_roughness(double height) {
  double value;
  value = 0.123 * height;
  return (value);
}


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

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

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

LLVM IR (-O2):
define double @calc_veg_roughness(double %0) {
%2 = fmul double %0, 1.230000e-01
ret double %2
}