xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ XMappingEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XMappingEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XMappingEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XMappingEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XMappingEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XMappingEvent>:
test   %rdi,%rdi
je     112a <free_XMappingEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XMappingEvent(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 %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XMappingEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dll_funlockfile(int /*<<< orphan*/ *);
void __wrap_funlockfile(FILE *file) { dll_funlockfile(file); }


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

x86 assembly (clang, -O2):
<__wrap_funlockfile>:
jmp    1030 <dll_funlockfile@plt>

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

LLVM IR (-O2):
define void @__wrap_funlockfile(i32* %0) {
%2 = tail call i32 @dll_funlockfile(i32* %0)
ret void
}
void delete_state(struct state *st) {}


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

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

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

LLVM IR (-O2):
%struct.state = type opaque
define void @delete_state(%struct.state* nocapture %0) {
ret void
}
void XtDisplayToApplicationContext() {}


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

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

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

LLVM IR (-O2):
define void @XtDisplayToApplicationContext() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitanoperand(int, char *, int);
int /*<<< orphan*/ printf(char *);
void emittwooperandsw(void) {
  printf(" ");
  emitanoperand(2, "ds:word ptr", 1);
  printf(",");
  emitanoperand(1, "ds:word ptr", 1);
}


x86 assembly (clang, -O0):
<emittwooperandsw>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
lea    0xec6(%rip),%rsi
mov    $0x1,%edx
call   1040 <emitanoperand@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edx
lea    0xea4(%rip),%rsi
mov    %edx,%edi
call   1040 <emitanoperand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emittwooperandsw>:
push   %rbx
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rbx
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <emitanoperand@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
pop    %rbx
jmp    1040 <emitanoperand@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [12 x i8] c"ds:word ptr\00"
@.str.2 = [2 x i8] c",\00"
define void @emittwooperandsw() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitanoperand(i32 2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @emitanoperand(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"ds:word ptr\00"
define void @emittwooperandsw() {
%1 = tail call i32 @putchar(i32 32)
%2 = tail call i32 @emitanoperand(i32 2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @putchar(i32 44)
%4 = tail call i32 @emitanoperand(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ McSrv_DisableIrq();
int /*<<< orphan*/ McSrv_EnableIrq();
int /*<<< orphan*/ machdep_WriteI2C(unsigned char, unsigned char *,
                                    unsigned long);
void McSrv_WriteI2C(unsigned char bSlaveAddr, unsigned char *pbData,
                    unsigned long dSize) {
  McSrv_DisableIrq();
  machdep_WriteI2C(bSlaveAddr, pbData, dSize);
  McSrv_EnableIrq();
}


x86 assembly (clang, -O0):
<McSrv_WriteI2C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <McSrv_DisableIrq@plt>
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movzbl %al,%edi
call   1050 <machdep_WriteI2C@plt>
mov    $0x0,%al
call   1040 <McSrv_EnableIrq@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<McSrv_WriteI2C>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <McSrv_DisableIrq@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <machdep_WriteI2C@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <McSrv_EnableIrq@plt>

LLVM IR (-O0):
define void @McSrv_WriteI2C(i8 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i64
store i8 %0, i8* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = call i32 (...) @McSrv_DisableIrq()
%8 = load i8, i8* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @machdep_WriteI2C(i8 zeroext %8, i8* %9, i64 %10)
%12 = call i32 (...) @McSrv_EnableIrq()
ret void
}

LLVM IR (-O2):
define void @McSrv_WriteI2C(i8 zeroext %0, i8* %1, i64 %2) {
%4 = tail call i32 (...) @McSrv_DisableIrq()
%5 = tail call i32 @machdep_WriteI2C(i8 zeroext %0, i8* %1, i64 %2)
%6 = tail call i32 (...) @McSrv_EnableIrq()
ret void
}
void create_stop() {}


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

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

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

LLVM IR (-O2):
define void @create_stop() {
ret void
}
/* Variables and functions */
unsigned int submask_unzip(unsigned int);
unsigned int submask_lastip(unsigned int ip, unsigned int mask) {
  unsigned int network = ip & mask;
  unsigned int lastipadd = ((network) | (~mask)) - 1;
  return submask_unzip(lastipadd);
}


x86 assembly (clang, -O0):
<submask_lastip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <submask_unzip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<submask_lastip>:
not    %esi
or     %esi,%edi
add    $0xffffffff,%edi
jmp    1030 <submask_unzip@plt>

LLVM IR (-O0):
define i32 @submask_lastip(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = and i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = xor i32 %11, -1
%13 = or i32 %10, %12
%14 = sub i32 %13, 1
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = call i32 @submask_unzip(i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @submask_lastip(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = or i32 %3, %0
%5 = add i32 %4, -1
%6 = tail call i32 @submask_unzip(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_welcome_text(void) {
  puts("\x1b[35mWelcome to Jorg !\x1b[0m");
  puts("\n\x1b[31mJorg is a text based RPG\x1b[0m");
  puts("\n\x1b[31mPlay your character and explore epic dungeons\x1b[0m");
  puts("\n\x1b[31mBut take care to not awake the dark forces ...\x1b[0m");
}


x86 assembly (clang, -O0):
<print_welcome_text>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf37(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_welcome_text>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"\1B[35mWelcome to Jorg !\1B[0m\00"
@.str.1 = [35 x i8] c"\0A\1B[31mJorg is a text based RPG\1B[0m\00"
@.str.2 = [56 x i8] c"\0A\1B[31mPlay your character and explore epic dungeons\1B[0m\00"
@.str.3 = [57 x i8] c"\0A\1B[31mBut take care to not awake the dark forces ...\1B[0m\00"
define void @print_welcome_text() {
%1 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"\1B[35mWelcome to Jorg !\1B[0m\00"
@.str.1 = [35 x i8] c"\0A\1B[31mJorg is a text based RPG\1B[0m\00"
@.str.2 = [56 x i8] c"\0A\1B[31mPlay your character and explore epic dungeons\1B[0m\00"
@.str.3 = [57 x i8] c"\0A\1B[31mBut take care to not awake the dark forces ...\1B[0m\00"
define void @print_welcome_text() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ errx(int, char *, char const *);
long strtol(char const *, char **, int);
long toInteger(const char *operand) {
  char *end;
  errno = 0;
  long result = strtol(operand, &end, 10);
  if (errno || *end)
    errx(2, "invalid integer expression '%s'", operand);
  return result;
}


x86 assembly (clang, -O0):
<toInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e89(%rip),%rax
cmpq   $0x0,(%rax)
jne    1171 <toInteger+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1186 <toInteger+0x66>
mov    -0x8(%rbp),%rdx
mov    $0x2,%edi
lea    0xe7f(%rip),%rsi
call   1030 <errx@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toInteger>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2ead(%rip),%r15
movq   $0x0,(%r15)
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,%r14
cmpq   $0x0,(%r15)
jne    115c <toInteger+0x3c>
mov    0x8(%rsp),%rax
cmpb   $0x0,(%rax)
je     1170 <toInteger+0x50>
lea    0xe9d(%rip),%rsi
mov    $0x2,%edi
mov    %rbx,%rdx
call   1030 <errx@plt>
mov    %r14,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [32 x i8] c"invalid integer expression '%s'\00"
define i64 @toInteger(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* @errno
%5 = load i8*, i8** %2
%6 = call i64 @strtol(i8* %5, i8** %3, i32 10)
store i64 %6, i64* %4
%7 = load i64, i64* @errno
%8 = icmp ne i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9, %1
%15 = load i8*, i8** %2
%16 = call i32 @errx(i32 2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %9
%18 = load i64, i64* %4
ret i64 %18
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [32 x i8] c"invalid integer expression '%s'\00"
define i64 @toInteger(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i64 0, i64* @errno
%4 = call i64 @strtol(i8* %0, i8** %2, i32 10)
%5 = load i64, i64* @errno
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %7, %1
%12 = tail call i32 @errx(i32 2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %13
13: ; preds = %11, %7
ret i64 %4
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int cmp(char *word, char *key, char *key2) {
  if (strcmp(word, key) == 0 || strcmp(word, key2) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1152 <cmp+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115e <cmp+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <cmp+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcmp@plt>
test   %rax,%rax
je     113c <cmp+0x2c>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
jmp    1141 <cmp+0x31>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* %0, i8* %1, i8* %2) {
%4 = tail call i64 @strcmp(i8* %0, i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @strcmp(i8* %0, i8* %2)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_intVector(int *v, long nLow) { free((char *)(v + nLow - 1)); }


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

x86 assembly (clang, -O2):
<free_intVector>:
lea    (%rdi,%rsi,4),%rdi
add    $0xfffffffffffffffc,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_intVector(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i32, i32* %5, i64 %6
%8 = getelementptr inbounds i32, i32* %7, i64 -1
%9 = bitcast i32* %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @free_intVector(i32* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 %1
%4 = getelementptr inbounds i32, i32* %3, i64 -1
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
int *getZero();
void testInitZero() {
  int *a = getZero();
  *a = 1;
}


x86 assembly (clang, -O0):
<testInitZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getZero@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testInitZero>:
push   %rax
xor    %eax,%eax
call   1030 <getZero@plt>
movl   $0x1,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @testInitZero() {
%1 = tail call i32* (...) @getZero()
store i32 1, i32* %1
ret void
}
OP(fd, ec) {
  illegal_1();
  op_ec();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_ec@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_ec@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_ec()
ret i32 undef
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
int spi_disable_blockprotect_generic(struct flashctx *, int, int,
                                     int /*<<< orphan*/);
int spi_disable_blockprotect_at25fs010(struct flashctx *flash) {
  return spi_disable_blockprotect_generic(flash, 0x6C, 1 << 7, 0);
}


x86 assembly (clang, -O0):
<spi_disable_blockprotect_at25fs010>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x6c,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
call   1030 <spi_disable_blockprotect_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_disable_blockprotect_at25fs010>:
mov    $0x6c,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
jmp    1030 <spi_disable_blockprotect_generic@plt>

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @spi_disable_blockprotect_at25fs010(%struct.flashctx* %0) {
%2 = alloca %struct.flashctx*
store %struct.flashctx* %0, %struct.flashctx** %2
%3 = load %struct.flashctx*, %struct.flashctx** %2
%4 = call i32 @spi_disable_blockprotect_generic(%struct.flashctx* %3, i32 108, i32 128, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @spi_disable_blockprotect_at25fs010(%struct.flashctx* %0) {
%2 = tail call i32 @spi_disable_blockprotect_generic(%struct.flashctx* %0, i32 108, i32 128, i32 0)
ret i32 %2
}
int foo(int a) { return a + 23; }


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

x86 assembly (clang, -O2):
<foo>:
lea    0x17(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 23
ret i32 %2
}
int fun1367() { return 1367; }


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

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

LLVM IR (-O0):
define i32 @fun1367() {
ret i32 1367
}

LLVM IR (-O2):
define i32 @fun1367() {
ret i32 1367
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char s = 31;
  char i = (((s) / 0x0A) << 4 | ((s) % 0x0A));
  printf("s: %d, to hex: %02x\n", s, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x1f,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
movsbl -0x5(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
or     %edx,%eax
mov    %al,-0x6(%rbp)
mov    -0x5(%rbp),%al
lea    0xead(%rip),%rdi
movsbl %al,%esi
movsbl -0x6(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1f,%esi
mov    $0x31,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"s: %d, to hex: %02x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 31, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sdiv i32 %5, 10
%7 = shl i32 %6, 4
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = srem i32 %9, 10
%11 = or i32 %7, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = load i8, i8* %2
%14 = load i8, i8* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext %13, i8 signext %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"s: %d, to hex: %02x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext 31, i8 signext 49)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_rtclock_now() {
  printf("NOT IMPLEMENTED:"
         "pa_rtclock_now"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_rtclock_now\0A\00"
define i32 @pa_rtclock_now() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_rtclock_now\00"
define i32 @pa_rtclock_now() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void DrawMaskedBorder_DOOR_3() {}


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

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

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

LLVM IR (-O2):
define void @DrawMaskedBorder_DOOR_3() {
ret void
}
void UARTDMACounterResetControl(unsigned int baseAdd,
                                unsigned int controlFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x44)))) &= ~((0x00000004u));
  (*((volatile unsigned int *)(baseAdd + (0x44)))) |=
      (controlFlag & (0x00000004u));
}


x86 assembly (clang, -O0):
<UARTDMACounterResetControl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x44,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffb,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x4,%edx
mov    -0x4(%rbp),%eax
add    $0x44,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDMACounterResetControl>:
add    $0x44,%edi
andl   $0xfffffffb,(%rdi)
and    $0x4,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTDMACounterResetControl(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 = add i32 %5, 68
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -5
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 4
%13 = load i32, i32* %3
%14 = add i32 %13, 68
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @UARTDMACounterResetControl(i32 %0, i32 %1) {
%3 = add i32 %0, 68
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -5
store volatile i32 %7, i32* %5
%8 = and i32 %1, 4
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void fiat_p256_nonzero(uint64_t *out1, const uint64_t arg1[4]) {
  uint64_t x1;
  x1 = ((arg1[0]) | ((arg1[1]) | ((arg1[2]) | (arg1[3]))));
  *out1 = x1;
}


x86 assembly (clang, -O0):
<fiat_p256_nonzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
mov    0x8(%rdx),%edx
mov    -0x10(%rbp),%rsi
or     0xc(%rsi),%edx
or     %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p256_nonzero>:
mov    0x4(%rsi),%eax
or     (%rsi),%eax
or     0x8(%rsi),%eax
or     0xc(%rsi),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @fiat_p256_nonzero(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 3
%17 = load i32, i32* %16
%18 = or i32 %14, %17
%19 = or i32 %11, %18
%20 = or i32 %8, %19
store i32 %20, i32* %5
%21 = load i32, i32* %5
%22 = load i32*, i32** %3
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @fiat_p256_nonzero(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %1, i64 2
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 3
%9 = load i32, i32* %8
%10 = or i32 %5, %3
%11 = or i32 %10, %7
%12 = or i32 %11, %9
store i32 %12, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", getchar() != EOF); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void _infix_operator_minus_double_double(double lhs, double rhs,
                                         double *__rval_1) {
  *__rval_1 = lhs - rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_minus_double_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_minus_double_double>:
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @_infix_operator_minus_double_double(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
store double %0, double* %4
store double %1, double* %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = load double*, double** %6
store double %9, double* %10
ret void
}

LLVM IR (-O2):
define void @_infix_operator_minus_double_double(double %0, double %1, double* nocapture writeonly %2) {
%4 = fsub double %0, %1
store double %4, double* %2
ret void
}
/* Variables and functions */
int findSamllestInteger(int *, int, int);
int /*<<< orphan*/ swapIntegerElements(int *, int, int);
void sortIntegerArray(int array[], int n) {
  int lh, rh;
  for (lh = 0; lh < n; lh++) {
    rh = findSamllestInteger(array, lh, n - 1);
    swapIntegerElements(array, lh, rh);
  }
}


x86 assembly (clang, -O0):
<sortIntegerArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1174 <sortIntegerArray+0x54>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1040 <findSamllestInteger@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <swapIntegerElements@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <sortIntegerArray+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortIntegerArray>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1161 <sortIntegerArray+0x41>
mov    %esi,%r14d
mov    %rdi,%rbx
lea    -0x1(%r14),%r15d
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
call   1040 <findSamllestInteger@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <swapIntegerElements@plt>
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1140 <sortIntegerArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @sortIntegerArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %21, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = call i32 @findSamllestInteger(i32* %12, i32 %13, i32 %15)
store i32 %16, i32* %6
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = call i32 @swapIntegerElements(i32* %17, i32 %18, i32 %19)
br label %21
21: ; preds = %11
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @sortIntegerArray(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = add nsw i32 %1, -1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 0, %4 ], [ %10, %6 ]
%8 = tail call i32 @findSamllestInteger(i32* %0, i32 %7, i32 %5)
%9 = tail call i32 @swapIntegerElements(i32* %0, i32 %7, i32 %8)
%10 = add nuw nsw i32 %7, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
void cvt_d_l(long long *source, double *dest) { *dest = *source; }


x86 assembly (clang, -O0):
<cvt_d_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_d_l>:
cvtsi2sdq (%rdi),%xmm0
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @cvt_d_l(i64* %0, double* %1) {
%3 = alloca i64*
%4 = alloca double*
store i64* %0, i64** %3
store double* %1, double** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = load double*, double** %4
store double %7, double* %8
ret void
}

LLVM IR (-O2):
define void @cvt_d_l(i64* nocapture %0, double* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = sitofp i64 %3 to double
store double %4, double* %1
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *crypt(char *key, char *salt) {
  char *ret;
  ret = malloc(14);
  strcpy(ret, "ABCDEFGHIJKLM");
  return ret;
}


x86 assembly (clang, -O0):
<crypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xe,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt>:
push   %rbx
mov    $0xe,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"ABCDEFGHIJKLM\00"
define i8* @crypt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i8* @malloc(i32 14)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
@.str = [14 x i8] c"ABCDEFGHIJKLM\00"
define i8* @crypt(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(14) i8* @malloc(i32 14)
%4 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
void psync_fs_clean_tasks() {}


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

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

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

LLVM IR (-O2):
define void @psync_fs_clean_tasks() {
ret void
}
/* Variables and functions */
int arc4random_uniform(int);
int ixn_random(int from, int to) {
  return arc4random_uniform(to - from) + from;
}


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

x86 assembly (clang, -O2):
<ixn_random>:
push   %rbx
mov    %edi,%ebx
sub    %edi,%esi
mov    %esi,%edi
call   1030 <arc4random_uniform@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ixn_random(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 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = call i32 @arc4random_uniform(i32 %7)
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @ixn_random(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = tail call i32 @arc4random_uniform(i32 %3)
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ db_close();
int /*<<< orphan*/ db_commit();
int /*<<< orphan*/ db_count_done();
int db_documents();
int /*<<< orphan*/ db_term_done();
int /*<<< orphan*/ db_vacuum();
void done(void) {
  db_count_done();
  db_term_done();
  db_commit();
  if (db_documents() % 100 == 0)
    db_vacuum();
  db_close();
}


x86 assembly (clang, -O0):
<done>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <db_count_done@plt>
mov    $0x0,%al
call   1080 <db_term_done@plt>
mov    $0x0,%al
call   1060 <db_commit@plt>
mov    $0x0,%al
call   1070 <db_documents@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1198 <done+0x38>
mov    $0x0,%al
call   1030 <db_vacuum@plt>
mov    $0x0,%al
call   1040 <db_close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<done>:
push   %rax
xor    %eax,%eax
call   1050 <db_count_done@plt>
xor    %eax,%eax
call   1080 <db_term_done@plt>
xor    %eax,%eax
call   1060 <db_commit@plt>
xor    %eax,%eax
call   1070 <db_documents@plt>
imul   $0xc28f5c29,%eax,%eax
add    $0x51eb850,%eax
ror    $0x2,%eax
cmp    $0x28f5c28,%eax
ja     1199 <done+0x39>
xor    %eax,%eax
call   1030 <db_vacuum@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <db_close@plt>

LLVM IR (-O0):
define void @done() {
%1 = call i32 (...) @db_count_done()
%2 = call i32 (...) @db_term_done()
%3 = call i32 (...) @db_commit()
%4 = call i32 (...) @db_documents()
%5 = srem i32 %4, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @db_vacuum()
br label %9
9: ; preds = %7, %0
%10 = call i32 (...) @db_close()
ret void
}

LLVM IR (-O2):
define void @done() {
%1 = tail call i32 (...) @db_count_done()
%2 = tail call i32 (...) @db_term_done()
%3 = tail call i32 (...) @db_commit()
%4 = tail call i32 (...) @db_documents()
%5 = srem i32 %4, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 (...) @db_vacuum()
br label %9
9: ; preds = %7, %0
%10 = tail call i32 (...) @db_close()
ret void
}
/* Variables and functions */
char *stralloc(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
char *strduplicate(char *from) {
  char *new = stralloc(strlen(from));
  strcpy(new, from);
  return new;
}


x86 assembly (clang, -O0):
<strduplicate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
call   1040 <stralloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strduplicate>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
mov    %eax,%edi
call   1040 <stralloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strduplicate(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @stralloc(i32 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @strduplicate(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @stralloc(i32 %2)
%4 = tail call i32 @strcpy(i8* %3, i8* %0)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ XSetWindowAttributes;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XSetWindowAttributes(void *_p) {
  if (_p == NULL)
    abort();
  free((XSetWindowAttributes *)_p);
}


x86 assembly (clang, -O0):
<free_XSetWindowAttributes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XSetWindowAttributes+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XSetWindowAttributes>:
test   %rdi,%rdi
je     112a <free_XSetWindowAttributes+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XSetWindowAttributes(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 %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XSetWindowAttributes(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
char *Misc_Str_StrReplaceChar(char *pStrSrc, char cOld, char cNew) {
  char *pChar;
  pChar = pStrSrc;
  while (*pChar) {
    if (*pChar == cOld) {
      *pChar = cNew;
    }
    pChar++;
  }
  return pStrSrc;
}


x86 assembly (clang, -O0):
<Misc_Str_StrReplaceChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <Misc_Str_StrReplaceChar+0x55>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1144 <Misc_Str_StrReplaceChar+0x44>
mov    -0xa(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <Misc_Str_StrReplaceChar+0x1b>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Misc_Str_StrReplaceChar>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <Misc_Str_StrReplaceChar+0x25>
lea    0x1(%rax),%rdi
jmp    111b <Misc_Str_StrReplaceChar+0x1b>
nop
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     1125 <Misc_Str_StrReplaceChar+0x25>
cmp    %sil,%cl
jne    1110 <Misc_Str_StrReplaceChar+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <Misc_Str_StrReplaceChar+0x10>
ret

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

LLVM IR (-O2):
define i8* @Misc_Str_StrReplaceChar(i8* returned %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %10, %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int tests_end(void) {
  printf("[SUMMARY]\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"[SUMMARY]\0A\00"
define i32 @tests_end() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"[SUMMARY]\00"
define i32 @tests_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int wait(int ms) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wait(i32 %0) {
ret i32 0
}
int ts(a)
int a;
{
  if (a < 1000 && a > 2000)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<ts>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    112d <ts+0x2d>
cmpl   $0x7d0,-0x8(%rbp)
jle    112d <ts+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <ts+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ts(i32 %0) {
ret i32 0
}