xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t bswap_64(uint64_t x) {
  x = ((x << 8) & 0xFF00FF00FF00FF00ULL) | ((x >> 8) & 0x00FF00FF00FF00FFULL);
  x = ((x << 16) & 0xFFFF0000FFFF0000ULL) | ((x >> 16) & 0x0000FFFF0000FFFFULL);
  return (x >> 32) | (x << 32);
}


x86 assembly (clang, -O0):
<bswap_64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
cltq
movabs $0xff00ff00ff00ff00,%rcx
and    %rcx,%rax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
movabs $0xff00ff00ff00ff,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
cltq
movabs $0xffff0000ffff0000,%rcx
and    %rcx,%rax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
movabs $0xffff0000ffff,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bswap_64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = sext i32 %4 to i64
%6 = and i64 %5, -71777214294589696
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = sext i32 %8 to i64
%10 = and i64 %9, 71777214294589695
%11 = or i64 %6, %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = shl i32 %13, 16
%15 = sext i32 %14 to i64
%16 = and i64 %15, -281470681808896
%17 = load i32, i32* %2
%18 = ashr i32 %17, 16
%19 = sext i32 %18 to i64
%20 = and i64 %19, 281470681808895
%21 = or i64 %16, %20
%22 = trunc i64 %21 to i32
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = ashr i32 %23, 32
%25 = load i32, i32* %2
%26 = shl i32 %25, 32
%27 = or i32 %24, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @bswap_64(i32 %0) {
ret i32 poison
}
void ata_scsi_acpi_unbind(struct ata_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.ata_device = type opaque
define void @ata_scsi_acpi_unbind(%struct.ata_device* nocapture %0) {
ret void
}
/* Variables and functions */
int biscDriveStop();
int biscSpin(int);
int biscWaitAngle(int);
int biscSpinAngle(int velocity, int degrees) {
  if (biscSpin(velocity) == -1)
    return -1;
  if (biscWaitAngle(degrees) == -1)
    return -1;
  if (biscDriveStop() == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<biscSpinAngle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <biscSpin@plt>
cmp    $0xffffffff,%eax
jne    115b <biscSpinAngle+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    119b <biscSpinAngle+0x6b>
mov    -0xc(%rbp),%edi
call   1050 <biscWaitAngle@plt>
cmp    $0xffffffff,%eax
jne    1178 <biscSpinAngle+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    119b <biscSpinAngle+0x6b>
mov    $0x0,%al
call   1040 <biscDriveStop@plt>
cmp    $0xffffffff,%eax
jne    1194 <biscSpinAngle+0x64>
movl   $0xffffffff,-0x4(%rbp)
jmp    119b <biscSpinAngle+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<biscSpinAngle>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <biscSpin@plt>
mov    $0xffffffff,%ebx
cmp    $0xffffffff,%eax
je     1161 <biscSpinAngle+0x31>
mov    %ebp,%edi
call   1050 <biscWaitAngle@plt>
cmp    $0xffffffff,%eax
je     1161 <biscSpinAngle+0x31>
xor    %eax,%eax
call   1040 <biscDriveStop@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
sete   %bl
neg    %ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @biscSpinAngle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = call i32 @biscSpin(i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %20
10: ; preds = %2
%11 = load i32, i32* %5
%12 = call i32 @biscWaitAngle(i32 %11)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 -1, i32* %3
br label %20
15: ; preds = %10
%16 = call i32 (...) @biscDriveStop()
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 -1, i32* %3
br label %20
19: ; preds = %15
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18, %14, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @biscSpinAngle(i32 %0, i32 %1) {
%3 = tail call i32 @biscSpin(i32 %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i32 @biscWaitAngle(i32 %1)
%7 = icmp eq i32 %6, -1
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i32 (...) @biscDriveStop()
%10 = icmp eq i32 %9, -1
%11 = sext i1 %10 to i32
br label %12
12: ; preds = %8, %5, %2
%13 = phi i32 [ -1, %2 ], [ -1, %5 ], [ %11, %8 ]
ret i32 %13
}
int isDigit(int n) { return (n - '0' >= 0 && n - '0' <= 9); }


x86 assembly (clang, -O0):
<isDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x30,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jl     112a <isDigit+0x2a>
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
cmp    $0x9,%eax
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isDigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 48
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 48
%9 = icmp sle i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isDigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
size_t dsm_dxfeed_maxsize(void) { return (4 * 1024); }


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

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

LLVM IR (-O0):
define i64 @dsm_dxfeed_maxsize() {
ret i64 4096
}

LLVM IR (-O2):
define i64 @dsm_dxfeed_maxsize() {
ret i64 4096
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void fatal(char *msg) {
  puts(msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @fatal(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, char const *, char const *, void *, size_t);
ssize_t getxattr(const char *path, const char *name, void *value, size_t size) {
  return syscall(229, path, name, value, size);
}


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

x86 assembly (clang, -O2):
<getxattr>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xe5,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @getxattr(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @syscall(i32 229, i8* %9, i8* %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @getxattr(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @syscall(i32 229, i8* %0, i8* %1, i8* %2, i64 %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *const);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *const);
void lock_twice(pthread_mutex_t *const p) {
  pthread_mutex_lock(p);
  pthread_mutex_lock(p);
  pthread_mutex_unlock(p);
  pthread_mutex_unlock(p);
}


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

x86 assembly (clang, -O2):
<lock_twice>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pthread_mutex_lock@plt>
mov    %rbx,%rdi
call   1040 <pthread_mutex_lock@plt>
mov    %rbx,%rdi
call   1030 <pthread_mutex_unlock@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <pthread_mutex_unlock@plt>

LLVM IR (-O0):
define void @lock_twice(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @pthread_mutex_lock(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @pthread_mutex_lock(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @pthread_mutex_unlock(i32* %7)
%9 = load i32*, i32** %2
%10 = call i32 @pthread_mutex_unlock(i32* %9)
ret void
}

LLVM IR (-O2):
define void @lock_twice(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
%3 = tail call i32 @pthread_mutex_lock(i32* %0)
%4 = tail call i32 @pthread_mutex_unlock(i32* %0)
%5 = tail call i32 @pthread_mutex_unlock(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bruteforce(char *, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  char pass[10 + 1] = "xxxxxxxxxx";
  fprintf(stderr, "\n[*] Password generation...\n\n");
  bruteforce(pass, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x5(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   1040 <fprintf@plt>
lea    -0xf(%rbp),%rdi
xor    %esi,%esi
call   1030 <bruteforce@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x7878787878787878,%rax
78 78 78
mov    %rax,0x8(%rsp)
movl   $0x787878,0xf(%rsp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <bruteforce@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.pass = [11 x i8] c"xxxxxxxxxx\00"
@stderr = global i32 0
@.str = [30 x i8] c"\0A[*] Password generation...\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
store i32 0, i32* %1
%3 = bitcast [11 x i8]* %2 to i8*
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%7 = call i32 @bruteforce(i8* %6, i32 0)
ret i32 0
}

LLVM IR (-O2):
@__const.main.pass = [11 x i8] c"xxxxxxxxxx\00"
@stderr = global i32 0
@.str = [30 x i8] c"\0A[*] Password generation...\0A\0A\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @bruteforce(i8* %2, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M406_f(char *s) {
  debug("M406_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [47 x i8] c"M406_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M406_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
struct szb_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(struct szb_s *);
int /*<<< orphan*/ szb_clear(struct szb_s *);
void szb_free(struct szb_s *szb) {
  assert(szb != NULL);
  szb_clear(szb);
  free(szb);
}


x86 assembly (clang, -O0):
<szb_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1050 <szb_clear@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<szb_free>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <szb_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.szb_s = type { i32 }
define void @szb_free(%struct.szb_s* %0) {
%2 = alloca %struct.szb_s*
store %struct.szb_s* %0, %struct.szb_s** %2
%3 = load %struct.szb_s*, %struct.szb_s** %2
%4 = icmp ne %struct.szb_s* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.szb_s*, %struct.szb_s** %2
%8 = call i32 @szb_clear(%struct.szb_s* %7)
%9 = load %struct.szb_s*, %struct.szb_s** %2
%10 = call i32 @free(%struct.szb_s* %9)
ret void
}

LLVM IR (-O2):
%struct.szb_s = type { i32 }
define void @szb_free(%struct.szb_s* %0) {
%2 = icmp ne %struct.szb_s* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @szb_clear(%struct.szb_s* %0)
%6 = tail call i32 @free(%struct.szb_s* %0)
ret void
}
int foo(void) { return 8; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 8
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 8
}
int isPowerOf2(int x) { return (x & (x - 1)) == 0; }


x86 assembly (clang, -O0):
<isPowerOf2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOf2>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isPowerOf2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isPowerOf2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strrchr(char *, char);
char *_get_suite_name(const char *filename) {
  char *suite_name = malloc(strlen(filename) + 1);
  strcpy(suite_name, filename);
  char *last_dot_pos = strrchr(suite_name, '.');
  if (last_dot_pos != NULL)
    *last_dot_pos = '\0';
  return suite_name;
}


x86 assembly (clang, -O0):
<_get_suite_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1050 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1196 <_get_suite_name+0x56>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_suite_name>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1050 <strrchr@plt>
test   %rax,%rax
je     1178 <_get_suite_name+0x38>
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @_get_suite_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
%13 = call i8* @strrchr(i8* %12, i8 signext 46)
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %1
%17 = load i8*, i8** %4
store i8 0, i8* %17
br label %18
18: ; preds = %16, %1
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @_get_suite_name(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
%6 = tail call i8* @strrchr(i8* dereferenceable(1) %4, i8 signext 46)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8 0, i8* %6
br label %9
9: ; preds = %8, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ sleep(unsigned int);
int /*<<< orphan*/ usleep(int);
void waitForTimerMs(unsigned int nbMs) {
  unsigned int nbSecs;
  unsigned int nbMsecs;
  nbSecs = nbMs / 1000;
  nbMsecs = nbMs % 1000;
  sleep(nbSecs);
  usleep(1000 * nbMsecs);
}


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

x86 assembly (clang, -O2):
<waitForTimerMs>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rdi
shr    $0x26,%rdi
imul   $0x3e8,%edi,%eax
sub    %eax,%ebx
call   1030 <sleep@plt>
imul   $0x3e8,%ebx,%edi
pop    %rbx
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @waitForTimerMs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = udiv i32 %5, 1000
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = urem i32 %7, 1000
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = call i32 @sleep(i32 %9)
%11 = load i32, i32* %4
%12 = mul i32 1000, %11
%13 = call i32 @usleep(i32 %12)
ret void
}

LLVM IR (-O2):
define void @waitForTimerMs(i32 %0) {
%2 = udiv i32 %0, 1000
%3 = urem i32 %0, 1000
%4 = tail call i32 @sleep(i32 %2)
%5 = mul nuw nsw i32 %3, 1000
%6 = tail call i32 @usleep(i32 %5)
ret void
}
unsigned PCAP16(unsigned byte_order, const unsigned char *buf) {
  switch (byte_order) {
  case 1:
    return buf[0] * 256 + buf[1];
  case 2:
    return buf[1] * 256 + buf[0];
  default:
    return 0xa3a3;
  }
}


x86 assembly (clang, -O0):
<PCAP16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     1130 <PCAP16+0x30>
jmp    111f <PCAP16+0x1f>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     114c <PCAP16+0x4c>
jmp    1168 <PCAP16+0x68>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116f <PCAP16+0x6f>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116f <PCAP16+0x6f>
movl   $0xa3a3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PCAP16>:
cmp    $0x2,%edi
je     1115 <PCAP16+0x15>
mov    $0xa3a3,%eax
cmp    $0x1,%edi
jne    1127 <PCAP16+0x27>
lea    0x1(%rsi),%rax
jmp    111c <PCAP16+0x1c>
mov    %rsi,%rax
add    $0x1,%rsi
movzbl (%rsi),%ecx
shl    $0x8,%ecx
movzbl (%rax),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @PCAP16(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
switch i32 %6, label %29 [
i32 1, label %7
i32 2, label %18
]
7: ; preds = %2
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = mul nsw i32 %11, 256
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = add nsw i32 %12, %16
store i32 %17, i32* %3
br label %30
18: ; preds = %2
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = mul nsw i32 %22, 256
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = add nsw i32 %23, %27
store i32 %28, i32* %3
br label %30
29: ; preds = %2
store i32 41891, i32* %3
br label %30
30: ; preds = %29, %18, %7
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @PCAP16(i32 %0, i8* nocapture %1) {
switch i32 %0, label %16 [
i32 1, label %3
i32 2, label %5
]
3: ; preds = %2
%4 = getelementptr inbounds i8, i8* %1, i64 1
br label %7
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %1, i64 1
br label %7
7: ; preds = %3, %5
%8 = phi i8* [ %1, %5 ], [ %4, %3 ]
%9 = phi i8* [ %6, %5 ], [ %1, %3 ]
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 8
%13 = load i8, i8* %8
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
br label %16
16: ; preds = %7, %2
%17 = phi i32 [ 41891, %2 ], [ %15, %7 ]
ret i32 %17
}
/* Variables and functions */
int mpu_write_mem(int, int, unsigned char *);
int dmp_set_tap_time_multi(unsigned short time) {
  unsigned short dmp_time;
  unsigned char tmp[2];
  dmp_time = time / (1000 / (200));
  tmp[0] = (unsigned char)(dmp_time >> 8);
  tmp[1] = (unsigned char)(dmp_time & 0xFF);
  return mpu_write_mem((256 + 218), 2, tmp);
}


x86 assembly (clang, -O0):
<dmp_set_tap_time_multi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rdx
mov    $0x1da,%edi
mov    $0x2,%esi
call   1030 <mpu_write_mem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmp_set_tap_time_multi>:
push   %rax
imul   $0xcccd,%edi,%eax
shr    $0x12,%eax
rol    $0x8,%ax
mov    %ax,0x6(%rsp)
lea    0x6(%rsp),%rdx
mov    $0x1da,%edi
mov    $0x2,%esi
call   1030 <mpu_write_mem@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dmp_set_tap_time_multi(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca [2 x i8]
store i16 %0, i16* %2
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = sdiv i32 %6, 5
%8 = trunc i32 %7 to i16
store i16 %8, i16* %3
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = ashr i32 %10, 8
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 %12, i8* %13
%14 = load i16, i16* %3
%15 = zext i16 %14 to i32
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 %17, i8* %18
%19 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%20 = call i32 @mpu_write_mem(i32 474, i32 2, i8* %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @dmp_set_tap_time_multi(i16 zeroext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = udiv i16 %0, 5
%5 = lshr i16 %4, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %3
%7 = trunc i16 %4 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @mpu_write_mem(i32 474, i32 2, i8* %3)
ret i32 %9
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *memdup(void *src, size_t size) {
  void *dst = malloc(size);
  memcpy(dst, src, size);
  return dst;
}


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

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @memdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @memcpy(i8* %8, i8* %9, i64 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int strcasecmp(char *, char *);
void strcasecmp_diff_length_3() {
  char *x = "aBc";
  char *y = "abcde";
  if (strcasecmp(x, y) != -1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strcasecmp_diff_length_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0xffffffff,%eax
je     1144 <strcasecmp_diff_length_3+0x34>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"aBc\00"
@.str.1 = [6 x i8] c"abcde\00"
define void @strcasecmp_diff_length_3() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strcasecmp(i8* %3, i8* %4)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @strcasecmp_diff_length_3() {
ret void
}
void osd_ext_clone_update_pan(int pan) {}


x86 assembly (clang, -O0):
<osd_ext_clone_update_pan>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @osd_ext_clone_update_pan(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_tx_hex32(unsigned int);
void print_debug_hex32(unsigned int value) { console_tx_hex32(value); }


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

x86 assembly (clang, -O2):
<print_debug_hex32>:
jmp    1030 <console_tx_hex32@plt>

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

LLVM IR (-O2):
define void @print_debug_hex32(i32 %0) {
%2 = tail call i32 @console_tx_hex32(i32 %0)
ret void
}
void mod_sl2_diagn_return_query_data(struct mod_l2 *l2) {}


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

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

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

LLVM IR (-O2):
%struct.mod_l2 = type opaque
define void @mod_sl2_diagn_return_query_data(%struct.mod_l2* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int usage(const char *pname, int exit) {
  printf("Usage: %s FILE <buy|sell|inventory|state|history> ...\n"
         "\n"
         "Perform the chosen action on file FILE.\n",
         pname);
  return exit;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [96 x i8] c"Usage: %s FILE <buy|sell|inventory|state|history> ...\0A\0APerform the chosen action on file FILE.\0A\00"
define i32 @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
@.str = [96 x i8] c"Usage: %s FILE <buy|sell|inventory|state|history> ...\0A\0APerform the chosen action on file FILE.\0A\00"
define i32 @usage(i8* %0, i32 returned %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstrNoOperand(int);
int /*<<< orphan*/ GenUpdateFrameSize();
void GenFxnEpilog(void) {
  GenUpdateFrameSize();
  GenPrintInstrNoOperand(0x1F);
  GenPrintInstrNoOperand(0x21);
}


x86 assembly (clang, -O0):
<GenFxnEpilog>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GenUpdateFrameSize@plt>
mov    $0x1f,%edi
call   1030 <GenPrintInstrNoOperand@plt>
mov    $0x21,%edi
call   1030 <GenPrintInstrNoOperand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenFxnEpilog>:
push   %rax
xor    %eax,%eax
call   1040 <GenUpdateFrameSize@plt>
mov    $0x1f,%edi
call   1030 <GenPrintInstrNoOperand@plt>
mov    $0x21,%edi
pop    %rax
jmp    1030 <GenPrintInstrNoOperand@plt>

LLVM IR (-O0):
define void @GenFxnEpilog() {
%1 = call i32 (...) @GenUpdateFrameSize()
%2 = call i32 @GenPrintInstrNoOperand(i32 31)
%3 = call i32 @GenPrintInstrNoOperand(i32 33)
ret void
}

LLVM IR (-O2):
define void @GenFxnEpilog() {
%1 = tail call i32 (...) @GenUpdateFrameSize()
%2 = tail call i32 @GenPrintInstrNoOperand(i32 31)
%3 = tail call i32 @GenPrintInstrNoOperand(i32 33)
ret void
}
/* Variables and functions */
char const *quote_n(int /*<<< orphan*/, char const *);
char const *quote(char const *name) { return quote_n(0, name); }


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

x86 assembly (clang, -O2):
<quote>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <quote_n@plt>

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

LLVM IR (-O2):
define i8* @quote(i8* %0) {
%2 = tail call i8* @quote_n(i32 0, i8* %0)
ret i8* %2
}
int incr(int i) { return (i + 1) % 100; }


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

x86 assembly (clang, -O2):
<incr>:
add    $0x1,%edi
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @incr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = srem i32 %4, 100
ret i32 %5
}

LLVM IR (-O2):
define i32 @incr(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = srem i32 %2, 100
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *xstrdup(char const *);
int cmd_string(const char *com, const char *val, void *closure) {
  char **pstring = (char **)closure;
  do {
    if (*pstring)
      free(*pstring);
  } while (0);
  *pstring = xstrdup(val);
  return 1;
}


x86 assembly (clang, -O0):
<cmd_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     1156 <cmd_string+0x36>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
jmp    115b <cmd_string+0x3b>
mov    -0x10(%rbp),%rdi
call   1040 <xstrdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    (%rdx),%rdi
test   %rdi,%rdi
je     1137 <cmd_string+0x17>
call   1030 <free@plt>
mov    %r14,%rdi
call   1040 <xstrdup@plt>
mov    %rax,(%rbx)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @cmd_string(i8* nocapture readnone %0, i8* %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i8**
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @free(i8* %5)
br label %9
9: ; preds = %7, %3
%10 = tail call i8* @xstrdup(i8* %1)
store i8* %10, i8** %4
ret i32 1
}
/* Variables and functions */
int IFF_NO_PI;
int IFF_TAP;
int __tuntap_create(char *, int);
int tapdev_create(char *tap_name) {
  return __tuntap_create(tap_name, IFF_TAP | IFF_NO_PI);
}


x86 assembly (clang, -O0):
<tapdev_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
or     (%rax),%esi
call   1030 <__tuntap_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tapdev_create>:
mov    0x2ec9(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <__tuntap_create@plt>

LLVM IR (-O0):
@IFF_TAP = global i32 0
@IFF_NO_PI = global i32 0
define i32 @tapdev_create(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @IFF_TAP
%5 = load i32, i32* @IFF_NO_PI
%6 = or i32 %4, %5
%7 = call i32 @__tuntap_create(i8* %3, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@IFF_TAP = global i32 0
@IFF_NO_PI = global i32 0
define i32 @tapdev_create(i8* %0) {
%2 = load i32, i32* @IFF_TAP
%3 = load i32, i32* @IFF_NO_PI
%4 = or i32 %3, %2
%5 = tail call i32 @__tuntap_create(i8* %0, i32 %4)
ret i32 %5
}
/* Type definitions */
struct inode {
  int dummy;
};
struct filesystem {
  int dummy;
};

/* Variables and functions */
struct inode *fscreatefile(struct filesystem *f, char *path) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.inode = type { i32 }
%struct.filesystem = type { i32 }
define %struct.inode* @fscreatefile(%struct.filesystem* %0, i8* %1) {
%3 = alloca %struct.filesystem*
%4 = alloca i8*
store %struct.filesystem* %0, %struct.filesystem** %3
store i8* %1, i8** %4
ret %struct.inode* null
}

LLVM IR (-O2):
%struct.inode = type { i32 }
%struct.filesystem = type { i32 }
define noalias %struct.inode* @fscreatefile(%struct.filesystem* nocapture readnone %0, i8* nocapture readnone %1) {
ret %struct.inode* null
}
int rl_show_char(int c) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rl_show_char(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t AONPMCTLPowerStatusGet(void) {
  return ((*((volatile unsigned long *)(0x40090000 + 0x00000014))));
}


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

x86 assembly (clang, -O2):
<AONPMCTLPowerStatusGet>:
mov    0x40090014,%rax
40
ret

LLVM IR (-O0):
define i64 @AONPMCTLPowerStatusGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074331668 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @AONPMCTLPowerStatusGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074331668 to i64*)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ ddate_2();
int main() {
  ddate_2();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @ddate_2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ddate_2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
void print_version(const char *progname) {
  (void)fprintf(stderr, "%s %s\n", progname, "version 0.01");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
lea    0xed0(%rip),%rcx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
lea    0xedd(%rip),%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [13 x i8] c"version 0.01\00"
define void @print_version(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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [13 x i8] c"version 0.01\00"
define void @print_version(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ genericError(char *, int, char const *, char const *);
void errorRegexFailed(const char *regex, const char *line) {
  genericError("The regex failed when matching \"%s\" with \"%s\"", 4, regex,
               line);
}


x86 assembly (clang, -O0):
<errorRegexFailed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
mov    $0x4,%esi
call   1030 <genericError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorRegexFailed>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
mov    $0x4,%esi
jmp    1030 <genericError@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"The regex failed when matching \22%s\22 with \22%s\22\00"
define void @errorRegexFailed(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @genericError(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 4, i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"The regex failed when matching \22%s\22 with \22%s\22\00"
define void @errorRegexFailed(i8* %0, i8* %1) {
%3 = tail call i32 @genericError(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 4, i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ linux_WEXITSTATUS(int const);
uint8_t linux_WSTOPSIG(int const status) { return linux_WEXITSTATUS(status); }


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

x86 assembly (clang, -O2):
<linux_WSTOPSIG>:
jmp    1030 <linux_WEXITSTATUS@plt>

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

LLVM IR (-O2):
define i32 @linux_WSTOPSIG(i32 %0) {
%2 = tail call i32 @linux_WEXITSTATUS(i32 %0)
ret i32 %2
}
/* Variables and functions */
int count(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", count("Lorhan"));
  printf("%d\n", count("Kondo"));
  printf("%d\n", count("123"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <count@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
call   1030 <count@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
lea    0xea7(%rip),%rdi
call   1030 <count@plt>
mov    %eax,%esi
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xedc(%rip),%rdi
call   1030 <count@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <count@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1030 <count@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"Lorhan\00"
@.str.2 = [6 x i8] c"Kondo\00"
@.str.3 = [4 x i8] c"123\00"
define i32 @main() {
%1 = tail call i32 @count(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @count(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @count(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int md_check_partitions(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @md_check_partitions() {
ret i32 1
}

LLVM IR (-O2):
define i32 @md_check_partitions() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(void const *, void const *, size_t);
bool cutils_cdar_DynamicArray_int_compare(const void *p1, const void *p2,
                                          size_t s) {
  return !memcmp(p1, p2, s);
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_int_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_int_compare>:
push   %rax
call   1030 <bcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cutils_cdar_DynamicArray_int_compare(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_int_compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}