xunge/DecIR huggingface dataset:
void sfe_ipv6_destroy_rule(struct sfe_connection_destroy *sid) { return; }


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

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

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

LLVM IR (-O2):
%struct.sfe_connection_destroy = type opaque
define void @sfe_ipv6_destroy_rule(%struct.sfe_connection_destroy* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int rc_i2c_write_words(int, int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int rc_i2c_write_word(int bus, uint8_t regAddr, uint16_t data) {
  return rc_i2c_write_words(bus, regAddr, 1, &data);
}


x86 assembly (clang, -O0):
<rc_i2c_write_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
lea    -0xc(%rbp),%rcx
call   1030 <rc_i2c_write_words@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_i2c_write_word>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x1,%edx
call   1030 <rc_i2c_write_words@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rc_i2c_write_word(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @rc_i2c_write_words(i32 %0, i32 %1, i32 1, i32* %4)
ret i32 %5
}
signed short read16(unsigned int reg1) {
  unsigned int *reg;
  signed short val;
  reg = (unsigned int *)reg1;
  val = (short)*(reg);
  return val;
}


x86 assembly (clang, -O0):
<read16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %ax,-0x12(%rbp)
movswl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read16>:
mov    %edi,%eax
movzwl (%rax),%eax
ret

LLVM IR (-O0):
define signext i16 @read16(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i16
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %4
%11 = load i16, i16* %4
ret i16 %11
}

LLVM IR (-O2):
define signext i16 @read16(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
%5 = trunc i32 %4 to i16
ret i16 %5
}
/* Variables and functions */
int yas_kxsd9_write_reg(unsigned char, unsigned char *, int);
int yas_kxsd9_write_reg_byte(unsigned char adr, unsigned char val) {
  return yas_kxsd9_write_reg(adr, &val, 1);
}


x86 assembly (clang, -O0):
<yas_kxsd9_write_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    -0x2(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x1(%rbp),%edi
call   1030 <yas_kxsd9_write_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_kxsd9_write_reg_byte>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <yas_kxsd9_write_reg@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_kxsd9_write_reg_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @yas_kxsd9_write_reg(i8 zeroext %5, i8* %4, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @yas_kxsd9_write_reg_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @yas_kxsd9_write_reg(i8 zeroext %0, i8* %3, i32 1)
ret i32 %4
}
/* Type definitions */
struct rnet_message {
  int dummy;
};

/* Variables and functions */
int add_field(struct rnet_message **, char *, int /*<<< orphan*/, char *,
              int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int rnet_message_add_ascii(struct rnet_message **msg, char *key, char *val) {
  return add_field(msg, key, strlen(key), val, strlen(val));
}


x86 assembly (clang, -O0):
<rnet_message_add_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    %eax,%r8d
call   1030 <add_field@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnet_message_add_ascii>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
mov    %eax,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <add_field@plt>

LLVM IR (-O0):
%struct.rnet_message = type { i32 }
define i32 @rnet_message_add_ascii(%struct.rnet_message** %0, i8* %1, i8* %2) {
%4 = alloca %struct.rnet_message**
%5 = alloca i8*
%6 = alloca i8*
store %struct.rnet_message** %0, %struct.rnet_message*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.rnet_message**, %struct.rnet_message*** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @strlen(i8* %9)
%11 = load i8*, i8** %6
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @add_field(%struct.rnet_message** %7, i8* %8, i32 %10, i8* %11, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.rnet_message = type { i32 }
define i32 @rnet_message_add_ascii(%struct.rnet_message** %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @strlen(i8* %2)
%6 = tail call i32 @add_field(%struct.rnet_message** %0, i8* %1, i32 %4, i8* %2, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int init_module(void) {
  printk("Hello, world - this is the kernel speaking\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"Hello, world - this is the kernel speaking\0A\00"
define i32 @init_module() {
%1 = call i32 @printk(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"Hello, world - this is the kernel speaking\0A\00"
define i32 @init_module() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct sched_param {
  scalar_t__ sched_priority;
};
typedef int /*<<< orphan*/ sched;

/* Variables and functions */
int /*<<< orphan*/ SCHED_OTHER;
int /*<<< orphan*/ memset(struct sched_param *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                                      struct sched_param *);
void sched_set_default_priority(void) {
  struct sched_param sched;
  memset(&sched, 0, sizeof(sched));
  sched.sched_priority = 0;
  sched_setscheduler(0, SCHED_OTHER, &sched);
}


x86 assembly (clang, -O0):
<sched_set_default_priority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
movq   $0x0,-0x8(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_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>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sched_param = type { i64 }
@SCHED_OTHER = global i32 0
define void @sched_set_default_priority() {
%1 = alloca %struct.sched_param
%2 = call i32 @memset(%struct.sched_param* %1, i32 0, i32 8)
%3 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i32 0, i32 0
store i64 0, i64* %3
%4 = load i32, i32* @SCHED_OTHER
%5 = call i32 @sched_setscheduler(i32 0, i32 %4, %struct.sched_param* %1)
ret void
}

LLVM IR (-O2):
%struct.sched_param = type { i64 }
@SCHED_OTHER = global i32 0
define void @sched_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 i32 @sched_setscheduler(i32 0, i32 %5, %struct.sched_param* %1)
ret void
}
/* Variables and functions */
int rom_present(char *);
int s3_phoenix_trio64_available() { return rom_present("86c764x1.bin"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"86c764x1.bin\00"
define i32 @s3_phoenix_trio64_available() {
%1 = call i32 @rom_present(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [13 x i8] c"86c764x1.bin\00"
define i32 @s3_phoenix_trio64_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int print(char **, char const *, unsigned long *);
int printf(const char *fmt, ...) {
  register unsigned long *varg = (unsigned long *)(&fmt);
  *varg++;
  char *dst = 0;
  return print((char **)&dst, fmt, varg);
}


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

x86 assembly (clang, -O2):
<printf>:
sub    $0x18,%rsp
mov    %rdi,%rsi
mov    %rdi,0x10(%rsp)
lea    0x18(%rsp),%rdx
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <print@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @printf(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = getelementptr inbounds i8*, i8** %2, i64 1
%5 = bitcast i8** %4 to i64*
%6 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%7 = call i32 @print(i8** %3, i8* %0, i64* %5)
ret i32 %7
}
/* Variables and functions */
scalar_t__ isalnum(char const);
char isdircase(const char c) { return isalnum(c) || c == ' '; }


x86 assembly (clang, -O0):
<isdircase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <isdircase+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdircase>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %cl
cmp    $0x20,%bl
sete   %al
or     %cl,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @isdircase(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 32
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @isdircase(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i8
ret i8 %6
}
void DestroyVertexList(Schema, A) struct frvStruct *Schema;
struct Mark *A;
{
}


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

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

LLVM IR (-O0):
%struct.frvStruct = type opaque
%struct.Mark = type opaque
define void @DestroyVertexList(%struct.frvStruct* %0, %struct.Mark* %1) {
%3 = alloca %struct.frvStruct*
%4 = alloca %struct.Mark*
store %struct.frvStruct* %0, %struct.frvStruct** %3
store %struct.Mark* %1, %struct.Mark** %4
ret void
}

LLVM IR (-O2):
%struct.frvStruct = type opaque
%struct.Mark = type opaque
define void @DestroyVertexList(%struct.frvStruct* nocapture %0, %struct.Mark* nocapture %1) {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int y = __VERIFIER_nondet_int();
  int z = __VERIFIER_nondet_int();
  int x;
  if (__VERIFIER_nondet_int()) {
    x = 1;
  } else {
    x = -1;
  }
  while (y < 100 && z < 100) {
    y = y + x;
    z = z - x;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     114f <main+0x3f>
movl   $0x1,-0x10(%rbp)
jmp    1156 <main+0x46>
movl   $0xffffffff,-0x10(%rbp)
jmp    115b <main+0x4b>
xor    %eax,%eax
cmpl   $0x64,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jge    1174 <main+0x64>
cmpl   $0x64,-0xc(%rbp)
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1184 <main+0x74>
jmp    119b <main+0x8b>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    115b <main+0x4b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
%7 = call i32 (...) @__VERIFIER_nondet_int()
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %4
br label %11
10: ; preds = %0
store i32 -1, i32* %4
br label %11
11: ; preds = %10, %9
br label %12
12: ; preds = %20, %11
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 100
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 100
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br i1 %19, label %20, label %27
20: ; preds = %18
%21 = load i32, i32* %2
%22 = load i32, i32* %4
%23 = add nsw i32 %21, %22
store i32 %23, i32* %2
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = sub nsw i32 %24, %25
store i32 %26, i32* %3
br label %12
27: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
void bar(void) {
  void *x = 0;
  foo(x);
}


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

x86 assembly (clang, -O2):
<bar>:
xor    %edi,%edi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @foo(i8* null)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr4setBank0(int);
int /*<<< orphan*/ chr4setBank1(int);
void s1setParams6XXX(uint16_t addr, uint8_t val) {
  (void)addr;
  chr4setBank0((val & 7) << 12);
  chr4setBank1(((val >> 4) & 7) << 12);
}


x86 assembly (clang, -O0):
<s1setParams6XXX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0x7,%edi
shl    $0xc,%edi
call   1040 <chr4setBank0@plt>
mov    -0x8(%rbp),%edi
sar    $0x4,%edi
and    $0x7,%edi
shl    $0xc,%edi
call   1030 <chr4setBank1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s1setParams6XXX>:
push   %rbx
mov    %esi,%ebx
mov    %esi,%edi
and    $0x7,%edi
shl    $0xc,%edi
call   1040 <chr4setBank0@plt>
and    $0x70,%ebx
shl    $0x8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <chr4setBank1@plt>

LLVM IR (-O0):
define void @s1setParams6XXX(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %6, 7
%8 = shl i32 %7, 12
%9 = call i32 @chr4setBank0(i32 %8)
%10 = load i32, i32* %4
%11 = ashr i32 %10, 4
%12 = and i32 %11, 7
%13 = shl i32 %12, 12
%14 = call i32 @chr4setBank1(i32 %13)
ret void
}

LLVM IR (-O2):
define void @s1setParams6XXX(i32 %0, i32 %1) {
%3 = shl i32 %1, 12
%4 = and i32 %3, 28672
%5 = tail call i32 @chr4setBank0(i32 %4)
%6 = shl i32 %1, 8
%7 = and i32 %6, 28672
%8 = tail call i32 @chr4setBank1(i32 %7)
ret void
}
void ms(char *malloc, int c, int n) {
  for (int i = 0; i < n;)
    malloc[i++] = c;
}


x86 assembly (clang, -O0):
<ms>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1140 <ms+0x40>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1115 <ms+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms>:
test   %edx,%edx
jle    1120 <ms+0x10>
push   %rax
mov    %edx,%edx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @ms(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %12, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i32, i32* %5
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 1
store i32 %17, i32* %7
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
store i8 %14, i8* %19
br label %8
20: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @ms(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = trunc i32 %1 to i8
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %5, %3
ret void
}
int test_imm_09uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x09 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_09uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x9,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_09uint64_midword_reg>:
test   $0x90000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_09uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 589824
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double radian(double d) { return d * 3.1415926 / 180.0; }


x86 assembly (clang, -O0):
<radian>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radian>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @radian(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB4D12D84A
%5 = fdiv double %4, 1.800000e+02
ret double %5
}

LLVM IR (-O2):
define double @radian(double %0) {
%2 = fmul double %0, 0x400921FB4D12D84A
%3 = fdiv double %2, 1.800000e+02
ret double %3
}
void swap(int a[], int i, int j) {
  if (i == j) {
    return;
  }
  int temp = a[i];
  a[i] = a[j];
  a[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    111f <swap+0x1f>
jmp    1151 <swap+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
cmp    %edx,%esi
je     1116 <swap+0x16>
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
store i32 %11, i32* %7
store i32 %8, i32* %10
br label %12
12: ; preds = %3, %5
ret void
}
int adbi_dummy() { return 0; }


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

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

LLVM IR (-O0):
define i32 @adbi_dummy() {
ret i32 0
}

LLVM IR (-O2):
define i32 @adbi_dummy() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
int main() {
  usleep(1000000);
  printf("wake up!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"wake up!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @usleep(i32 1000000)
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"wake up!\00"
define i32 @main() {
%1 = tail call i32 @usleep(i32 1000000)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t Function1Uint64(uint64_t x) { return x + 42; }


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

x86 assembly (clang, -O2):
<Function1Uint64>:
lea    0x2a(%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @Function1Uint64(i64 %0) {
%2 = add nsw i64 %0, 42
ret i64 %2
}
float convert_temp_f2c(float f) { return ((f - 32.0) * (5.0 / 9.0)); }


x86 assembly (clang, -O0):
<convert_temp_f2c>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_temp_f2c>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @convert_temp_f2c(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double %5, 0x3FE1C71C71C71C72
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @convert_temp_f2c(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ gf_to_string(int, char *);
void gf_print(FILE *stream) {
  char out[2048];
  gf_to_string(2047, out);
  fputs(out, stream);
}


x86 assembly (clang, -O0):
<gf_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x810(%rbp),%rsi
mov    $0x7ff,%edi
call   1040 <gf_to_string@plt>
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <fputs@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf_print>:
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    $0x7ff,%edi
mov    %r14,%rsi
call   1040 <gf_to_string@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @gf_print(i32* %0) {
%2 = alloca i32*
%3 = alloca [2048 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 @gf_to_string(i32 2047, i8* %4)
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%7 = load i32*, i32** %2
%8 = call i32 @fputs(i8* %6, i32* %7)
ret void
}

LLVM IR (-O2):
define void @gf_print(i32* nocapture %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = call i32 @gf_to_string(i32 2047, i8* %3)
%5 = call i32 @fputs(i8* %3, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgscale();
int /*<<< orphan*/ commit();
int /*<<< orphan*/ gentext();
void genscale(void) {
  gentext();
  commit();
  cgscale();
}


x86 assembly (clang, -O0):
<genscale>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gentext@plt>
mov    $0x0,%al
call   1040 <commit@plt>
mov    $0x0,%al
call   1050 <cgscale@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<genscale>:
push   %rax
xor    %eax,%eax
call   1030 <gentext@plt>
xor    %eax,%eax
call   1040 <commit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cgscale@plt>

LLVM IR (-O0):
define void @genscale() {
%1 = call i32 (...) @gentext()
%2 = call i32 (...) @commit()
%3 = call i32 (...) @cgscale()
ret void
}

LLVM IR (-O2):
define void @genscale() {
%1 = tail call i32 (...) @gentext()
%2 = tail call i32 (...) @commit()
%3 = tail call i32 (...) @cgscale()
ret void
}
/* Variables and functions */
int d24(int);
int d25(int a) { return d24(d24(a)); }


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

x86 assembly (clang, -O2):
<d25>:
push   %rax
call   1030 <d24@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d24@plt>

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

LLVM IR (-O2):
define i32 @d25(i32 %0) {
%2 = tail call i32 @d24(i32 %0)
%3 = tail call i32 @d24(i32 %2)
ret i32 %3
}
int str_isspace(char c) { return c == ' ' || c == '\n' || c == '\t'; }


x86 assembly (clang, -O0):
<str_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <str_isspace+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     113b <str_isspace+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_isspace>:
mov    $0x1,%eax
cmp    $0xa,%dil
je     1111 <str_isspace+0x11>
cmp    $0x20,%dil
jne    1112 <str_isspace+0x12>
ret
xor    %eax,%eax
cmp    $0x9,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @str_isspace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 10
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 9
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @str_isspace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
unsigned strlen(const char *s) {
  const char *sc;
  for (sc = s; *sc != '\0'; ++sc)
    ;
  return sc - s;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
jmp    1125 <strlen+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ serial_done();
void sigint_handler(int signum) {
  serial_done();
  exit(1);
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <serial_done@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rax
xor    %eax,%eax
call   1030 <serial_done@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @serial_done()
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sigint_handler(i32 %0) {
%2 = tail call i32 (...) @serial_done()
%3 = tail call i32 @exit(i32 1)
unreachable
}
__typeof__(iscntrl((void *)1)) test_iscntrl_21(void) {
  return iscntrl((void *)1);
}


x86 assembly (clang, -O0):
<test_iscntrl_21>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
mov    %eax,%edi
call   1030 <iscntrl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_iscntrl_21>:
mov    $0x1,%edi
jmp    1030 <iscntrl@plt>

LLVM IR (-O0):
define i32 @test_iscntrl_21() {
%1 = call i32 @iscntrl(i32 ptrtoint (i8* inttoptr (i64 1 to i8*) to i32))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_iscntrl_21() {
%1 = tail call i32 @iscntrl(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, long, long, long);
int /*<<< orphan*/ xlErrPutStr(char *);
void xlosInfo(void) {
  extern long xlNFree, xlGCCalls, xlTotal;
  char buf[80];
  sprintf(buf, "\n[ Free: %ld, GC calls: %ld, Total: %ld ]", xlNFree, xlGCCalls,
          xlTotal);
  xlErrPutStr(buf);
}


x86 assembly (clang, -O0):
<xlosInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%rdx
mov    0x2eab(%rip),%rax
mov    (%rax),%rcx
mov    0x2e99(%rip),%rax
mov    (%rax),%r8
lea    0xeaf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <xlErrPutStr@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlosInfo>:
push   %rbx
sub    $0x50,%rsp
mov    0x2eac(%rip),%rax
mov    (%rax),%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%rcx
mov    0x2ea0(%rip),%rax
mov    (%rax),%r8
lea    0xeb6(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <xlErrPutStr@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"\0A[ Free: %ld, GC calls: %ld, Total: %ld ]\00"
@xlNFree = external global i64
@xlGCCalls = external global i64
@xlTotal = external global i64
define void @xlosInfo() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = load i64, i64* @xlNFree
%4 = load i64, i64* @xlGCCalls
%5 = load i64, i64* @xlTotal
%6 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %3, i64 %4, i64 %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%8 = call i32 @xlErrPutStr(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"\0A[ Free: %ld, GC calls: %ld, Total: %ld ]\00"
@xlNFree = external global i64
@xlGCCalls = external global i64
@xlTotal = external global i64
define void @xlosInfo() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = load i64, i64* @xlNFree
%4 = load i64, i64* @xlGCCalls
%5 = load i64, i64* @xlTotal
%6 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %3, i64 %4, i64 %5)
%7 = call i32 @xlErrPutStr(i8* %2)
ret void
}
/* Variables and functions */
int nonl();
int wrap_nonl(void) { return nonl(); }


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

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

LLVM IR (-O0):
define i32 @wrap_nonl() {
%1 = call i32 (...) @nonl()
ret i32 %1
}

LLVM IR (-O2):
define i32 @wrap_nonl() {
%1 = tail call i32 (...) @nonl()
ret i32 %1
}
/* Variables and functions */
scalar_t__ get_major_minors(int, int);
int get_major_framestart(int idcode, int major) {
  int i, frame_count;
  frame_count = 0;
  for (i = 0; i < major; i++)
    frame_count += get_major_minors(idcode, i);
  return frame_count;
}


x86 assembly (clang, -O0):
<get_major_framestart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115e <get_major_framestart+0x4e>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <get_major_minors@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <get_major_framestart+0x1c>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_major_framestart>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <get_major_framestart+0x36>
mov    %esi,%r15d
mov    %edi,%r14d
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14d,%edi
mov    %ebx,%esi
call   1030 <get_major_minors@plt>
add    %eax,%ebp
add    $0x1,%ebx
cmp    %ebx,%r15d
jne    1130 <get_major_framestart+0x20>
jmp    1148 <get_major_framestart+0x38>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_major_framestart(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* %6
store i32 0, i32* %5
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = call i64 @get_major_minors(i32 %12, i32 %13)
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = add nsw i64 %16, %14
%18 = trunc i64 %17 to i32
store i32 %18, i32* %6
br label %19
19: ; preds = %11
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %7
22: ; preds = %7
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
define i32 @get_major_framestart(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = phi i32 [ %10, %4 ], [ 0, %2 ]
%7 = tail call i64 @get_major_minors(i32 %0, i32 %6)
%8 = trunc i64 %7 to i32
%9 = add i32 %5, %8
%10 = add nuw nsw i32 %6, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  extern char *__progname;
  fprintf(stderr,
          "usage: %s [-c] [-r] [-h host] [-i indent] [-l length]"
          " [-n name] [-w width] [acctfile]\n",
          __progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%rdx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [87 x i8] c"usage: %s [-c] [-r] [-h host] [-i indent] [-l length] [-n name] [-w width] [acctfile]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [87 x i8] c"usage: %s [-c] [-r] [-h host] [-i indent] [-l length] [-n name] [-w width] [acctfile]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *source) {
  char *result = malloc(strlen(source) + 1);
  strcpy(result, source);
  return result;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@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):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@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* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
int is_rel_path(const char *path) { return (((path[0]) == '/')) ? 0 : 1; }


x86 assembly (clang, -O0):
<is_rel_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x2f,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_rel_path>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @is_rel_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_rel_path(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t set_xtrail_0s(uint64_t u) { return -u | u; }


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

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

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

LLVM IR (-O2):
define i32 @set_xtrail_0s(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = or i32 %2, %0
ret i32 %3
}
int fib_seq(int n) {
  if (n < 2)
    return n;
  else
    return fib_seq(n - 1) + fib_seq(n - 2);
}


x86 assembly (clang, -O0):
<fib_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <fib_seq+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fib_seq+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib_seq@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib_seq@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib_seq>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib_seq+0x10>
mov    %ebx,%ecx
jmp    1144 <fib_seq+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib_seq@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib_seq+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib_seq(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib_seq(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t adjust_seed_24(uint32_t seed) { return seed ^ (seed << 24); }


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

x86 assembly (clang, -O2):
<adjust_seed_24>:
mov    %edi,%eax
shl    $0x18,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @adjust_seed_24(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 24
%6 = xor i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @adjust_seed_24(i32 %0) {
%2 = shl i32 %0, 24
%3 = xor i32 %2, %0
ret i32 %3
}