xunge/DecIR huggingface dataset:
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_nsec;
  int /*<<< orphan*/ tv_sec;
};
struct nstime {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ nstime_diff(struct timespec *, struct nstime *,
                               struct nstime *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void x_nstime_print_diff(struct nstime *t0, struct nstime *t1) {
  struct timespec r;
  nstime_diff(&r, t0, t1);
  printf("nstime diff: %ld.%09ld seconds\n", r.tv_sec, r.tv_nsec);
}


x86 assembly (clang, -O0):
<x_nstime_print_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1040 <nstime_diff@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_nstime_print_diff>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1040 <nstime_diff@plt>
mov    (%rsp),%edx
mov    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.nstime = type { i32 }
%struct.timespec = type { i32, i32 }
@.str = [32 x i8] c"nstime diff: %ld.%09ld seconds\0A\00"
define void @x_nstime_print_diff(%struct.nstime* %0, %struct.nstime* %1) {
%3 = alloca %struct.nstime*
%4 = alloca %struct.nstime*
%5 = alloca %struct.timespec
store %struct.nstime* %0, %struct.nstime** %3
store %struct.nstime* %1, %struct.nstime** %4
%6 = load %struct.nstime*, %struct.nstime** %3
%7 = load %struct.nstime*, %struct.nstime** %4
%8 = call i32 @nstime_diff(%struct.timespec* %5, %struct.nstime* %6, %struct.nstime* %7)
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.nstime = type { i32 }
%struct.timespec = type { i32, i32 }
@.str = [32 x i8] c"nstime diff: %ld.%09ld seconds\0A\00"
define void @x_nstime_print_diff(%struct.nstime* %0, %struct.nstime* %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to i8*
%5 = call i32 @nstime_diff(%struct.timespec* %3, %struct.nstime* %0, %struct.nstime* %1)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
ret void
}
void vperfctr_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @vperfctr_exit() {
ret void
}
unsigned int hashtbl_string_hash(const void *k) {
  const unsigned char *str = (const unsigned char *)k;
  unsigned int hash = 5381;
  if (str) {
    while (*str++ != '\0') {
      hash = 33 * hash ^ *str;
    }
  }
  return hash;
}


x86 assembly (clang, -O0):
<hashtbl_string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1505,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <hashtbl_string_hash+0x5c>
jmp    1127 <hashtbl_string_hash+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <hashtbl_string_hash+0x57>
imul   $0x21,-0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <hashtbl_string_hash+0x27>
jmp    115c <hashtbl_string_hash+0x5c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashtbl_string_hash>:
mov    $0x1505,%eax
test   %rdi,%rdi
je     1134 <hashtbl_string_hash+0x34>
cmpb   $0x0,(%rdi)
je     1134 <hashtbl_string_hash+0x34>
add    $0x1,%rdi
mov    $0x1505,%ecx
mov    %ecx,%eax
nopw   0x0(%rax,%rax,1)
shl    $0x5,%eax
add    %ecx,%eax
movzbl (%rdi),%edx
xor    %edx,%eax
add    $0x1,%rdi
mov    %eax,%ecx
test   %edx,%edx
jne    1120 <hashtbl_string_hash+0x20>
ret

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

LLVM IR (-O2):
define i32 @hashtbl_string_hash(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %9, %6 ], [ %0, %3 ]
%8 = phi i32 [ %13, %6 ], [ 5381, %3 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul i32 %8, 33
%11 = load i8, i8* %9
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = icmp eq i8 %11, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %3, %1
%16 = phi i32 [ 5381, %1 ], [ 5381, %3 ], [ %13, %6 ]
ret i32 %16
}
void PyThread_ReInitTLS(void) {}


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

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

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

LLVM IR (-O2):
define void @PyThread_ReInitTLS() {
ret void
}
void dbg_dump_lprops(struct ubifs_info *c) { return; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define void @dbg_dump_lprops(%struct.ubifs_info* nocapture %0) {
ret void
}
int Operand_uimm16x4_decode(unsigned int *valp) {
  unsigned uimm16x4_0, imm16_0;
  imm16_0 = *valp & 0xffff;
  uimm16x4_0 = ((((0xffff)) << 16) | imm16_0) << 2;
  *valp = uimm16x4_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_uimm16x4_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     $0xffff0000,%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_uimm16x4_decode>:
mov    (%rdi),%eax
shl    $0x2,%eax
or     $0xfffc0000,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_uimm16x4_decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = and i32 %6, 65535
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = or i32 -65536, %8
%10 = shl i32 %9, 2
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = load i32*, i32** %2
store i32 %11, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_uimm16x4_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 2
%4 = or i32 %3, -262144
store i32 %4, i32* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void StrRight(char *dest, char *src, int num) {
  strcpy(dest, src + strlen(src) - num);
}


x86 assembly (clang, -O0):
<StrRight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdi
cltq
add    %rax,%rsi
movslq -0x14(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrRight>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
movslq %eax,%rsi
add    %rbx,%rsi
movslq %ebp,%rax
sub    %rax,%rsi
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @StrRight(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @strlen(i8* %9)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = sub i64 0, %14
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = call i32 @strcpy(i8* %7, i8* %16)
ret void
}

LLVM IR (-O2):
define void @StrRight(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = sext i32 %2 to i64
%8 = sub nsw i64 0, %7
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = tail call i32 @strcpy(i8* %0, i8* %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
extern void check3(void) { bar(); }


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

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

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

LLVM IR (-O2):
define void @check3() {
%1 = tail call i32 (...) @bar()
ret void
}
void null_task(void) {
  {};
  return;
}


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

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

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

LLVM IR (-O2):
define void @null_task() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *__tz_convert(int /*<<< orphan*/ const *, int, struct tm *);
struct tm *__localtime_r(const time_t *t, struct tm *tp) {
  return __tz_convert(t, 1, tp);
}


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

x86 assembly (clang, -O2):
<__localtime_r>:
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <__tz_convert@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @__localtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca i32*
%4 = alloca %struct.tm*
store i32* %0, i32** %3
store %struct.tm* %1, %struct.tm** %4
%5 = load i32*, i32** %3
%6 = load %struct.tm*, %struct.tm** %4
%7 = call %struct.tm* @__tz_convert(i32* %5, i32 1, %struct.tm* %6)
ret %struct.tm* %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @__localtime_r(i32* %0, %struct.tm* %1) {
%3 = tail call %struct.tm* @__tz_convert(i32* %0, i32 1, %struct.tm* %1)
ret %struct.tm* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_RESPID;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_RESPID_it;
int i2d_OCSP_RESPID(OCSP_RESPID *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &OCSP_RESPID_it);
}


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

x86 assembly (clang, -O2):
<i2d_OCSP_RESPID>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@OCSP_RESPID_it = global i32 0
define i32 @i2d_OCSP_RESPID(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @OCSP_RESPID_it)
ret i32 %3
}
/* Variables and functions */
int A(int, int);
int F(int);
int C(int a, int b) { return A(a, b) / F(a - b); }


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <A@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <F@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <A@plt>
mov    %eax,%r14d
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <F@plt>
mov    %eax,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @C(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @A(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %8, %9
%11 = call i32 @F(i32 %10)
%12 = sdiv i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @C(i32 %0, i32 %1) {
%3 = tail call i32 @A(i32 %0, i32 %1)
%4 = sub nsw i32 %0, %1
%5 = tail call i32 @F(i32 %4)
%6 = sdiv i32 %3, %5
ret i32 %6
}
void loop() {}


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

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

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

LLVM IR (-O2):
define void @loop() {
ret void
}
void maximize_int(int *dest, int src) {
  if (src > *dest)
    *dest = src;
}


x86 assembly (clang, -O0):
<maximize_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jle    1123 <maximize_int+0x23>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<maximize_int>:
cmp    %esi,(%rdi)
jge    1106 <maximize_int+0x6>
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @maximize_int(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 = load i32, i32* %6
%8 = icmp sgt i32 %5, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32*, i32** %3
store i32 %10, i32* %11
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @maximize_int(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp slt i32 %3, %1
br i1 %4, label %5, label %6
5: ; preds = %2
store i32 %1, i32* %0
br label %6
6: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clitest(char *);
void *client_thread(void *arg) { clitest("127.0.0.1"); }


x86 assembly (clang, -O0):
<client_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <clitest@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"127.0.0.1\00"
define i8* @client_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @clitest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
@.str = [10 x i8] c"127.0.0.1\00"
define noalias i8* @client_thread(i8* nocapture readnone %0) {
%2 = tail call i32 @clitest(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* undef
}
void setgraphmode(int mode) {}


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

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

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

LLVM IR (-O2):
define void @setgraphmode(i32 %0) {
ret void
}
int ft_isalpha(int c) {
  return (((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) ? 1 : 0);
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1120 <ft_isalpha+0x20>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <ft_isalpha+0x3f>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <ft_isalpha+0x39>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 122
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
ret i32 %19
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
void avpriv_find_start_code() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_find_start_code() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void printtime() {
  time_t timer;
  char buffer[25];
  struct tm *tm_info;
  time(&timer);
  tm_info = localtime(&timer);
  strftime(buffer, 25, "[%H:%M:%S]: ", tm_info);
  printf("%s", buffer);
}


x86 assembly (clang, -O0):
<printtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x4(%rbp),%rdi
call   1050 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x19,%esi
lea    0xe8e(%rip),%rdx
call   1060 <strftime@plt>
lea    -0x20(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printtime>:
push   %rbx
sub    $0x30,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
lea    0xe9f(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x19,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
lea    0xe90(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [13 x i8] c"[%H:%M:%S]: \00"
@.str.1 = [3 x i8] c"%s\00"
define void @printtime() {
%1 = alloca i32
%2 = alloca [25 x i8]
%3 = alloca %struct.tm*
%4 = call i32 @time(i32* %1)
%5 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %5, %struct.tm** %3
%6 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%7 = load %struct.tm*, %struct.tm** %3
%8 = call i32 @strftime(i8* %6, i32 25, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %7)
%9 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [13 x i8] c"[%H:%M:%S]: \00"
@.str.1 = [3 x i8] c"%s\00"
define void @printtime() {
%1 = alloca i32
%2 = alloca [25 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%5 = call i32 @time(i32* %1)
%6 = call %struct.tm* @localtime(i32* %1)
%7 = call i32 @strftime(i8* %4, i32 25, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createDivExpression(struct memorycontainer *expression1,
                    struct memorycontainer *expression2) {
  return createExpression(0x0D, expression1, expression2);
}


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

x86 assembly (clang, -O2):
<createDivExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xd,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createDivExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 13, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createDivExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 13, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
void outb(int port, unsigned char c) {
  ((unsigned char *)0x80000000)[port] = c;
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
movslq -0x4(%rbp),%rcx
mov    $0x80000000,%eax
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
movslq %edi,%rax
mov    $0x80000000,%ecx
mov    %sil,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @outb(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 2147483648 to i8*), i64 %7
store i8 %5, i8* %8
ret void
}

LLVM IR (-O2):
define void @outb(i32 %0, i8 zeroext %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i8, i8* inttoptr (i64 2147483648 to i8*), i64 %3
store i8 %1, i8* %4
ret void
}
int execute_inotify_add_watch() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_inotify_add_watch() {
ret i32 0
}
unsigned int xxyy(int dx, int dy) { return (dx * dx + dy * dy); }


x86 assembly (clang, -O0):
<xxyy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxyy>:
imul   %edi,%edi
imul   %esi,%esi
lea    (%rsi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @xxyy(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, %0
%4 = mul nsw i32 %1, %1
%5 = add nuw nsw i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t mp_mod_inv_256(uint64_t r[4], uint64_t a[4]) {
  r[0] = a[1] + a[2];
  return 0;
}


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

x86 assembly (clang, -O2):
<mp_mod_inv_256>:
mov    0x10(%rsi),%rax
add    0x8(%rsi),%rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @mp_mod_inv_256(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 1
%7 = load i64, i64* %6
%8 = load i64*, i64** %4
%9 = getelementptr inbounds i64, i64* %8, i64 2
%10 = load i64, i64* %9
%11 = add nsw i64 %7, %10
%12 = load i64*, i64** %3
%13 = getelementptr inbounds i64, i64* %12, i64 0
store i64 %11, i64* %13
ret i64 0
}

LLVM IR (-O2):
define i64 @mp_mod_inv_256(i64* nocapture writeonly %0, i64* nocapture %1) {
%3 = getelementptr inbounds i64, i64* %1, i64 1
%4 = load i64, i64* %3
%5 = getelementptr inbounds i64, i64* %1, i64 2
%6 = load i64, i64* %5
%7 = add nsw i64 %6, %4
store i64 %7, i64* %0
ret i64 0
}
int choosePivot(int lo, int hi) { return hi; }


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

x86 assembly (clang, -O2):
<choosePivot>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @choosePivot(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @choosePivot(i32 %0, i32 returned %1) {
ret i32 %1
}
int bb0(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bb0() {
ret i32 0
}
int doubleToInt100(double x) {
  int sign = 1;
  if (x < 0) {
    x = -x;
    sign = -1;
  }
  return sign * (((int)((x)*1000) + 5) / 10);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1146 <doubleToInt100+0x46>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movsd  0xeac(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x5,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm0,%xmm3
orpd   %xmm1,%xmm3
mulsd  0xee3(%rip),%xmm3
cvttsd2si %xmm3,%eax
add    $0x5,%eax
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x22,%rcx
add    %eax,%ecx
mov    %ecx,%eax
neg    %eax
ucomisd %xmm0,%xmm2
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @doubleToInt100(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
store i32 1, i32* %3
%4 = load double, double* %2
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = fneg double %7
store double %8, double* %2
store i32 -1, i32* %3
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = load double, double* %2
%12 = fmul double %11, 1.000000e+03
%13 = fptosi double %12 to i32
%14 = add nsw i32 %13, 5
%15 = sdiv i32 %14, 10
%16 = mul nsw i32 %10, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @doubleToInt100(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = fmul double %4, 1.000000e+03
%6 = fptosi double %5 to i32
%7 = add nsw i32 %6, 5
%8 = sdiv i32 %7, 10
%9 = sub nsw i32 0, %8
%10 = select i1 %2, i32 %9, i32 %8
ret i32 %10
}
int init_btnMode() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_btnMode() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void uDMAChannelRequest(uint32_t ui32ChannelNum) {
  ASSERT((ui32ChannelNum & 0xffff) < 32);
  (*((volatile uint32_t *)(0x400FF014))) = 1 << (ui32ChannelNum & 0x1f);
}


x86 assembly (clang, -O0):
<uDMAChannelRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
cmp    $0x20,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400ff014,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelRequest>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   $0xffe0,%ebx
sete   %dil
call   1030 <ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
mov    %eax,0x400ff014
pop    %rbx
ret

LLVM IR (-O0):
define void @uDMAChannelRequest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = icmp slt i32 %4, 32
%6 = zext i1 %5 to i32
%7 = call i32 @ASSERT(i32 %6)
%8 = load i32, i32* %2
%9 = and i32 %8, 31
%10 = shl i32 1, %9
store volatile i32 %10, i32* inttoptr (i64 1074786324 to i32*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelRequest(i32 %0) {
%2 = and i32 %0, 65504
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = and i32 %0, 31
%7 = shl nuw i32 1, %6
store volatile i32 %7, i32* inttoptr (i64 1074786324 to i32*)
ret void
}
/* Variables and functions */
int chdir(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int ret = chdir("/");
  printf("ret"
         " is %d\n",
         (ret));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
@.str.1 = [11 x i8] c"ret is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
char *duplica_string(char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strlen(char *);
int main(void) {
  char *s;
  s = (char *)malloc(strlen("Campos verdes") + 1);
  s = "Campos verdes";
  char *s_duplicado;
  s_duplicado = duplica_string(s);
  printf("%s\n", s_duplicado);
  free(s_duplicado);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1070 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe7e(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <duplica_string@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe70(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xe,%edi
call   1060 <malloc@plt>
lea    0xeae(%rip),%rdi
call   1050 <duplica_string@plt>
mov    %rax,%rbx
lea    0xead(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i64 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = add nsw i64 %4, 1
%6 = call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %2
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
%8 = load i8*, i8** %2
%9 = call i8* @duplica_string(i8* %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i64 14)
%2 = tail call i8* @duplica_string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Variables and functions */
double cos(double);
double rng();
double rng_theta(void) {
  double r = 1.0 / cos(1.0 - 2.0 * rng());
  return r;
}


x86 assembly (clang, -O0):
<rng_theta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rng@plt>
movaps %xmm0,%xmm1
addsd  %xmm1,%xmm1
movsd  0xec2(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng_theta>:
push   %rax
xor    %eax,%eax
call   1040 <rng@plt>
addsd  %xmm0,%xmm0
movsd  0xecc(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <cos@plt>
movsd  0xeb7(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rng_theta() {
%1 = alloca double
%2 = call double (...) @rng()
%3 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %2, double 1.000000e+00)
%4 = call double @cos(double %3)
%5 = fdiv double 1.000000e+00, %4
store double %5, double* %1
%6 = load double, double* %1
ret double %6
}

LLVM IR (-O2):
define double @rng_theta() {
%1 = tail call double (...) @rng()
%2 = tail call double @llvm.fmuladd.f64(double %1, double -2.000000e+00, double 1.000000e+00)
%3 = tail call double @cos(double %2)
%4 = fdiv double 1.000000e+00, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_atfork(void (*f0)(void), void (*f1)(void), void (*f2)(void)) {
  assert(0);
}


x86 assembly (clang, -O0):
<pthread_atfork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pthread_atfork(void ()* nocapture readnone %0, void ()* nocapture readnone %1, void ()* nocapture readnone %2) {
%4 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int sprintf(char *, char *, char const *, int);
int greet(const char *name, int year, char *out) {
  int n;
  n = sprintf(out, "Greetings, %s from %d! We come in peace :)", name, year);
  return n;
}


x86 assembly (clang, -O0):
<greet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xecb(%rip),%rsi
call   1030 <sprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greet>:
mov    %esi,%ecx
mov    %rdi,%rax
lea    0xee4(%rip),%rsi
mov    %rdx,%rdi
mov    %rax,%rdx
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Greetings, %s from %d! We come in peace :)\00"
define i32 @greet(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
@.str = [43 x i8] c"Greetings, %s from %d! We come in peace :)\00"
define i32 @greet(i8* %0, i32 %1, i8* nocapture writeonly %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ itemApplyWpn();
void input_reload(void) { itemApplyWpn(); }


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

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

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

LLVM IR (-O2):
define void @input_reload() {
%1 = tail call i32 (...) @itemApplyWpn()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_isd(int, char **);
int main(int argc, char *argv[]) {
  gmx_isd(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_isd(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void fpu_fault(void) { panic("exception(fault): FPU error"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"exception(fault): FPU error\00"
define void @fpu_fault() {
%1 = call i32 @panic(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"exception(fault): FPU error\00"
define void @fpu_fault() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
int _is_power_of_2(int v) { return 0 == (v & (v - 1)); }


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

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

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

LLVM IR (-O2):
define i32 @_is_power_of_2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
scalar_t__ ftell(int /*<<< orphan*/ *);
int get_file_size(FILE *restrict file) {
  fseek(file, 0, SEEK_END);
  int size = (int)ftell(file);
  fseek(file, 0, SEEK_SET);
  return size;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @get_file_size(i32* noalias %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i32*, i32** %2
%11 = load i32, i32* @SEEK_SET
%12 = call i32 @fseek(i32* %10, i32 0, i32 %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @get_file_size(i32* noalias nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = trunc i64 %4 to i32
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i32 0, i32 %6)
ret i32 %5
}
int get_block_icon(char *buffer) { return *((int *)(buffer + 4096 - 4)); }


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

x86 assembly (clang, -O2):
<get_block_icon>:
mov    0xffc(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_block_icon(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4092
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
double CrosswindSpoilerExperimentOffRate(void) { return 0.07; }


x86 assembly (clang, -O0):
<CrosswindSpoilerExperimentOffRate>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CrosswindSpoilerExperimentOffRate>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @CrosswindSpoilerExperimentOffRate() {
ret double 7.000000e-02
}

LLVM IR (-O2):
define double @CrosswindSpoilerExperimentOffRate() {
ret double 7.000000e-02
}
void gaqufb(void) {}


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

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

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

LLVM IR (-O2):
define void @gaqufb() {
ret void
}