xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error_exit(char *message) {
  fprintf(stderr, "%s", message);
  exit(1);
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_exit>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @error_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @error_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SAFE_FREE(char *);
void ipstr_list_free(char *ipstr_list) { SAFE_FREE(ipstr_list); }


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

x86 assembly (clang, -O2):
<ipstr_list_free>:
jmp    1030 <SAFE_FREE@plt>

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

LLVM IR (-O2):
define void @ipstr_list_free(i8* %0) {
%2 = tail call i32 @SAFE_FREE(i8* %0)
ret void
}
int negate(int nr) {
  int rev;
  if (nr >= 0) {
    rev = nr - (nr * 2);
    return rev;
  } else {
    rev = nr - (nr * 2);
    return rev;
  }
}


x86 assembly (clang, -O0):
<negate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112a <negate+0x2a>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <negate+0x3e>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @negate(i32 %0) {
%2 = sub i32 0, %0
ret i32 %2
}
/* Type definitions */
struct rusage {
  int /*<<< orphan*/ ru_maxrss;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
size_t measurePeakMemory() {
  struct rusage t;
  getrusage(RUSAGE_SELF, &t);
  return (size_t)t.ru_maxrss;
}


x86 assembly (clang, -O0):
<measurePeakMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <getrusage@plt>
movslq -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measurePeakMemory>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrusage@plt>
movslq (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rusage = type { i32 }
@RUSAGE_SELF = global i32 0
define i64 @measurePeakMemory() {
%1 = alloca %struct.rusage
%2 = load i32, i32* @RUSAGE_SELF
%3 = call i32 @getrusage(i32 %2, %struct.rusage* %1)
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
@RUSAGE_SELF = global i32 0
define i64 @measurePeakMemory() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = load i32, i32* @RUSAGE_SELF
%4 = call i32 @getrusage(i32 %3, %struct.rusage* %1)
%5 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
ret i64 %7
}
/* Variables and functions */
long strtol(char const *, int /*<<< orphan*/ *, int);
int get_int(const char *num, int max) {
  long converted_num;
  converted_num = strtol(num, NULL, 10);
  if (converted_num >= max)
    return max;
  else if (converted_num <= 0)
    return 1;
  else
    return converted_num;
}


x86 assembly (clang, -O0):
<get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
jl     1151 <get_int+0x41>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <get_int+0x5f>
cmpq   $0x0,-0x20(%rbp)
jg     1168 <get_int+0x58>
movl   $0x1,-0x4(%rbp)
jmp    116f <get_int+0x5f>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int>:
push   %rbx
mov    %esi,%ebx
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
cmp    $0x2,%rax
mov    $0x1,%edx
cmovge %eax,%edx
movslq %ebx,%rcx
cmp    %rcx,%rax
cmovl  %edx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_int(i8* nocapture %0, i32 %1) {
%3 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%4 = sext i32 %1 to i64
%5 = icmp slt i64 %3, %4
%6 = icmp sgt i64 %3, 1
%7 = select i1 %6, i64 %3, i64 1
%8 = trunc i64 %7 to i32
%9 = select i1 %5, i32 %8, i32 %1
ret i32 %9
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ fts_name;
};
typedef TYPE_1__ FTSENT;

/* Variables and functions */
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int fname_cmp(const FTSENT *const *a, const FTSENT *const *b) {
  return strcmp((*a)->fts_name, (*b)->fts_name);
}


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

x86 assembly (clang, -O2):
<fname_cmp>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
define i32 @fname_cmp(%struct.TYPE_4__** %0, %struct.TYPE_4__** %1) {
%3 = alloca %struct.TYPE_4__**
%4 = alloca %struct.TYPE_4__**
store %struct.TYPE_4__** %0, %struct.TYPE_4__*** %3
store %struct.TYPE_4__** %1, %struct.TYPE_4__*** %4
%5 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %3
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %4
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %9
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @strcmp(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
define i32 @fname_cmp(%struct.TYPE_4__** nocapture %0, %struct.TYPE_4__** nocapture %1) {
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %0
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %1
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @strcmp(i32 %5, i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ SYS_getdents;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int syscall(int /*<<< orphan*/, int, char *, int);
int safe_getdents(int f, char *buffer) {
  int ret = syscall(SYS_getdents, f, buffer, 1024);
  if (ret == -1) {
    perror("getdents()");
    exit(-1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<safe_getdents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x400,%ecx
call   1030 <syscall@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    117c <safe_getdents+0x4c>
lea    0xe93(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_getdents>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    $0x400,%ecx
call   1030 <syscall@plt>
cmp    $0xffffffff,%eax
je     1150 <safe_getdents+0x20>
pop    %rcx
ret
lea    0xea9(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SYS_getdents = global i32 0
@.str = [11 x i8] c"getdents()\00"
define i32 @safe_getdents(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* @SYS_getdents
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @syscall(i32 %6, i32 %7, i8* %8, i32 1024)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@SYS_getdents = global i32 0
@.str = [11 x i8] c"getdents()\00"
define i32 @safe_getdents(i32 %0, i8* %1) {
%3 = load i32, i32* @SYS_getdents
%4 = tail call i32 @syscall(i32 %3, i32 %0, i8* %1, i32 1024)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
ret i32 %4
}
/* Variables and functions */
unsigned int mb_KAT_RNG();
unsigned int mb_system_clear(int);
unsigned int sss_KAT_RNG(void) {
  unsigned int ret;
  ret = mb_system_clear((0x00));
  if (ret != (0x00)) {
    return ret;
  }
  ret = mb_KAT_RNG();
  return ret;
}


x86 assembly (clang, -O0):
<sss_KAT_RNG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <mb_system_clear@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1147 <sss_KAT_RNG+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <sss_KAT_RNG+0x37>
mov    $0x0,%al
call   1040 <mb_KAT_RNG@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sss_KAT_RNG>:
push   %rax
xor    %edi,%edi
call   1030 <mb_system_clear@plt>
test   %eax,%eax
je     112e <sss_KAT_RNG+0xe>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <mb_KAT_RNG@plt>

LLVM IR (-O0):
define i32 @sss_KAT_RNG() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @mb_system_clear(i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %11
8: ; preds = %0
%9 = call i32 (...) @mb_KAT_RNG()
store i32 %9, i32* %2
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @sss_KAT_RNG() {
%1 = tail call i32 @mb_system_clear(i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @mb_KAT_RNG()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ GUI_Mouse_Show_InRegion();
void GUI_Mouse_Show_InWidget() { GUI_Mouse_Show_InRegion(); }


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

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

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

LLVM IR (-O2):
define void @GUI_Mouse_Show_InWidget() {
%1 = tail call i32 (...) @GUI_Mouse_Show_InRegion()
ret void
}
void outw(unsigned short port, unsigned short val) {
  asm volatile("outw %0, %1" ::"a"(val), "dN"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
mov    -0x2(%rbp),%dx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%eax
mov    %edi,%edx
out    %ax,(%dx)
ret

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

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw $0, $1", "{ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %1, i16 %0)
ret void
}
void test_non_identifiers() {
  int i, x;
#pragma omp parallel
#pragma omp taskloop;
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel
#pragma omp taskloop linear(x);
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel
#pragma omp taskloop private(x);
  for (i = 0; i < 16; ++i)
    ;
#pragma omp parallel
#pragma omp taskloop, private(x);
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_non_identifiers>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_non_identifiers+0x28>
jmp    111a <test_non_identifiers+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_non_identifiers+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_non_identifiers+0x4c>
jmp    113e <test_non_identifiers+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_non_identifiers+0x2f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1170 <test_non_identifiers+0x70>
jmp    1162 <test_non_identifiers+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <test_non_identifiers+0x53>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1194 <test_non_identifiers+0x94>
jmp    1186 <test_non_identifiers+0x86>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <test_non_identifiers+0x77>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_non_identifiers() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %3
10: ; preds = %3
store i32 0, i32* %1
br label %11
11: ; preds = %15, %10
%12 = load i32, i32* %1
%13 = icmp slt i32 %12, 16
br i1 %13, label %14, label %18
14: ; preds = %11
br label %15
15: ; preds = %14
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %11
18: ; preds = %11
store i32 0, i32* %1
br label %19
19: ; preds = %23, %18
%20 = load i32, i32* %1
%21 = icmp slt i32 %20, 16
br i1 %21, label %22, label %26
22: ; preds = %19
br label %23
23: ; preds = %22
%24 = load i32, i32* %1
%25 = add nsw i32 %24, 1
store i32 %25, i32* %1
br label %19
26: ; preds = %19
store i32 0, i32* %1
br label %27
27: ; preds = %31, %26
%28 = load i32, i32* %1
%29 = icmp slt i32 %28, 16
br i1 %29, label %30, label %34
30: ; preds = %27
br label %31
31: ; preds = %30
%32 = load i32, i32* %1
%33 = add nsw i32 %32, 1
store i32 %33, i32* %1
br label %27
34: ; preds = %27
ret void
}

LLVM IR (-O2):
define void @test_non_identifiers() {
ret void
}
int digittoint(c)
int c;
{ return (__maskrune((c), 0xFF)); }


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

x86 assembly (clang, -O2):
<digittoint>:
mov    $0xff,%esi
xor    %eax,%eax
jmp    1030 <__maskrune@plt>

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

LLVM IR (-O2):
define i32 @digittoint(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @__maskrune to i32 (i32, i32, ...)*)(i32 %0, i32 255)
ret i32 %2
}
/* Type definitions */
struct XorrisO {
  int dummy;
};

/* Variables and functions */
int Xorriso_cmd_sorting_rank(struct XorrisO *, int /*<<< orphan*/,
                             int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int Xorriso_option_list_arg_sorting(struct XorrisO *xorriso, int flag) {
  int ret;
  ret = Xorriso_cmd_sorting_rank(xorriso, 0, NULL, 0, 1);
  return (ret);
}


x86 assembly (clang, -O0):
<Xorriso_option_list_arg_sorting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%edx
mov    $0x1,%r8d
mov    %ecx,%esi
call   1030 <Xorriso_cmd_sorting_rank@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xorriso_option_list_arg_sorting>:
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <Xorriso_cmd_sorting_rank@plt>

LLVM IR (-O0):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_option_list_arg_sorting(%struct.XorrisO* %0, i32 %1) {
%3 = alloca %struct.XorrisO*
%4 = alloca i32
%5 = alloca i32
store %struct.XorrisO* %0, %struct.XorrisO** %3
store i32 %1, i32* %4
%6 = load %struct.XorrisO*, %struct.XorrisO** %3
%7 = call i32 @Xorriso_cmd_sorting_rank(%struct.XorrisO* %6, i32 0, i32* null, i32 0, i32 1)
store i32 %7, i32* %5
%8 = load i32, i32* %5
ret i32 %8
}

LLVM IR (-O2):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_option_list_arg_sorting(%struct.XorrisO* %0, i32 %1) {
%3 = tail call i32 @Xorriso_cmd_sorting_rank(%struct.XorrisO* %0, i32 0, i32* null, i32 0, i32 1)
ret i32 %3
}
void ClearScr(long color) {
  (*(volatile unsigned long *)0x4d000050) = (1 << 24) | ((color & 0xffffff));
}


x86 assembly (clang, -O0):
<ClearScr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
and    $0xffffff,%rcx
or     $0x1000000,%rcx
mov    $0x4d000050,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearScr>:
and    $0xffffff,%edi
or     $0x1000000,%rdi
mov    %rdi,0x4d000050
4d
ret

LLVM IR (-O0):
define void @ClearScr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 16777215
%5 = or i64 16777216, %4
store volatile i64 %5, i64* inttoptr (i64 1291845712 to i64*)
ret void
}

LLVM IR (-O2):
define void @ClearScr(i64 %0) {
%2 = and i64 %0, 16777215
%3 = or i64 %2, 16777216
store volatile i64 %3, i64* inttoptr (i64 1291845712 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("\nHello my name is Jane"); }


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

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"\0AHello my name is Jane\00"
define void @hello() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct server_attr {
  int dummy;
};

/* Variables and functions */
int depth_resolve_path(struct server_attr *, char *);
char *get_upload_file(struct server_attr *attr, char *pathname) {
  if (depth_resolve_path(attr, pathname) == -1)
    return NULL;
  ;
  return pathname;
}


x86 assembly (clang, -O0):
<get_upload_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <depth_resolve_path@plt>
cmp    $0xffffffff,%eax
jne    1143 <get_upload_file+0x33>
movq   $0x0,-0x8(%rbp)
jmp    114b <get_upload_file+0x3b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_upload_file>:
push   %rbx
mov    %rsi,%rbx
call   1030 <depth_resolve_path@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
cmovne %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.server_attr = type { i32 }
define i8* @get_upload_file(%struct.server_attr* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.server_attr*
%5 = alloca i8*
store %struct.server_attr* %0, %struct.server_attr** %4
store i8* %1, i8** %5
%6 = load %struct.server_attr*, %struct.server_attr** %4
%7 = load i8*, i8** %5
%8 = call i32 @depth_resolve_path(%struct.server_attr* %6, i8* %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %2
store i8* null, i8** %3
br label %13
11: ; preds = %2
%12 = load i8*, i8** %5
store i8* %12, i8** %3
br label %13
13: ; preds = %11, %10
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
%struct.server_attr = type { i32 }
define i8* @get_upload_file(%struct.server_attr* %0, i8* %1) {
%3 = tail call i32 @depth_resolve_path(%struct.server_attr* %0, i8* %1)
%4 = icmp eq i32 %3, -1
%5 = select i1 %4, i8* null, i8* %1
ret i8* %5
}
/* Variables and functions */
void *driller_realloc(void *, size_t);
void *driller_realloc_hook(void *mem, size_t bytes, const void *caller) {
  return driller_realloc(mem, bytes);
}


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

x86 assembly (clang, -O2):
<driller_realloc_hook>:
jmp    1030 <driller_realloc@plt>

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

LLVM IR (-O2):
define i8* @driller_realloc_hook(i8* %0, i64 %1, i8* nocapture readnone %2) {
%4 = tail call i8* @driller_realloc(i8* %0, i64 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xe2() {
  Assert_real((isbdigit(226) == 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_isbdigit.c",
              1135, ("isbdigit should be 0 for 0xe2"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xe2>:
push   %rax
mov    $0xe2,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x46f,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xe2\00"
define void @t_isbdigit_0xe2() {
%1 = call i64 @isbdigit(i32 226)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1135, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xe2\00"
define void @t_isbdigit_0xe2() {
%1 = tail call i64 @isbdigit(i32 226)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1135, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
void clean(void *arg) {
  puts("clean: Unlocking mutex...");
  pthread_mutex_unlock((pthread_mutex_t *)arg);
  puts("clean: Mutex unlocked...");
}


x86 assembly (clang, -O0):
<clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <pthread_mutex_unlock@plt>
lea    0xedb(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"clean: Unlocking mutex...\00"
@.str.1 = [25 x i8] c"clean: Mutex unlocked...\00"
define void @clean(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = call i32 @pthread_mutex_unlock(i32* %5)
%7 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"clean: Unlocking mutex...\00"
@.str.1 = [25 x i8] c"clean: Mutex unlocked...\00"
define void @clean(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @pthread_mutex_unlock(i32* %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int mangle_truncate_at(char arr[64], int arr_len, int upos) {
  if (upos >= arr_len)
    return (arr_len);
  memset(arr + upos, 0, arr_len - upos);
  return (upos);
}


x86 assembly (clang, -O0):
<mangle_truncate_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1139 <mangle_truncate_at+0x29>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <mangle_truncate_at+0x47>
mov    -0x10(%rbp),%rdi
movslq -0x18(%rbp),%rax
add    %rax,%rdi
mov    -0x14(%rbp),%edx
sub    -0x18(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mangle_truncate_at>:
push   %rbx
mov    %edx,%ebx
mov    %esi,%eax
mov    %esi,%edx
sub    %ebx,%edx
jle    112a <mangle_truncate_at+0x1a>
movslq %ebx,%rax
add    %rax,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @mangle_truncate_at(i8* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = sub nsw i32 %1, %2
%9 = tail call i32 @memset(i8* %7, i32 0, i32 %8)
br label %10
10: ; preds = %3, %5
%11 = phi i32 [ %2, %5 ], [ %1, %3 ]
ret i32 %11
}
/* Variables and functions */
char *adjust_unit(double *);
int /*<<< orphan*/ printf(char *, double, char const *);
void pr_avg_speed(double speed) {
  const char *unit = adjust_unit(&speed);
  printf("Average reading speed: %.2f %s/s\n", speed, unit);
}


x86 assembly (clang, -O0):
<pr_avg_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <adjust_unit@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_avg_speed>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <adjust_unit@plt>
movsd  (%rsp),%xmm0
lea    0xec6(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Average reading speed: %.2f %s/s\0A\00"
define void @pr_avg_speed(double %0) {
%2 = alloca double
%3 = alloca i8*
store double %0, double* %2
%4 = call i8* @adjust_unit(double* %2)
store i8* %4, i8** %3
%5 = load double, double* %2
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), double %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Average reading speed: %.2f %s/s\0A\00"
define void @pr_avg_speed(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i8* @adjust_unit(double* %2)
%4 = load double, double* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), double %4, i8* %3)
ret void
}
/* Variables and functions */
int chdir(char *);
int bad_chdir(void *addr) { return chdir((char *)addr); }


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

x86 assembly (clang, -O2):
<bad_chdir>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define i32 @bad_chdir(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
void ARGBScaleClip() {}


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

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

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

LLVM IR (-O2):
define void @ARGBScaleClip() {
ret void
}
int count(int in) {
  int cnt = 0, tmp;
  while ((tmp = in & (~in + 1))) {
    cnt++;
    in &= ~tmp;
  }
  return cnt;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
add    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1142 <count+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <count+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
mov    %edi,%ecx
neg    %ecx
xor    %eax,%eax
and    %edi,%ecx
je     111d <count+0x1d>
nopw   0x0(%rax,%rax,1)
xor    %ecx,%edi
add    $0x1,%eax
mov    %edi,%ecx
neg    %ecx
and    %edi,%ecx
jne    1110 <count+0x10>
ret

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

LLVM IR (-O2):
define i32 @count(i32 %0) {
%2 = sub i32 0, %0
%3 = and i32 %2, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %12, %5 ], [ %3, %1 ]
%7 = phi i32 [ %10, %5 ], [ %0, %1 ]
%8 = phi i32 [ %9, %5 ], [ 0, %1 ]
%9 = add nuw nsw i32 %8, 1
%10 = xor i32 %6, %7
%11 = sub i32 0, %10
%12 = and i32 %10, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("hello world!");
  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 <puts@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 = [13 x i8] c"hello world!\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 @puts(i8* getelementptr inbounds ([13 x i8], [13 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
}
int libpd_blocksize(void) { return 64; }


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

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

LLVM IR (-O0):
define i32 @libpd_blocksize() {
ret i32 64
}

LLVM IR (-O2):
define i32 @libpd_blocksize() {
ret i32 64
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *concatener(char *chemin, char *couleur) {
  char *result = malloc(strlen(chemin) + strlen(couleur) + 1);
  strcpy(result, chemin);
  strcat(result, couleur);
  return result;
}


x86 assembly (clang, -O0):
<concatener>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concatener>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @concatener(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = load i8*, i8** %4
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @concatener(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
int shr2(x)
int x;
{ return 2 * x; }


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

x86 assembly (clang, -O2):
<shr2>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @shr2(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
void *MPmalloc(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
void *MPrealloc(void *prevptr, int prevsize, int newsize) {
  void *tbr = MPmalloc(newsize);
  memcpy(tbr, prevptr, prevsize);
  return tbr;
}


x86 assembly (clang, -O0):
<MPrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <MPmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPrealloc>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %edx,%edi
call   1040 <MPmalloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <memcpy@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @MPrealloc(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @MPmalloc(i32 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
ret i8* %4
}
int __ltshort(short a, short b) { return a < b; }


x86 assembly (clang, -O0):
<__ltshort>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ltshort>:
xor    %eax,%eax
cmp    %si,%di
setl   %al
ret

LLVM IR (-O0):
define i32 @__ltshort(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = icmp slt i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @__ltshort(i16 signext %0, i16 signext %1) {
%3 = icmp slt i16 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned char inb(int);
int /*<<< orphan*/ outl(int, int);
unsigned char pci_read_config8(unsigned addr) {
  outl(0x80000000 | (addr & ~3), 0xCF8);
  return inb(0xCFC + (addr & 3));
}


x86 assembly (clang, -O0):
<pci_read_config8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xfffffffc,%edi
or     $0x80000000,%edi
mov    $0xcf8,%esi
call   1030 <outl@plt>
mov    -0x4(%rbp),%edi
and    $0x3,%edi
add    $0xcfc,%edi
call   1040 <inb@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_read_config8>:
push   %rbx
mov    %edi,%ebx
and    $0x7ffffffc,%edi
or     $0x80000000,%edi
mov    $0xcf8,%esi
call   1030 <outl@plt>
or     $0xcfc,%ebx
and    $0xcff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @pci_read_config8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -4
%5 = or i32 -2147483648, %4
%6 = call i32 @outl(i32 %5, i32 3320)
%7 = load i32, i32* %2
%8 = and i32 %7, 3
%9 = add i32 3324, %8
%10 = call zeroext i8 @inb(i32 %9)
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @pci_read_config8(i32 %0) {
%2 = and i32 %0, 2147483644
%3 = or i32 %2, -2147483648
%4 = tail call i32 @outl(i32 %3, i32 3320)
%5 = and i32 %0, 3
%6 = or i32 %5, 3324
%7 = tail call zeroext i8 @inb(i32 %6)
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  int i;
  for (i = 0; i < 10000; i++)
    foo((i * i) % 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    1157 <main+0x47>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    $0xcccccccd,%r14d
nopl   0x0(%rax)
mov    %ebx,%edi
imul   %edi,%edi
mov    %rdi,%rax
imul   %r14,%rax
shr    $0x22,%rax
lea    (%rax,%rax,4),%eax
sub    %eax,%edi
call   1030 <foo@plt>
add    $0x1,%ebx
cmp    $0x2710,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = mul nuw nsw i32 %2, %2
%4 = urem i32 %3, 5
%5 = tail call i32 @foo(i32 %4)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 10000
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *xmalloc_fatal(size_t size) {
  if (size == 0)
    return NULL;
  fprintf(stderr, "Out of memory.");
  exit(1);
}


x86 assembly (clang, -O0):
<xmalloc_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113f <xmalloc_fatal+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<xmalloc_fatal>:
test   %rdi,%rdi
jne    1128 <xmalloc_fatal+0x8>
xor    %eax,%eax
ret
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory.\00"
define noalias i8* @xmalloc_fatal(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1
ret i8* null
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ undelete(char const *);
void undelete_command(const char *dir) { undelete(dir); }


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

x86 assembly (clang, -O2):
<undelete_command>:
jmp    1030 <undelete@plt>

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

LLVM IR (-O2):
define void @undelete_command(i8* %0) {
%2 = tail call i32 @undelete(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello cruel world!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 = [20 x i8] c"Hello cruel world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Hello cruel world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}