xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, ...);
char *sha_hash_file(char *);
void sha_hash_file_output(char *filename) {
  if (filename == NULL) {
    printf("%s  -\n", sha_hash_file(filename));
  } else {
    printf("%s  %s\n", sha_hash_file(filename), filename);
  }
}


x86 assembly (clang, -O0):
<sha_hash_file_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <sha_hash_file_output+0x36>
mov    -0x8(%rbp),%rdi
call   1040 <sha_hash_file@plt>
mov    %rax,%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1174 <sha_hash_file_output+0x54>
mov    -0x8(%rbp),%rdi
call   1040 <sha_hash_file@plt>
mov    %rax,%rsi
mov    -0x8(%rbp),%rdx
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha_hash_file_output>:
push   %rbx
test   %rdi,%rdi
je     1143 <sha_hash_file_output+0x23>
mov    %rdi,%rbx
call   1040 <sha_hash_file@plt>
lea    0xed2(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>
xor    %edi,%edi
call   1040 <sha_hash_file@plt>
lea    0xeaf(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s -\0A\00"
@.str.1 = [8 x i8] c"%s %s\0A\00"
define void @sha_hash_file_output(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i8* @sha_hash_file(i8* null)
%5 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %9
6: ; preds = %1
%7 = tail call i8* @sha_hash_file(i8* %0)
%8 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %0)
br label %9
9: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_file(char *, int /*<<< orphan*/, char *, int);
void unexport(void) { write_file("/sys/class/gpio/unexport", 0, "%d\n", 8); }


x86 assembly (clang, -O0):
<unexport>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
lea    0xef5(%rip),%rdx
mov    $0x8,%ecx
call   1030 <write_file@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unexport>:
lea    0xee9(%rip),%rdi
lea    0xefb(%rip),%rdx
xor    %esi,%esi
mov    $0x8,%ecx
jmp    1030 <write_file@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"/sys/class/gpio/unexport\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @unexport() {
%1 = call i32 @write_file(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"/sys/class/gpio/unexport\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @unexport() {
%1 = tail call i32 @write_file(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ opa_free(void *);
void free(void *ptr) { opa_free(ptr); }


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

x86 assembly (clang, -O2):
<free>:
jmp    1030 <opa_free@plt>

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

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = tail call i32 @opa_free(i8* %0)
ret void
}
void RTBase64DecodedSize(void) {}


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

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

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

LLVM IR (-O2):
define void @RTBase64DecodedSize() {
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int fstat(int fd, struct stat *buf) {
  errno = -ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %ecx,%ecx
mov    0x2ed4(%rip),%rax
sub    (%rax),%ecx
mov    0x2ebb(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat>:
mov    0x2ee1(%rip),%rax
xor    %ecx,%ecx
sub    (%rax),%ecx
mov    0x2ec6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @ENOSYS
%6 = sub nsw i32 0, %5
store i32 %6, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fstat(i32 %0, %struct.stat* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
store i32 %4, i32* @errno
ret i32 -1
}
int func3(void) { return 67890; }


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

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

LLVM IR (-O0):
define i32 @func3() {
ret i32 67890
}

LLVM IR (-O2):
define i32 @func3() {
ret i32 67890
}
/* Variables and functions */
int /*<<< orphan*/ mylib1_fct1();
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Hello, world!");
  mylib1_fct1();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @mylib1_fct1()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @mylib1_fct1()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  int tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
uint64_t timespec_delta(struct timespec *before, struct timespec *after) {
  return 1000000000 * (after->tv_sec - before->tv_sec) +
         (after->tv_nsec - before->tv_nsec);
}


x86 assembly (clang, -O0):
<timespec_delta>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
imul   $0x3b9aca00,%eax,%eax
cltq
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
mov    -0x8(%rbp),%rdx
sub    0x8(%rdx),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_delta>:
movslq (%rsi),%rax
movslq (%rdi),%rcx
sub    %rcx,%rax
imul   $0x3b9aca00,%rax,%rcx
mov    0x8(%rsi),%rax
sub    0x8(%rdi),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i64 @timespec_delta(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timespec*, %struct.timespec** %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 1000000000, %11
%13 = sext i32 %12 to i64
%14 = load %struct.timespec*, %struct.timespec** %4
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = load %struct.timespec*, %struct.timespec** %3
%18 = getelementptr inbounds %struct.timespec, %struct.timespec* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = sub nsw i64 %16, %19
%21 = add nsw i64 %13, %20
ret i64 %21
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i64 @timespec_delta(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000000
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%13 = load i64, i64* %12
%14 = sub i64 %11, %13
%15 = add nsw i64 %14, %9
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ register_plcc_function_list();
void plcc_init() { register_plcc_function_list(); }


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

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

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

LLVM IR (-O2):
define void @plcc_init() {
%1 = tail call i32 (...) @register_plcc_function_list()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int int8_t;

/* Variables and functions */
int /*<<< orphan*/ func_97c_c(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ memcmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int func_abc_c(uint8_t *encstart, uint8_t *kworking, int length) {
  uint8_t scratch[20];
  func_97c_c(encstart, length, scratch);
  return (int8_t)(memcmp(scratch, kworking, 20));
}


x86 assembly (clang, -O0):
<func_abc_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x70(%rbp),%rdx
call   1040 <func_97c_c@plt>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x14,%edx
call   1030 <memcmp@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_abc_c>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %edx,%esi
mov    %r14,%rdx
call   1040 <func_97c_c@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x14,%edx
call   1030 <memcmp@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @func_abc_c(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca [20 x i32]
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %6
%10 = getelementptr inbounds [20 x i32], [20 x i32]* %7, i64 0, i64 0
%11 = call i32 @func_97c_c(i32* %8, i32 %9, i32* %10)
%12 = getelementptr inbounds [20 x i32], [20 x i32]* %7, i64 0, i64 0
%13 = load i32*, i32** %5
%14 = call i32 @memcmp(i32* %12, i32* %13, i32 20)
ret i32 %14
}

LLVM IR (-O2):
define i32 @func_abc_c(i32* %0, i32* %1, i32 %2) {
%4 = alloca [20 x i32]
%5 = bitcast [20 x i32]* %4 to i8*
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
%7 = call i32 @func_97c_c(i32* %0, i32 %2, i32* %6)
%8 = call i32 @memcmp(i32* %6, i32* %1, i32 20)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int mkdir(char const *, int /*<<< orphan*/);
__attribute__((__weak__, __always___)) int
softboundmpx_mkdir(const char *pathname, mode_t mode) {
  return mkdir(pathname, mode);
}


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

x86 assembly (clang, -O2):
<softboundmpx_mkdir>:
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
define weak i32 @softboundmpx_mkdir(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 = load i32, i32* %4
%7 = call i32 @mkdir(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define weak i32 @softboundmpx_mkdir(i8* %0, i32 %1) {
%3 = tail call i32 @mkdir(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef unsigned long long __u8;

/* Variables and functions */
__u8 hea_u8_bit(int b) {
  return ((~0ULL << (63 - (b + 56))) & (~0ULL >> (b + 56)));
}


x86 assembly (clang, -O0):
<hea_u8_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
add    $0x38,%ecx
mov    $0x3f,%eax
sub    %ecx,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
mov    -0x4(%rbp),%ecx
add    $0x38,%ecx
mov    %ecx,%ecx
mov    $0xffffffffffffffff,%rdx
shr    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_u8_bit>:
mov    $0x7,%cl
sub    %dil,%cl
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
lea    0x38(%rdi),%ecx
shl    %cl,%rax
shr    %cl,%rax
ret

LLVM IR (-O0):
define i64 @hea_u8_bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 56
%5 = sub nsw i32 63, %4
%6 = zext i32 %5 to i64
%7 = shl i64 -1, %6
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 56
%10 = zext i32 %9 to i64
%11 = lshr i64 -1, %10
%12 = and i64 %7, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @hea_u8_bit(i32 %0) {
%2 = add nsw i32 %0, 56
%3 = sub i32 7, %0
%4 = zext i32 %3 to i64
%5 = shl nsw i64 -1, %4
%6 = zext i32 %2 to i64
%7 = lshr i64 -1, %6
%8 = and i64 %5, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void exit_unclean(void) { die("Thread exited without calling exit\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Thread exited without calling exit\0A\00"
define void @exit_unclean() {
%1 = call i32 @die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Thread exited without calling exit\0A\00"
define void @exit_unclean() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned long I2SRxFIFOLevelGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000818))));
}


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

x86 assembly (clang, -O2):
<I2SRxFIFOLevelGet>:
mov    0x818(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @I2SRxFIFOLevelGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 2072
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @I2SRxFIFOLevelGet(i64 %0) {
%2 = add i64 %0, 2072
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int i2c_smbus_read_byte_data(int, int);
int ci20I2CReadReg8(int fd, int reg) {
  return i2c_smbus_read_byte_data(fd, reg);
}


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

x86 assembly (clang, -O2):
<ci20I2CReadReg8>:
jmp    1030 <i2c_smbus_read_byte_data@plt>

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

LLVM IR (-O2):
define i32 @ci20I2CReadReg8(i32 %0, i32 %1) {
%3 = tail call i32 @i2c_smbus_read_byte_data(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ floor(int);
int mod(int a, int b) { return a - b * (int)floor(a / b); }


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
call   1030 <floor@plt>
mov    -0x10(%rbp),%ecx
mov    %rax,%rdx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%edi
call   1030 <floor@plt>
imul   %ebx,%eax
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sdiv i32 %7, %8
%10 = call i64 @floor(i32 %9)
%11 = trunc i64 %10 to i32
%12 = mul nsw i32 %6, %11
%13 = sub nsw i32 %5, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = tail call i64 @floor(i32 %3)
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, %1
%7 = sub nsw i32 %0, %6
ret i32 %7
}
/* Variables and functions */
int write(int, void *, int);
int Serial_Write(int fd, unsigned char *byWriteBuf, int nWriteLen) {
  int nLen;
  nLen = write(fd, (void *)byWriteBuf, nWriteLen);
  return nLen;
}


x86 assembly (clang, -O0):
<Serial_Write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Serial_Write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @Serial_Write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn36() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn36");
  return result;
}


x86 assembly (clang, -O0):
<fn36>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn36>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn36\00"
define i8* @fn36() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn36\00"
define i8* @fn36() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, char, size_t);
void tst_numa_fault(void *ptr, size_t size) { memset(ptr, 'a', size); }


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

x86 assembly (clang, -O2):
<tst_numa_fault>:
mov    %rsi,%rdx
mov    $0x61,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @tst_numa_fault(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @memset(i8* %5, i8 signext 97, i64 %6)
ret void
}

LLVM IR (-O2):
define void @tst_numa_fault(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i8 signext 97, i64 %1)
ret void
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 && *s1 == *s2) {
    ++s1;
    ++s2;
  }
  return (int)(unsigned char)*s1 - (int)(unsigned char)*s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br label %18
18: ; preds = %10, %5
%19 = phi i1 [ false, %5 ], [ %17, %10 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = sub nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ esc_prn(char *);
int help_write(int argc, char **argv) {
  esc_prn("\n{Hwrite} [{UFILENAME}[.vpc]]\n"
          "  Save the configuration to the file {UFILENAME.vpc}. If there is "
          "no '.' in\n"
          "  {UFILENAME} then a '.vpc' extension is added. If {UFILENAME} is "
          "omitted then the\n"
          "  configuration will be saved to {Ustartup.vpc}\n");
  return 1;
}


x86 assembly (clang, -O0):
<help_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <esc_prn@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [238 x i8] c"\0A{Hwrite} [{UFILENAME}[.vpc]]\0A Save the configuration to the file {UFILENAME.vpc}. If there is no '.' in\0A {UFILENAME} then a '.vpc' extension is added. If {UFILENAME} is omitted then the\0A configuration will be saved to {Ustartup.vpc}\0A\00"
define i32 @help_write(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @esc_prn(i8* getelementptr inbounds ([238 x i8], [238 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [238 x i8] c"\0A{Hwrite} [{UFILENAME}[.vpc]]\0A Save the configuration to the file {UFILENAME.vpc}. If there is no '.' in\0A {UFILENAME} then a '.vpc' extension is added. If {UFILENAME} is omitted then the\0A configuration will be saved to {Ustartup.vpc}\0A\00"
define i32 @help_write(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @esc_prn(i8* getelementptr inbounds ([238 x i8], [238 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
void EnterMutex(void) {}


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

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

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

LLVM IR (-O2):
define void @EnterMutex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ usage(char *);
void userErrorString(char *format, char *var) {
  char userErrorMsg[1000];
  sprintf(userErrorMsg, format, var);
  usage(userErrorMsg);
}


x86 assembly (clang, -O0):
<userErrorString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1030 <usage@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<userErrorString>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <usage@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @userErrorString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1000 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%11 = call i32 @usage(i8* %10)
ret void
}

LLVM IR (-O2):
define void @userErrorString(i8* nocapture %0, i8* %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, i8* %1)
%6 = call i32 @usage(i8* %4)
ret void
}
f(char *a, const char *b) { return a - b; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(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 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
int Futimes(int fd, int as, int au, int ms, int mu) { return -1; }


x86 assembly (clang, -O0):
<Futimes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Futimes(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 -1
}

LLVM IR (-O2):
define i32 @Futimes(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret i32 -1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ time;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xcrossing_time(void *_p) {
  return (unsigned long)((XEvent *)_p)->xcrossing.time;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xcrossing_time>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xcrossing_time(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xcrossing_time(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned int, unsigned int,
                           unsigned int, unsigned int);
const char *ipaddr(unsigned addr) {
  static char buf[32];
  sprintf(buf, "%d.%d.%d.%d", addr & 255, ((addr >> 8) & 255),
          ((addr >> 16) & 255), (addr >> 24));
  return buf;
}


x86 assembly (clang, -O0):
<ipaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xff,%edx
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
mov    -0x4(%rbp),%r8d
shr    $0x10,%r8d
and    $0xff,%r8d
mov    -0x4(%rbp),%r9d
shr    $0x18,%r9d
lea    0x2ef2(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2edf(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipaddr>:
push   %rbx
mov    %edi,%eax
movzbl %al,%edx
movzbl %ah,%ecx
mov    %edi,%esi
shr    $0x10,%esi
movzbl %sil,%r8d
shr    $0x18,%eax
lea    0x2f14(%rip),%rbx
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%r9d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ipaddr.buf = internal global [32 x i8] zeroinitializer
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @ipaddr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = load i32, i32* %2
%6 = lshr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32, i32* %2
%9 = lshr i32 %8, 16
%10 = and i32 %9, 255
%11 = load i32, i32* %2
%12 = lshr i32 %11, 24
%13 = call i32 @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @ipaddr.buf, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %10, i32 %12)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @ipaddr.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@ipaddr.buf = internal global [32 x i8] zeroinitializer
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @ipaddr(i32 %0) {
%2 = and i32 %0, 255
%3 = lshr i32 %0, 8
%4 = and i32 %3, 255
%5 = lshr i32 %0, 16
%6 = and i32 %5, 255
%7 = lshr i32 %0, 24
%8 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @ipaddr.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %6, i32 %7)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @ipaddr.buf, i64 0, i64 0)
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void a52e_set_acmod(uint8_t *p_a52, uint8_t i_acmod) {
  p_a52[4] &= ~0xe;
  p_a52[4] |= (i_acmod & 0x7) << 1;
}


x86 assembly (clang, -O0):
<a52e_set_acmod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%ecx
and    $0xfffffff1,%ecx
mov    %ecx,0x10(%rax)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%rax
or     0x10(%rax),%ecx
mov    %ecx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52e_set_acmod>:
mov    0x10(%rdi),%eax
and    $0xfffffff1,%eax
and    $0x7,%esi
lea    (%rax,%rsi,2),%eax
mov    %eax,0x10(%rdi)
ret

LLVM IR (-O0):
define void @a52e_set_acmod(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 4
%7 = load i32, i32* %6
%8 = and i32 %7, -15
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 7
%11 = shl i32 %10, 1
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 4
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @a52e_set_acmod(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = load i32, i32* %3
%5 = and i32 %4, -15
%6 = shl i32 %1, 1
%7 = and i32 %6, 14
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ diamond(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int r;
  printf("r: ");
  scanf("%d", &r);
  diamond(r);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <diamond@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"r: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @diamond(i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int is_scheme_bootable(const char *part_type) {
  if (strcmp(part_type, "VTOC8") == 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_scheme_bootable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <is_scheme_bootable+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <is_scheme_bootable+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_scheme_bootable>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"VTOC8\00"
define i32 @is_scheme_bootable(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
scalar_t__ getUInt32FromConsole(char const *);
int8_t getInt8FromConsole(const char *consoleStr) {
  int8_t ret = 0;
  if (consoleStr != NULL) {
    ret = (int8_t)getUInt32FromConsole(consoleStr);
  }
  return ret;
}


x86 assembly (clang, -O0):
<getInt8FromConsole>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <getInt8FromConsole+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <getUInt32FromConsole@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInt8FromConsole>:
test   %rdi,%rdi
je     111a <getInt8FromConsole+0xa>
jmp    1030 <getUInt32FromConsole@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @getInt8FromConsole(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @getUInt32FromConsole(i8* %7)
store i64 %8, i64* %3
br label %9
9: ; preds = %6, %1
%10 = load i64, i64* %3
ret i64 %10
}

LLVM IR (-O2):
define i64 @getInt8FromConsole(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @getUInt32FromConsole(i8* %0)
br label %5
5: ; preds = %3, %1
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
void zipf_print_stats(struct zipf_arr *za) {}


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

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

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

LLVM IR (-O2):
%struct.zipf_arr = type opaque
define void @zipf_print_stats(%struct.zipf_arr* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _hexdump_usage(void) {
  fputs("Usage: "
        "hexdump"
        " file\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_hexdump_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hexdump_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: hexdump file\0A\00"
@stderr = global i32 0
define i32 @_hexdump_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: hexdump file\0A\00"
@stderr = global i32 0
define i32 @_hexdump_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
float __attribute__((const)) lw6sys_fmin(float a, float b) {
  return (a < b) ? a : b;
}


x86 assembly (clang, -O0):
<lw6sys_fmin>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <lw6sys_fmin+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <lw6sys_fmin+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw6sys_fmin>:
minss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @lw6sys_fmin(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dump_tls_data(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
void dump_tls_data_name(pid_t pid, const char *filename) {
  FILE *f;
  f = fopen(filename, "w");
  dump_tls_data(pid, f);
  fclose(f);
}


x86 assembly (clang, -O0):
<dump_tls_data_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <dump_tls_data@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_tls_data_name>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rax
mov    %edi,%ebp
lea    0xec1(%rip),%rsi
mov    %rax,%rdi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
call   1040 <dump_tls_data@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @dump_tls_data_name(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 i8*, i8** %4
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32, i32* %3
%9 = load i32*, i32** %5
%10 = call i32 @dump_tls_data(i32 %8, i32* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fclose(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @dump_tls_data_name(i32 %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @dump_tls_data(i32 %0, i32* %3)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void print_nibble(unsigned char c) {
  char b;
  if (c >= 0 && c <= 9)
    b = '0' + c;
  else
    b = 'a' + (c - 0xA);
  write(1, &b, 1);
}


x86 assembly (clang, -O0):
<print_nibble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jl     1147 <print_nibble+0x37>
movzbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jg     1147 <print_nibble+0x37>
movzbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x2(%rbp)
jmp    1154 <print_nibble+0x44>
movzbl -0x1(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x2(%rbp)
mov    $0x1,%edx
lea    -0x2(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_nibble>:
push   %rax
cmp    $0xa,%dil
mov    $0x30,%eax
mov    $0x57,%ecx
cmovb  %eax,%ecx
add    %dil,%cl
mov    %cl,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @print_nibble(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = add nsw i32 48, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
br label %22
16: ; preds = %7, %1
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = sub nsw i32 %18, 10
%20 = add nsw i32 97, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
br label %22
22: ; preds = %16, %11
%23 = call i32 @write(i32 1, i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @print_nibble(i8 zeroext %0) {
%2 = alloca i8
%3 = icmp ult i8 %0, 10
%4 = select i1 %3, i8 48, i8 87
%5 = add i8 %4, %0
store i8 %5, i8* %2
%6 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}
void finalize_error(struct error *err) {}


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

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

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

LLVM IR (-O2):
%struct.error = type opaque
define void @finalize_error(%struct.error* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DMA12_DMA28_DriverIRQHandler();
__attribute__((weak)) void DMA12_DMA28_IRQHandler(void) {
  DMA12_DMA28_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA12_DMA28_IRQHandler() {
%1 = call i32 (...) @DMA12_DMA28_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA12_DMA28_IRQHandler() {
%1 = tail call i32 (...) @DMA12_DMA28_DriverIRQHandler()
ret void
}