xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void greet() {
  printf("+-------*--------*--------*--------*-------+\n");
  printf("Hello, I'm AlphaGo\n");
  printf("You must be very handsome(beautiful)!\n");
  printf("Thank you for using the menu program!\n");
  printf("+-------*--------*--------*--------*-------+\n");
}


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

x86 assembly (clang, -O2):
<greet>:
push   %rbx
lea    0xf47(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"+-------*--------*--------*--------*-------+\0A\00"
@.str.1 = [20 x i8] c"Hello, I'm AlphaGo\0A\00"
@.str.2 = [39 x i8] c"You must be very handsome(beautiful)!\0A\00"
@.str.3 = [39 x i8] c"Thank you for using the menu program!\0A\00"
define void @greet() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str.4 = [19 x i8] c"Hello, I'm AlphaGo\00"
@str.5 = [38 x i8] c"You must be very handsome(beautiful)!\00"
@str.6 = [38 x i8] c"Thank you for using the menu program!\00"
@str.7 = [45 x i8] c"+-------*--------*--------*--------*-------+\00"
define void @greet() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.7, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.7, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F1(int **);
void test3() {
  int *X;
  F1(&X);
  *X = 1;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <F1@plt>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
push   %rax
mov    %rsp,%rdi
call   1030 <F1@plt>
mov    (%rsp),%rax
movl   $0x1,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @test3() {
%1 = alloca i32*
%2 = call i32 @F1(i32** %1)
%3 = load i32*, i32** %1
store i32 1, i32* %3
ret void
}

LLVM IR (-O2):
define void @test3() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = call i32 @F1(i32** %1)
%4 = load i32*, i32** %1
store i32 1, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void echo(char *str) { printf("%s\n", str); }


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

x86 assembly (clang, -O2):
<echo>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @echo(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int api1(int, int);
int brk(void *new_brk) { return api1(45, (int)new_brk); }


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

x86 assembly (clang, -O2):
<brk>:
mov    %rdi,%rsi
mov    $0x2d,%edi
jmp    1030 <api1@plt>

LLVM IR (-O0):
define i32 @brk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 @api1(i32 45, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @brk(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @api1(i32 45, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *freopen(const char *path, const char *mode, FILE *stream) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "freopen");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<freopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
lea    0xee1(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freopen>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [8 x i8] c"freopen\00"
define i32* @freopen(i8* %0, i8* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @assert(i32 0)
%11 = load i32*, i32** %4
ret i32* %11
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [8 x i8] c"freopen\00"
define noalias i32* @freopen(i8* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @assert(i32 0)
ret i32* undef
}
void sdmmc_write32(unsigned short reg, unsigned int val) {
  *(volatile unsigned int *)(0x10006000u + reg) = val;
}


x86 assembly (clang, -O0):
<sdmmc_write32>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
movzwl -0x2(%rbp),%eax
add    $0x10006000,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdmmc_write32>:
mov    %edi,%eax
mov    %esi,0x10006000(%rax)
ret

LLVM IR (-O0):
define void @sdmmc_write32(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = add i32 268460032, %7
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %5, i32* %10
ret void
}

LLVM IR (-O2):
define void @sdmmc_write32(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i64
%4 = add nuw nsw i64 %3, 268460032
%5 = inttoptr i64 %4 to i32*
store volatile i32 %1, i32* %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_write_block(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *, int);
void eeprom_write_dword(uint32_t *addr, uint32_t value) {
  eeprom_write_block(&value, addr, 4);
}


x86 assembly (clang, -O0):
<eeprom_write_dword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <eeprom_write_block@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_write_dword>:
push   %rax
mov    %rdi,%rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    %rax,%rsi
mov    $0x4,%edx
call   1030 <eeprom_write_block@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @eeprom_write_dword(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 = call i32 @eeprom_write_block(i32* %4, i32* %5, i32 4)
ret void
}

LLVM IR (-O2):
define void @eeprom_write_dword(i32* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @eeprom_write_block(i32* %3, i32* %0, i32 4)
ret void
}
long int factorial(int n) {
  if (n <= 1)
    return (1);
  else
    n = n * factorial(n - 1);
  return (n);
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     1132 <factorial+0x22>
movq   $0x1,-0x8(%rbp)
jmp    115b <factorial+0x4b>
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%eax
cmp    $0x1,%edi
jle    112b <factorial+0x1b>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <factorial@plt>
imul   %ebx,%eax
cltq
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @factorial(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i64 [ %10, %5 ], [ 1, %1 ]
ret i64 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i64 @factorial(i32 %6)
%8 = trunc i64 %7 to i32
%9 = mul i32 %8, %0
%10 = sext i32 %9 to i64
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("\n");
  printf("Usage : mlanevent.exe [-v] [-h]\n");
  printf("    -v               : Print version information\n");
  printf("    -h               : Print help information\n");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xee2(%rip),%rdi
call   1040 <puts@plt>
lea    0xf07(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [33 x i8] c"Usage : mlanevent.exe [-v] [-h]\0A\00"
@.str.2 = [50 x i8] c" -v : Print version information\0A\00"
@.str.3 = [47 x i8] c" -h : Print help information\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"Usage : mlanevent.exe [-v] [-h]\00"
@str.4 = [49 x i8] c" -v : Print version information\00"
@str.5 = [46 x i8] c" -h : Print help information\00"
define void @print_usage() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ imp();
int /*<<< orphan*/ textcolor(int);
ln3() {
  textcolor(15);
  imp();
}


x86 assembly (clang, -O0):
<ln3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xf,%edi
call   1040 <textcolor@plt>
mov    $0x0,%al
call   1030 <imp@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln3>:
push   %rax
mov    $0xf,%edi
call   1040 <textcolor@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <imp@plt>

LLVM IR (-O0):
define i32 @ln3() {
%1 = alloca i32
%2 = call i32 @textcolor(i32 15)
%3 = call i32 (...) @imp()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @ln3() {
%1 = tail call i32 @textcolor(i32 15)
%2 = tail call i32 (...) @imp()
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CMasterIntDisable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000010))) = 0;
}


x86 assembly (clang, -O0):
<I2CMasterIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntDisable>:
movq   $0x0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @I2CMasterIntDisable(i64 %0) {
%2 = add nsw i64 %0, 16
%3 = inttoptr i64 %2 to i64*
store volatile i64 0, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_pair(char **key, char **value) {
  if (*key != NULL)
    free(*key);
  if (*value != NULL)
    free(*value);
  *key = *value = NULL;
}


x86 assembly (clang, -O0):
<free_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     113a <free_pair+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1154 <free_pair+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_pair>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1127 <free_pair+0x17>
call   1030 <free@plt>
mov    (%r14),%rdi
test   %rdi,%rdi
je     1134 <free_pair+0x24>
call   1030 <free@plt>
movq   $0x0,(%r14)
movq   $0x0,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @free_pair(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** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %8, %2
%13 = load i8**, i8*** %4
%14 = load i8*, i8** %13
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i8**, i8*** %4
%18 = load i8*, i8** %17
%19 = call i32 @free(i8* %18)
br label %20
20: ; preds = %16, %12
%21 = load i8**, i8*** %4
store i8* null, i8** %21
%22 = load i8**, i8*** %3
store i8* null, i8** %22
ret void
}

LLVM IR (-O2):
define void @free_pair(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(i8* %3)
br label %7
7: ; preds = %5, %2
%8 = load i8*, i8** %1
%9 = icmp eq i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @free(i8* %8)
br label %12
12: ; preds = %10, %7
store i8* null, i8** %1
store i8* null, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void System_out_int(int x) { printf("%d\n", x); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @System_out_int(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
double RAND_MAX;
int log(double);
scalar_t__ rand_r(unsigned int *);
int random_level(unsigned int *seedp) {
  const double P = 0.5;
  int lvl = (int)(log(((double)rand_r(seedp) / RAND_MAX)) / log(1.0 - P));
  return lvl < (16 - 1) ? lvl : (16 - 1);
}


x86 assembly (clang, -O0):
<random_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rand_r@plt>
cvtsi2sd %rax,%xmm0
mov    0x2e9a(%rip),%rax
divsd  (%rax),%xmm0
call   1040 <log@plt>
mov    %eax,-0x18(%rbp)
movsd  0xe9e(%rip),%xmm0
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
cmpl   $0xf,-0x14(%rbp)
jge    1187 <random_level+0x67>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1194 <random_level+0x74>
mov    $0xf,%eax
mov    %eax,-0x1c(%rbp)
jmp    1194 <random_level+0x74>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_level>:
push   %rbx
call   1030 <rand_r@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb6(%rip),%rax
divsd  (%rax),%xmm0
call   1040 <log@plt>
mov    %eax,%ebx
movsd  0xebb(%rip),%xmm0
call   1040 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
cmp    $0xf,%eax
mov    $0xf,%ecx
cmovge %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @random_level(i32* %0) {
%2 = alloca i32*
%3 = alloca double
%4 = alloca i32
store i32* %0, i32** %2
store double 5.000000e-01, double* %3
%5 = load i32*, i32** %2
%6 = call i64 @rand_r(i32* %5)
%7 = sitofp i64 %6 to double
%8 = load double, double* @RAND_MAX
%9 = fdiv double %7, %8
%10 = call i32 @log(double %9)
%11 = call i32 @log(double 5.000000e-01)
%12 = sdiv i32 %10, %11
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 15
br i1 %14, label %15, label %17
15: ; preds = %1
%16 = load i32, i32* %4
br label %18
17: ; preds = %1
br label %18
18: ; preds = %17, %15
%19 = phi i32 [ %16, %15 ], [ 15, %17 ]
ret i32 %19
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @random_level(i32* %0) {
%2 = tail call i64 @rand_r(i32* %0)
%3 = sitofp i64 %2 to double
%4 = load double, double* @RAND_MAX
%5 = fdiv double %3, %4
%6 = tail call i32 @log(double %5)
%7 = tail call i32 @log(double 5.000000e-01)
%8 = sdiv i32 %6, %7
%9 = icmp slt i32 %8, 15
%10 = select i1 %9, i32 %8, i32 15
ret i32 %10
}
void gl2psPrintGzipHeader(void) {}


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

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

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

LLVM IR (-O2):
define void @gl2psPrintGzipHeader() {
ret void
}
/* Type definitions */
struct sched_param {
  scalar_t__ sched_priority;
};
typedef int /*<<< orphan*/ schp;

/* Variables and functions */
int /*<<< orphan*/ SCHED_OTHER;
int /*<<< orphan*/ memset(struct sched_param *, int /*<<< orphan*/, int);
scalar_t__ sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                              struct sched_param *);
int set_default_priority(void) {
  struct sched_param schp;
  memset(&schp, 0, sizeof(schp));
  schp.sched_priority = 0;
  if (sched_setscheduler(0, SCHED_OTHER, &schp) != 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<set_default_priority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
movq   $0x0,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x10(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
cmp    $0x0,%rax
je     116a <set_default_priority+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1171 <set_default_priority+0x51>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_default_priority>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
movq   $0x0,0x8(%rsp)
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1030 <sched_setscheduler@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sched_param = type { i64 }
@SCHED_OTHER = global i32 0
define i32 @set_default_priority() {
%1 = alloca i32
%2 = alloca %struct.sched_param
%3 = call i32 @memset(%struct.sched_param* %2, i32 0, i32 8)
%4 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %2, i32 0, i32 0
store i64 0, i64* %4
%5 = load i32, i32* @SCHED_OTHER
%6 = call i64 @sched_setscheduler(i32 0, i32 %5, %struct.sched_param* %2)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 0, i32* %1
br label %10
9: ; preds = %0
store i32 1, i32* %1
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
%struct.sched_param = type { i64 }
@SCHED_OTHER = global i32 0
define i32 @set_default_priority() {
%1 = alloca %struct.sched_param
%2 = bitcast %struct.sched_param* %1 to i8*
%3 = call i32 @memset(%struct.sched_param* %1, i32 0, i32 8)
%4 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i64 0, i32 0
store i64 0, i64* %4
%5 = load i32, i32* @SCHED_OTHER
%6 = call i64 @sched_setscheduler(i32 0, i32 %5, %struct.sched_param* %1)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ const *);
struct tm *localtime_r(const time_t *timep, struct tm *result) {
  struct tm *s = localtime(timep);
  if (s == NULL)
    return NULL;
  *result = *s;
  return result;
}


x86 assembly (clang, -O0):
<localtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1145 <localtime_r+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1159 <localtime_r+0x49>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<localtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <localtime@plt>
test   %rax,%rax
je     1124 <localtime_r+0x14>
mov    (%rax),%eax
mov    %eax,(%rbx)
jmp    1126 <localtime_r+0x16>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca %struct.tm*
%4 = alloca i32*
%5 = alloca %struct.tm*
%6 = alloca %struct.tm*
store i32* %0, i32** %4
store %struct.tm* %1, %struct.tm** %5
%7 = load i32*, i32** %4
%8 = call %struct.tm* @localtime(i32* %7)
store %struct.tm* %8, %struct.tm** %6
%9 = load %struct.tm*, %struct.tm** %6
%10 = icmp eq %struct.tm* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store %struct.tm* null, %struct.tm** %3
br label %18
12: ; preds = %2
%13 = load %struct.tm*, %struct.tm** %5
%14 = load %struct.tm*, %struct.tm** %6
%15 = bitcast %struct.tm* %13 to i8*
%16 = bitcast %struct.tm* %14 to i8*
%17 = load %struct.tm*, %struct.tm** %5
store %struct.tm* %17, %struct.tm** %3
br label %18
18: ; preds = %12, %11
%19 = load %struct.tm*, %struct.tm** %3
ret %struct.tm* %19
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* %0, %struct.tm* writeonly %1) {
%3 = tail call %struct.tm* @localtime(i32* %0)
%4 = icmp eq %struct.tm* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = getelementptr %struct.tm, %struct.tm* %3, i64 0, i32 0
%7 = getelementptr %struct.tm, %struct.tm* %1, i64 0, i32 0
%8 = load i32, i32* %6
store i32 %8, i32* %7
br label %9
9: ; preds = %2, %5
%10 = phi %struct.tm* [ %1, %5 ], [ null, %2 ]
ret %struct.tm* %10
}
void _infix_operator_plus_i8_i8(signed char lhs, signed char rhs,
                                signed char *__rval_1) {
  *__rval_1 = lhs + rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_plus_i8_i8>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_plus_i8_i8>:
add    %dil,%sil
mov    %sil,(%rdx)
ret

LLVM IR (-O0):
define void @_infix_operator_plus_i8_i8(i8 signext %0, i8 signext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8*
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = add nsw i32 %8, %10
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %6
store i8 %12, i8* %13
ret void
}

LLVM IR (-O2):
define void @_infix_operator_plus_i8_i8(i8 signext %0, i8 signext %1, i8* nocapture writeonly %2) {
%4 = add i8 %1, %0
store i8 %4, i8* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int ret_bool();
int main() {
  int v = 42;
  bool b = v;
  printf("%d\n", b);
  printf("%d\n", ret_bool());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2a,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <ret_bool@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void WatchdogReloadSet(uint32_t ui32Base, uint32_t ui32LoadVal) {
  ASSERT((ui32Base == 0x40000000) || (ui32Base == 0x40001000));
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) = ui32LoadVal;
}


x86 assembly (clang, -O0):
<WatchdogReloadSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x40000000,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     113d <WatchdogReloadSet+0x2d>
cmpl   $0x40001000,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogReloadSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40000000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    %ebx,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @WatchdogReloadSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1073741824
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1073745920
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 0
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 %14, i32* %18
ret void
}

LLVM IR (-O2):
define void @WatchdogReloadSet(i32 %0, i32 %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073741824
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = sext i32 %0 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %1, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, size_t);
void *xfiredb_alloc(size_t);
void *xfiredb_zalloc(size_t len) {
  void *region;
  region = xfiredb_alloc(len);
  memset(region, 0x0, len);
  return region;
}


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

x86 assembly (clang, -O2):
<xfiredb_zalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <xfiredb_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xfiredb_zalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @xfiredb_alloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @xfiredb_zalloc(i64 %0) {
%2 = tail call i8* @xfiredb_alloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
int key(int n) { return -n; }


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

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

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

LLVM IR (-O2):
define i32 @key(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
/* Variables and functions */
int my_sleep(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int seconds = my_sleep(5);
  printf("unslept time: %d\n", seconds);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <my_sleep@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <my_sleep@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"unslept time: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @my_sleep(i32 5)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"unslept time: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @my_sleep(i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef unsigned int uint16_t;

/* Variables and functions */
void _set_bit(uint16_t *x, const int b) { *x |= (1U << b); }


x86 assembly (clang, -O0):
<_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,(%rdi)
ret

LLVM IR (-O0):
define void @_set_bit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = or i32 %8, %6
store i32 %9, i32* %7
ret void
}

LLVM IR (-O2):
define void @_set_bit(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load i32, i32* %0
%5 = or i32 %4, %3
store i32 %5, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ print_process_environment(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  pid_t pid = (pid_t)atoi(argv[1]);
  print_process_environment(pid);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <print_process_environment@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <print_process_environment@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @print_process_environment(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_csi_sgr(int n) { printf("\x1b[%dm", n); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dm\00"
define void @print_csi_sgr(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
long isuma(int, int);
long suma_int(int n) { return isuma(n, n - 1); }


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

x86 assembly (clang, -O2):
<suma_int>:
lea    -0x1(%rdi),%esi
jmp    1030 <isuma@plt>

LLVM IR (-O0):
define i64 @suma_int(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 = call i64 @isuma(i32 %3, i32 %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @suma_int(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i64 @isuma(i32 %0, i32 %2)
ret i64 %3
}
int samples_from_bytes(int block_size) { return (block_size - 4) * 2; }


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

x86 assembly (clang, -O2):
<samples_from_bytes>:
lea    (%rdi,%rdi,1),%eax
add    $0xfffffff8,%eax
ret

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

LLVM IR (-O2):
define i32 @samples_from_bytes(i32 %0) {
%2 = shl i32 %0, 1
%3 = add i32 %2, -8
ret i32 %3
}
int test_imm_2Auint8_mem(unsigned char *val) {
  return ((*val) & (-0x2A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Auint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -42
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *realloc(void *, size_t);
void *realloc_wrapper(void *p, size_t size) { return realloc(p, size); }


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

x86 assembly (clang, -O2):
<realloc_wrapper>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @realloc_wrapper(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 i8* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @realloc_wrapper(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
char __VERIFIER_nondet_char() { return 0; }


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

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

LLVM IR (-O0):
define signext i8 @__VERIFIER_nondet_char() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @__VERIFIER_nondet_char() {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ out(char const *);
char *strerror(int /*<<< orphan*/);
void exit_with(const char *message, int err, int status) {
  out(message);
  if (err != 0) {
    out(": ");
    out(strerror(errno));
  }
  out("\n");
  exit(status);
}


x86 assembly (clang, -O0):
<exit_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <out@plt>
cmpl   $0x0,-0xc(%rbp)
je     1177 <exit_with+0x47>
lea    0xea4(%rip),%rdi
call   1040 <out@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rdi
call   1040 <out@plt>
lea    0xe85(%rip),%rdi
call   1040 <out@plt>
mov    -0x10(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit_with>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1040 <out@plt>
test   %ebp,%ebp
je     1162 <exit_with+0x32>
lea    0xeb9(%rip),%rdi
call   1040 <out@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rdi
call   1040 <out@plt>
lea    0xe9a(%rip),%rdi
call   1040 <out@plt>
mov    %ebx,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c": \00"
@errno = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
define void @exit_with(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 @out(i8* %7)
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = call i32 @out(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @errno
%14 = call i8* @strerror(i32 %13)
%15 = call i32 @out(i8* %14)
br label %16
16: ; preds = %11, %3
%17 = call i32 @out(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* %6
%19 = call i32 @exit(i32 %18)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c": \00"
@errno = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
define void @exit_with(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @out(i8* %0)
%5 = icmp eq i32 %1, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i32 @out(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @errno
%9 = tail call i8* @strerror(i32 %8)
%10 = tail call i32 @out(i8* %9)
br label %11
11: ; preds = %6, %3
%12 = tail call i32 @out(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @exit(i32 %2)
unreachable
}
int g(int n) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 0
}
/* Variables and functions */
bool fspath_is_fifo(const char path[]) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @fspath_is_fifo(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ voidpf;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
void zfree(voidpf opaque, voidpf address) { free(address); }


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

x86 assembly (clang, -O2):
<zfree>:
mov    %esi,%edi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @zfree(i32 %0, i32 %1) {
%3 = tail call i32 @free(i32 %1)
ret void
}
/* Variables and functions */
int FALSE;
bool PDC_get_ctrl_break() { return (FALSE); }


x86 assembly (clang, -O0):
<PDC_get_ctrl_break>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDC_get_ctrl_break>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@FALSE = global i32 0
define i32 @PDC_get_ctrl_break() {
%1 = load i32, i32* @FALSE
ret i32 %1
}

LLVM IR (-O2):
@FALSE = global i32 0
define i32 @PDC_get_ctrl_break() {
%1 = load i32, i32* @FALSE
ret i32 %1
}
const char *MSG_log_version() { return "2015/09/15-1.2-libmsglog-mfilter"; }


x86 assembly (clang, -O0):
<MSG_log_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"2015/09/15-1.2-libmsglog-mfilter\00"
define i8* @MSG_log_version() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [33 x i8] c"2015/09/15-1.2-libmsglog-mfilter\00"
define i8* @MSG_log_version() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}
msgctl(msqid, cmd, buf) int msqid, cmd;
struct msqid_ds *buf;
{
  return (syscall(49, 1, msqid, cmd, buf));
}


x86 assembly (clang, -O0):
<msgctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    $0x31,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgctl>:
mov    %rdx,%r8
mov    %esi,%ecx
mov    %edi,%edx
mov    $0x31,%edi
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.msqid_ds = type opaque
define i32 @msgctl(i32 %0, i32 %1, %struct.msqid_ds* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.msqid_ds*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.msqid_ds* %2, %struct.msqid_ds** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load %struct.msqid_ds*, %struct.msqid_ds** %6
%10 = call i32 (i32, i32, i32, i32, %struct.msqid_ds*, ...) bitcast (i32 (...)* @syscall to i32 (i32, i32, i32, i32, %struct.msqid_ds*, ...)*)(i32 49, i32 1, i32 %7, i32 %8, %struct.msqid_ds* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.msqid_ds = type opaque
define i32 @msgctl(i32 %0, i32 %1, %struct.msqid_ds* %2) {
%4 = tail call i32 (i32, i32, i32, i32, %struct.msqid_ds*, ...) bitcast (i32 (...)* @syscall to i32 (i32, i32, i32, i32, %struct.msqid_ds*, ...)*)(i32 49, i32 1, i32 %0, i32 %1, %struct.msqid_ds* %2)
ret i32 %4
}