xunge/DecIR huggingface dataset:
/* Variables and functions */
double limit_zero2one(double);
double dayfrac_to_local_hr(double dayfrac, double timezone) {
  return 24.0 * limit_zero2one(dayfrac + timezone / 24.0);
}


x86 assembly (clang, -O0):
<dayfrac_to_local_hr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xecc(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
call   1030 <limit_zero2one@plt>
movaps %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dayfrac_to_local_hr>:
push   %rax
divsd  0xee7(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <limit_zero2one@plt>
mulsd  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dayfrac_to_local_hr(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %6, 2.400000e+01
%8 = fadd double %5, %7
%9 = call double @limit_zero2one(double %8)
%10 = fmul double 2.400000e+01, %9
ret double %10
}

LLVM IR (-O2):
define double @dayfrac_to_local_hr(double %0, double %1) {
%3 = fdiv double %1, 2.400000e+01
%4 = fadd double %3, %0
%5 = tail call double @limit_zero2one(double %4)
%6 = fmul double %5, 2.400000e+01
ret double %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ init(int *, int *);
int /*<<< orphan*/ putchar(int);
int main() {
  uint32_t a0, a1, a2;
  init(&a0, &a1);
  while (1) {
    a2 = a1 + a0;
    a0 = a1;
    a1 = a2;
    putchar(a2);
    if (a2 >= 0xe9) {
      init(&a0, &a1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <init@plt>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <putchar@plt>
cmpl   $0xe9,-0x10(%rbp)
jl     1173 <main+0x53>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <init@plt>
jmp    113c <main+0x1c>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%r14
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <init@plt>
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%ebp
add    %eax,%ebp
mov    %eax,0xc(%rsp)
mov    %ebp,0x8(%rsp)
mov    %ebp,%edi
call   1030 <putchar@plt>
cmp    $0xe8,%ebp
jle    1150 <main+0x30>
jmp    1140 <main+0x20>

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 @init(i32* %2, i32* %3)
br label %6
6: ; preds = %0, %18
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = add nsw i32 %7, %8
store i32 %9, i32* %4
%10 = load i32, i32* %3
store i32 %10, i32* %2
%11 = load i32, i32* %4
store i32 %11, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @putchar(i32 %12)
%14 = load i32, i32* %4
%15 = icmp sge i32 %14, 233
br i1 %15, label %16, label %18
16: ; preds = %6
%17 = call i32 @init(i32* %2, i32* %3)
br label %18
18: ; preds = %16, %6
br label %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %7, %0
%6 = call i32 @init(i32* %1, i32* %2)
br label %7
7: ; preds = %5, %7
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, %8
store i32 %8, i32* %1
store i32 %10, i32* %2
%11 = call i32 @putchar(i32 %10)
%12 = icmp sgt i32 %10, 232
br i1 %12, label %5, label %7
}
/* Variables and functions */
int /*<<< orphan*/ ungetch(char);
void ungetstr(char str[]) {
  int i;
  for (i = 0; str[i] != '\0'; i++) {
    ungetch(str[i]);
  }
}


x86 assembly (clang, -O0):
<ungetstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <ungetstr+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ungetch@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ungetstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ungetstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ungetstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ungetch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ungetstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ungetstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @ungetch(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bmy_board_internal_call(char const *, int, char *, char *,
                                           char *);
void bmy_board_create(int boardnum, char *name_en, char *name_zh_gbk,
                      char *secstr) {
  const char *sql = "CALL procedure_insert_board(?, ?, ?, ?)";
  bmy_board_internal_call(sql, boardnum, name_en, name_zh_gbk, secstr);
}


x86 assembly (clang, -O0):
<bmy_board_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <bmy_board_internal_call@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmy_board_create>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xede(%rip),%rdi
jmp    1030 <bmy_board_internal_call@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"CALL procedure_insert_board(?, ?, ?, ?)\00"
define void @bmy_board_create(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8** %9
%10 = load i8*, i8** %9
%11 = load i32, i32* %5
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = call i32 @bmy_board_internal_call(i8* %10, i32 %11, i8* %12, i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"CALL procedure_insert_board(?, ?, ?, ?)\00"
define void @bmy_board_create(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @bmy_board_internal_call(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %2, i8* %3)
ret void
}
void mtime_listener() {}


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

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

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

LLVM IR (-O2):
define void @mtime_listener() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNC_4() {
  long int stat = 99;
  BNCIO(4);
  return (stat);
}


x86 assembly (clang, -O0):
<BNC_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNC_4>:
push   %rax
mov    $0x4,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNC_4() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 4)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNC_4() {
%1 = tail call i32 @BNCIO(i32 4)
ret i64 99
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int unlink(char const *);
void eliminarFifo(const char *nombre) {
  if (unlink(nombre) == -1) {
    perror("Error al eliminar fifo ");
  }
}


x86 assembly (clang, -O0):
<eliminarFifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
jne    114a <eliminarFifo+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eliminarFifo>:
push   %rax
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
je     112d <eliminarFifo+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Error al eliminar fifo \00"
define void @eliminarFifo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @unlink(i8* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Error al eliminar fifo \00"
define void @eliminarFifo(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
int main() {
  int a, b;
  a = b + b + b + b + b + b + b + b + b + b + b + b + b;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
%17 = load i32, i32* %3
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %3
%20 = add nsw i32 %18, %19
%21 = load i32, i32* %3
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %3
%24 = add nsw i32 %22, %23
%25 = load i32, i32* %3
%26 = add nsw i32 %24, %25
%27 = load i32, i32* %3
%28 = add nsw i32 %26, %27
store i32 %28, i32* %2
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ ssize_t;
typedef scalar_t__ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ err_sys(char *);
scalar_t__ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
ssize_t binsize(int fd) {
  off_t s = lseek(fd, 0, SEEK_END);
  if (s == (off_t)-1)
    err_sys("lseek");
  return s;
}


x86 assembly (clang, -O0):
<binsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    1159 <binsize+0x39>
lea    0xeac(%rip),%rdi
call   1030 <err_sys@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binsize>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <lseek@plt>
mov    %rax,%rbx
cmp    $0xffffffffffffffff,%rax
jne    1146 <binsize+0x26>
lea    0xebf(%rip),%rdi
call   1030 <err_sys@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@SEEK_END = global i32 0
@.str = [6 x i8] c"lseek\00"
define i64 @binsize(i32 %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i64 @lseek(i32 %0, i32 0, i32 %2)
%4 = icmp eq i64 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @err_sys(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ fat32_wr_n(void *, unsigned int, int);
void fat32_wr16(void *p, unsigned v) { fat32_wr_n(p, v, 2); }


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

x86 assembly (clang, -O2):
<fat32_wr16>:
mov    $0x2,%edx
jmp    1030 <fat32_wr_n@plt>

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

LLVM IR (-O2):
define void @fat32_wr16(i8* %0, i32 %1) {
%3 = tail call i32 @fat32_wr_n(i8* %0, i32 %1, i32 2)
ret void
}
/* Type definitions */
typedef int uint8_t;
struct PatternGen_Random {
  int dummy;
};

/* Variables and functions */
int PatternGen_Rand(struct PatternGen_Random *);
uint8_t PatternGen_PercChance(struct PatternGen_Random *R, uint8_t perc) {
  int Res = (PatternGen_Rand(R) >> 6);
  if ((Res & 0xff) >= perc)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<PatternGen_PercChance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <PatternGen_Rand@plt>
sar    $0x6,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    $0xff,%eax
cmp    -0x14(%rbp),%eax
jl     114b <PatternGen_PercChance+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <PatternGen_PercChance+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PatternGen_PercChance>:
push   %rbx
mov    %esi,%ebx
call   1030 <PatternGen_Rand@plt>
shr    $0x6,%eax
movzbl %al,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setge  %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.PatternGen_Random = type { i32 }
define i32 @PatternGen_PercChance(%struct.PatternGen_Random* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.PatternGen_Random*
%5 = alloca i32
%6 = alloca i32
store %struct.PatternGen_Random* %0, %struct.PatternGen_Random** %4
store i32 %1, i32* %5
%7 = load %struct.PatternGen_Random*, %struct.PatternGen_Random** %4
%8 = call i32 @PatternGen_Rand(%struct.PatternGen_Random* %7)
%9 = ashr i32 %8, 6
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = and i32 %10, 255
%12 = load i32, i32* %5
%13 = icmp sge i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.PatternGen_Random = type { i32 }
define i32 @PatternGen_PercChance(%struct.PatternGen_Random* %0, i32 %1) {
%3 = tail call i32 @PatternGen_Rand(%struct.PatternGen_Random* %0)
%4 = lshr i32 %3, 6
%5 = and i32 %4, 255
%6 = icmp sge i32 %5, %1
%7 = zext i1 %6 to i32
ret i32 %7
}
int do_582() { return 582; }


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

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

LLVM IR (-O0):
define i32 @do_582() {
ret i32 582
}

LLVM IR (-O2):
define i32 @do_582() {
ret i32 582
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
void fgetc_m1_bad(FILE *f) {
  int arr[10000];
  int c = fgetc(f);
  arr[c] = 42;
}


x86 assembly (clang, -O0):
<fgetc_m1_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c60,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x9c54(%rbp)
movslq -0x9c54(%rbp),%rax
movl   $0x2a,-0x9c50(%rbp,%rax,4)
add    $0x9c60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc_m1_bad>:
jmp    1030 <fgetc@plt>

LLVM IR (-O0):
define void @fgetc_m1_bad(i32* %0) {
%2 = alloca i32*
%3 = alloca [10000 x i32]
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 %8
store i32 42, i32* %9
ret void
}

LLVM IR (-O2):
define void @fgetc_m1_bad(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_bootinfo(void *);
void platform_init(void *arg) { process_bootinfo(arg); }


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

x86 assembly (clang, -O2):
<platform_init>:
jmp    1030 <process_bootinfo@plt>

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

LLVM IR (-O2):
define void @platform_init(i8* %0) {
%2 = tail call i32 @process_bootinfo(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *prog) {
  printf("Usage: %s ftp://[<user>:<password>@]<host>[:port]/<url-path>\n",
         prog);
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"Usage: %s ftp://[<user>:<password>@]<host>[:port]/<url-path>\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"Usage: %s ftp://[<user>:<password>@]<host>[:port]/<url-path>\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core3_print(char *, char *, char const *);
void U_EMRSETCOLORSPACE_print(const char *contents) {
  core3_print("U_EMRSETCOLORSPACE", "ihCS:", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRSETCOLORSPACE_print>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xef2(%rip),%rsi
jmp    1030 <core3_print@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"U_EMRSETCOLORSPACE\00"
@.str.1 = [6 x i8] c"ihCS:\00"
define void @U_EMRSETCOLORSPACE_print(i8* %0) {
%2 = tail call i32 @core3_print(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct lobject {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
struct lobject *machine_return_frame(struct lemon *, struct lobject *);
struct lobject *lemon_machine_return_frame(struct lemon *lemon,
                                           struct lobject *retval) {
  return machine_return_frame(lemon, retval);
}


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

x86 assembly (clang, -O2):
<lemon_machine_return_frame>:
jmp    1030 <machine_return_frame@plt>

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

LLVM IR (-O2):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @lemon_machine_return_frame(%struct.lemon* %0, %struct.lobject* %1) {
%3 = tail call %struct.lobject* @machine_return_frame(%struct.lemon* %0, %struct.lobject* %1)
ret %struct.lobject* %3
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_yield();
void yield() { __builtin_arm_yield(); }


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

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

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

LLVM IR (-O2):
define void @yield() {
%1 = tail call i32 (...) @__builtin_arm_yield()
ret void
}
void test_deletion() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(struct _IO_FILE *, char *, int);
void smp_ol_main_2_unpacked(int *const red2, struct _IO_FILE **const stderr2) {
  { fprintf((*stderr2), "Result = %d\n", (*red2)); }
}


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

x86 assembly (clang, -O2):
<smp_ol_main_2_unpacked>:
mov    (%rsi),%rax
mov    (%rdi),%edx
lea    0xee4(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct._IO_FILE = type { i32 }
@.str = [13 x i8] c"Result = %d\0A\00"
define void @smp_ol_main_2_unpacked(i32* %0, %struct._IO_FILE** %1) {
%3 = alloca i32*
%4 = alloca %struct._IO_FILE**
store i32* %0, i32** %3
store %struct._IO_FILE** %1, %struct._IO_FILE*** %4
%5 = load %struct._IO_FILE**, %struct._IO_FILE*** %4
%6 = load %struct._IO_FILE*, %struct._IO_FILE** %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = call i32 @fprintf(%struct._IO_FILE* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
%struct._IO_FILE = type { i32 }
@.str = [13 x i8] c"Result = %d\0A\00"
define void @smp_ol_main_2_unpacked(i32* nocapture %0, %struct._IO_FILE** nocapture %1) {
%3 = load %struct._IO_FILE*, %struct._IO_FILE** %1
%4 = load i32, i32* %0
%5 = tail call i32 @fprintf(%struct._IO_FILE* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
int abtoi(char *str) {
  register int num;
  num = 0;
  while ('0' <= *str && *str <= '1') {
    num *= 2;
    num += (*str++) - '0';
  }
  return (num);
}


x86 assembly (clang, -O0):
<abtoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0xd(%rbp)
jg     1138 <abtoi+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1148 <abtoi+0x48>
jmp    1171 <abtoi+0x71>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <abtoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abtoi>:
mov    (%rdi),%cl
mov    %ecx,%edx
and    $0xfe,%dl
xor    %eax,%eax
cmp    $0x30,%dl
jne    113a <abtoi+0x3a>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
mov    %ecx,%edx
and    $0xfe,%dl
add    $0x1,%rdi
cmp    $0x30,%dl
je     1120 <abtoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @abtoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -2
%4 = icmp eq i8 %3, 48
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %13, %5 ], [ 0, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = shl nsw i32 %7, 1
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = add i32 %10, -48
%13 = add i32 %12, %9
%14 = load i8, i8* %11
%15 = and i8 %14, -2
%16 = icmp eq i8 %15, 48
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
void ff_hevc_put_hevc_uni_qpel_hv48_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_hv48_8_sse4() {
ret void
}
/* Variables and functions */
unsigned char *hmac_haval128(unsigned char *, unsigned char const *, size_t,
                             unsigned char const *, size_t);
unsigned char *mac_hmac_haval128(unsigned char *out, const unsigned char *key,
                                 size_t key_len, const unsigned char *msg,
                                 size_t msg_len) {
  return hmac_haval128(out, key, key_len, msg, msg_len);
}


x86 assembly (clang, -O0):
<mac_hmac_haval128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <hmac_haval128@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_hmac_haval128>:
jmp    1030 <hmac_haval128@plt>

LLVM IR (-O0):
define i8* @mac_hmac_haval128(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i64, i64* %10
%16 = call i8* @hmac_haval128(i8* %11, i8* %12, i64 %13, i8* %14, i64 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @mac_hmac_haval128(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_haval128(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
/* Variables and functions */
float sin(float);
__attribute__((no)) float bar() { return sin(12.4f); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movss  0xee4(%rip),%xmm0
call   1030 <sin@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define float @bar() {
%1 = call float @sin(float 0x4028CCCCC0000000)
ret float %1
}

LLVM IR (-O2):
define float @bar() {
ret float 0xBFC53287A0000000
}
/* Variables and functions */
int /*<<< orphan*/ doIt(char *);
void stackSizeWarning() {
  char buffer[80];
  doIt(buffer);
}


x86 assembly (clang, -O0):
<stackSizeWarning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
call   1030 <doIt@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stackSizeWarning>:
sub    $0x58,%rsp
mov    %rsp,%rdi
call   1030 <doIt@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
define void @stackSizeWarning() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @doIt(i8* %2)
ret void
}

LLVM IR (-O2):
define void @stackSizeWarning() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @doIt(i8* %2)
ret void
}
/* Variables and functions */
int _stricmp(char const *, char const *);
int stricmp(const char *s1, const char *s2) { return _stricmp(s1, s2); }


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

x86 assembly (clang, -O2):
<stricmp>:
jmp    1030 <_stricmp@plt>

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

LLVM IR (-O2):
define i32 @stricmp(i8* %0, i8* %1) {
%3 = tail call i32 @_stricmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void erasescreen(void) {
  printf("\x1b["
         "2J");
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
define void @erasescreen() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define void @erasescreen() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo274() {}


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

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

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

LLVM IR (-O2):
define void @foo274() {
ret void
}
/* Variables and functions */
long long give_me_product(long long, long long);
long long give_me_power(long long a, long long b) {
  long long ret = 1;
  while (b--) {
    ret = give_me_product(a, ret);
  }
  return ret;
}


x86 assembly (clang, -O0):
<give_me_power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1157 <give_me_power+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <give_me_product@plt>
mov    %rax,-0x18(%rbp)
jmp    1128 <give_me_power+0x18>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<give_me_power>:
push   %r14
push   %rbx
push   %rax
test   %rsi,%rsi
je     1143 <give_me_power+0x33>
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <give_me_product@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <give_me_power+0x20>
jmp    1148 <give_me_power+0x38>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @give_me_power(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 1, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = add nsw i64 %6, -1
%8 = tail call i64 @give_me_product(i64 %0, i64 %5)
%9 = icmp eq i64 %7, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i64 [ 1, %2 ], [ %8, %4 ]
ret i64 %11
}
/* Variables and functions */
int atoi(char *);
int get_input(char *argv[]) {
  char *str_input = argv[1];
  return atoi(str_input);
}


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

x86 assembly (clang, -O2):
<get_input>:
mov    0x8(%rdi),%rdi
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @get_input(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = tail call i32 @atoi(i8* %3)
ret i32 %4
}
void debug(const char *pFormat, ...) {}


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

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

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

LLVM IR (-O2):
define void @debug(i8* nocapture %0, ...) {
ret void
}
void foo_2_2_2_1_1_2_2_1_1() {}


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

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

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

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @Network_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *, unsigned int);
char *itoa_signed(int num, char *str, unsigned int base) {
  if (num < 0) {
    *str++ = '-';
    num *= -1;
  }
  itoa(num, str, base);
  return --str;
}


x86 assembly (clang, -O0):
<itoa_signed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1145 <itoa_signed+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <itoa@plt>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa_signed>:
push   %rbx
mov    %rsi,%rbx
test   %edi,%edi
jns    1121 <itoa_signed+0x11>
movb   $0x2d,(%rbx)
add    $0x1,%rbx
neg    %edi
mov    %rbx,%rsi
call   1030 <itoa@plt>
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @itoa_signed(i32 %0, i8* %1, i32 %2) {
%4 = icmp slt i32 %0, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
%7 = sub nsw i32 0, %0
br label %8
8: ; preds = %5, %3
%9 = phi i8* [ %6, %5 ], [ %1, %3 ]
%10 = phi i32 [ %7, %5 ], [ %0, %3 ]
%11 = tail call i32 @itoa(i32 %10, i8* %9, i32 %2)
%12 = getelementptr inbounds i8, i8* %9, i64 -1
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void func_1c(int const *const i) { printf("func_1c : %d\n", *i); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"func_1c : %d\0A\00"
define void @func_1c(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glVertex2d(int /*<<< orphan*/, int /*<<< orphan*/);
void Vertex2d(GLdouble x, GLdouble y) { glVertex2d(x, y); }


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

x86 assembly (clang, -O2):
<Vertex2d>:
jmp    1030 <glVertex2d@plt>

LLVM IR (-O0):
define void @Vertex2d(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 @glVertex2d(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @Vertex2d(i32 %0, i32 %1) {
%3 = tail call i32 @glVertex2d(i32 %0, i32 %1)
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ cwd;

/* Variables and functions */
int /*<<< orphan*/ *getcwd(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int pwd(char **command, struct tm start) {
  char cwd[1024];
  if (getcwd(cwd, sizeof(cwd)) != NULL) {
    printf("%s\n", cwd);
  } else {
    perror("getcwd:");
  }
  return 1;
}


x86 assembly (clang, -O0):
<pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %esi,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
cmp    $0x0,%rax
je     1175 <pwd+0x45>
lea    -0x410(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
jmp    1181 <pwd+0x51>
lea    0xe88(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwd>:
sub    $0x408,%rsp
mov    %rsp,%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
test   %rax,%rax
je     1165 <pwd+0x35>
lea    0xeb0(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x408,%rsp
ret
lea    0xe98(%rip),%rdi
call   1050 <perror@plt>
jmp    1158 <pwd+0x28>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [8 x i8] c"getcwd:\00"
define i32 @pwd(i8** nocapture readnone %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32* @getcwd(i8* %4, i32 1024)
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %11
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void term_up(int n) { printf("\033[%dA", n); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dA\00"
define void @term_up(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int verificar(char expressao, char entradasaida[]) {
  int i = 0;
  for (i = 0; entradasaida[i] != 0; i++) {
    if (expressao == entradasaida[i])
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<verificar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1168 <verificar+0x68>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1155 <verificar+0x55>
movl   $0x1,-0x4(%rbp)
jmp    116f <verificar+0x6f>
jmp    115a <verificar+0x5a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <verificar+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verificar>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <verificar+0x20>
add    $0x1,%rsi
nopl   0x0(%rax)
cmp    %dil,%cl
je     1121 <verificar+0x21>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <verificar+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @verificar(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %1, i64 %13
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %13, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = icmp eq i8 %11, %0
%13 = add nuw i64 %10, 1
br i1 %12, label %14, label %5
14: ; preds = %9, %5, %2
%15 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %15
}