xunge/DecIR huggingface dataset:
int battI(unsigned short ticks) { return (ticks - 29000) * 60; }


x86 assembly (clang, -O0):
<battI>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sub    $0x7148,%eax
imul   $0x3c,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<battI>:
imul   $0x3c,%edi,%eax
add    $0xffe57320,%eax
ret

LLVM IR (-O0):
define i32 @battI(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = sub nsw i32 %4, 29000
%6 = mul nsw i32 %5, 60
ret i32 %6
}

LLVM IR (-O2):
define i32 @battI(i16 zeroext %0) {
%2 = zext i16 %0 to i32
%3 = mul nuw nsw i32 %2, 60
%4 = add nsw i32 %3, -1740000
ret i32 %4
}
/* Variables and functions */
int __WORDSIZE;
void set_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % __WORDSIZE));
  unsigned long *p = ((unsigned long *)addr) + ((nr) / __WORDSIZE);
  *p |= mask;
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed3(%rip),%rcx
cltd
idivl  (%rcx)
mov    %edx,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eae(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
cltd
idivl  (%rcx)
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
cltq
or     %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
@__WORDSIZE = global i32 0
define void @set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = load i32, i32* @__WORDSIZE
%9 = srem i32 %7, %8
%10 = zext i32 %9 to i64
%11 = shl i64 1, %10
store i64 %11, i64* %5
%12 = load i64*, i64** %4
%13 = load i32, i32* %3
%14 = load i32, i32* @__WORDSIZE
%15 = sdiv i32 %13, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %12, i64 %16
store i64* %17, i64** %6
%18 = load i64, i64* %5
%19 = load i64*, i64** %6
%20 = load i64, i64* %19
%21 = or i64 %20, %18
store i64 %21, i64* %19
ret void
}

LLVM IR (-O2):
@__WORDSIZE = global i32 0
define void @set_bit(i32 %0, i64* nocapture %1) {
%3 = load i32, i32* @__WORDSIZE
%4 = srem i32 %0, %3
%5 = zext i32 %4 to i64
%6 = shl nuw i64 1, %5
%7 = sdiv i32 %0, %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %1, i64 %8
%10 = load i64, i64* %9
%11 = or i64 %10, %6
store i64 %11, i64* %9
ret void
}
/* Variables and functions */
char *scanParameterlist(char ***, char *);
char *scanTagname(char **, char *);
char *skipSpaces(char *);
char *scanTag(char *pc, char **tagname, char ***parameter) {
  pc = scanTagname(tagname, pc);
  pc = skipSpaces(pc);
  pc = scanParameterlist(parameter, pc);
  return pc;
}


x86 assembly (clang, -O0):
<scanTag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <scanTagname@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <skipSpaces@plt>
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <scanParameterlist@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanTag>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1050 <scanTagname@plt>
mov    %rax,%rdi
call   1040 <skipSpaces@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <scanParameterlist@plt>

LLVM IR (-O0):
define i8* @scanTag(i8* %0, i8** %1, i8*** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8***
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8*** %2, i8**** %6
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %4
%9 = call i8* @scanTagname(i8** %7, i8* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i8* @skipSpaces(i8* %10)
store i8* %11, i8** %4
%12 = load i8***, i8**** %6
%13 = load i8*, i8** %4
%14 = call i8* @scanParameterlist(i8*** %12, i8* %13)
store i8* %14, i8** %4
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @scanTag(i8* %0, i8** %1, i8*** %2) {
%4 = tail call i8* @scanTagname(i8** %1, i8* %0)
%5 = tail call i8* @skipSpaces(i8* %4)
%6 = tail call i8* @scanParameterlist(i8*** %2, i8* %5)
ret i8* %6
}
/* Type definitions */
struct terminal {
  int dummy;
};
struct parm_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_cursor(struct terminal *, int, int /*<<< orphan*/);
int sum(struct parm_t *);
void curs_down(struct terminal *term, struct parm_t *parm) {
  int num = sum(parm);
  if (num <= 0)
    num = 1;
  move_cursor(term, num, 0);
}


x86 assembly (clang, -O0):
<curs_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sum@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     114d <curs_down+0x2d>
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1040 <move_cursor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curs_down>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <sum@plt>
test   %eax,%eax
mov    $0x1,%esi
cmovg  %eax,%esi
mov    %rbx,%rdi
xor    %edx,%edx
pop    %rbx
jmp    1040 <move_cursor@plt>

LLVM IR (-O0):
%struct.terminal = type { i32 }
%struct.parm_t = type { i32 }
define void @curs_down(%struct.terminal* %0, %struct.parm_t* %1) {
%3 = alloca %struct.terminal*
%4 = alloca %struct.parm_t*
%5 = alloca i32
store %struct.terminal* %0, %struct.terminal** %3
store %struct.parm_t* %1, %struct.parm_t** %4
%6 = load %struct.parm_t*, %struct.parm_t** %4
%7 = call i32 @sum(%struct.parm_t* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %5
br label %11
11: ; preds = %10, %2
%12 = load %struct.terminal*, %struct.terminal** %3
%13 = load i32, i32* %5
%14 = call i32 @move_cursor(%struct.terminal* %12, i32 %13, i32 0)
ret void
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
%struct.parm_t = type { i32 }
define void @curs_down(%struct.terminal* %0, %struct.parm_t* %1) {
%3 = tail call i32 @sum(%struct.parm_t* %1)
%4 = icmp sgt i32 %3, 1
%5 = select i1 %4, i32 %3, i32 1
%6 = tail call i32 @move_cursor(%struct.terminal* %0, i32 %5, i32 0)
ret void
}
void all_started(void) {}


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

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

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

LLVM IR (-O2):
define void @all_started() {
ret void
}
void dont_report(const int level, const char *format, ...) {}


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

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

LLVM IR (-O0):
define void @dont_report(i32 %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @dont_report(i32 %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void handler(int signo __attribute__((unused))) {
  printf("Incorrectly in signal handler\n");
  printf("Test FAILED\n");
  exit(1);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Incorrectly in signal handler\0A\00"
@.str.1 = [13 x i8] c"Test FAILED\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [30 x i8] c"Incorrectly in signal handler\00"
@str.2 = [12 x i8] c"Test FAILED\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ vec4d_dot(double const *, double const *);
double vec4d_norm(const double A[4]) { return sqrt(vec4d_dot(A, A)); }


x86 assembly (clang, -O0):
<vec4d_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <vec4d_dot@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4d_norm>:
push   %rax
mov    %rdi,%rsi
call   1030 <vec4d_dot@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @vec4d_norm(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double*, double** %2
%5 = call i32 @vec4d_dot(double* %3, double* %4)
%6 = call double @sqrt(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @vec4d_norm(double* %0) {
%2 = tail call i32 @vec4d_dot(double* %0, double* %0)
%3 = tail call double @sqrt(i32 %2)
ret double %3
}
long int reverse(int a) {
  int sum = 0;
  while (a) {
    sum = sum * 10 + a % 10;
    a /= 10;
  }
  return sum;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1145 <reverse+0x45>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <reverse+0xe>
movslq -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
test   %edi,%edi
je     1141 <reverse+0x41>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <reverse+0x10>
cltq
ret

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

LLVM IR (-O2):
define i64 @reverse(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3
%13 = sext i32 %8 to i64
br label %14
14: ; preds = %12, %1
%15 = phi i64 [ 0, %1 ], [ %13, %12 ]
ret i64 %15
}
/* Variables and functions */
unsigned int __raw_readl(unsigned int);
int /*<<< orphan*/ __raw_writel(unsigned int, unsigned int);
void __raw_bits_xor(unsigned int v, unsigned int a) {
  __raw_writel((__raw_readl(a) ^ v), a);
}


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

x86 assembly (clang, -O2):
<__raw_bits_xor>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <__raw_readl@plt>
xor    %eax,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__raw_writel@plt>

LLVM IR (-O0):
define void @__raw_bits_xor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @__raw_readl(i32 %5)
%7 = load i32, i32* %3
%8 = xor i32 %6, %7
%9 = load i32, i32* %4
%10 = call i32 @__raw_writel(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @__raw_bits_xor(i32 %0, i32 %1) {
%3 = tail call i32 @__raw_readl(i32 %1)
%4 = xor i32 %3, %0
%5 = tail call i32 @__raw_writel(i32 %4, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void loaderUsage(void) {
  fprintf(stderr, "usage: loader <-h> <-p device_file> <-b baud_rate> <-f "
                  "firmware_file> <-o> <-n>\n");
}


x86 assembly (clang, -O0):
<loaderUsage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<loaderUsage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [81 x i8] c"usage: loader <-h> <-p device_file> <-b baud_rate> <-f firmware_file> <-o> <-n>\0A\00"
define void @loaderUsage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [81 x i8] c"usage: loader <-h> <-p device_file> <-b baud_rate> <-f firmware_file> <-o> <-n>\0A\00"
define void @loaderUsage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *);
void m_abort(int code) {
  switch (code) {
  case 1:
    printf("Aborting due to insuficcient memory\n");
    break;
  default:
    printf("An undefined error caused abnormal termination\n");
  }
  abort();
}


x86 assembly (clang, -O0):
<m_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
jne    114d <m_abort+0x2d>
jmp    113c <m_abort+0x1c>
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
jmp    1159 <m_abort+0x39>
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<m_abort>:
push   %rax
cmp    $0x1,%edi
lea    0xf04(%rip),%rax
lea    0xece(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Aborting due to insuficcient memory\0A\00"
@.str.1 = [48 x i8] c"An undefined error caused abnormal termination\0A\00"
define void @m_abort(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 1, label %4
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@str = [47 x i8] c"An undefined error caused abnormal termination\00"
@str.2 = [36 x i8] c"Aborting due to insuficcient memory\00"
define void @m_abort(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
%5 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int inet_pton(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
int is_valid_ip(char *ip_string) {
  int result;
  struct sockaddr_in sa;
  result = inet_pton(AF_INET, ip_string, &(sa.sin_addr));
  return result != 0;
}


x86 assembly (clang, -O0):
<is_valid_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <inet_pton@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_ip>:
push   %rax
mov    %rdi,%rsi
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
call   1030 <inet_pton@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@AF_INET = global i32 0
define i32 @is_valid_ip(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
store i8* %0, i8** %2
%5 = load i32, i32* @AF_INET
%6 = load i8*, i8** %2
%7 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%8 = call i32 @inet_pton(i32 %5, i8* %6, i32* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
@AF_INET = global i32 0
define i32 @is_valid_ip(i8* %0) {
%2 = alloca %struct.sockaddr_in
%3 = bitcast %struct.sockaddr_in* %2 to i8*
%4 = load i32, i32* @AF_INET
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
%6 = call i32 @inet_pton(i32 %4, i8* %0, i32* %5)
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, result;
  scanf("%d", &n);
  result = exact_square(n);
  printf("%d", result);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <exact_square@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @exact_square(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ armnet_init();
int /*<<< orphan*/ armnet_soak();
int /*<<< orphan*/ usleep(int);
int main(int argc, char **argv) {
  armnet_init();
  while (1) {
    armnet_soak();
    usleep(200 * 1000);
  }
  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    $0x0,%al
call   1040 <armnet_init@plt>
mov    $0x0,%al
call   1030 <armnet_soak@plt>
mov    $0x30d40,%edi
call   1050 <usleep@plt>
jmp    114d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <armnet_init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <armnet_soak@plt>
mov    $0x30d40,%edi
call   1050 <usleep@plt>
jmp    1140 <main+0x10>

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 = call i32 (...) @armnet_init()
br label %7
7: ; preds = %2, %7
%8 = call i32 (...) @armnet_soak()
%9 = call i32 @usleep(i32 200000)
br label %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @armnet_init()
br label %4
4: ; preds = %2, %4
%5 = tail call i32 (...) @armnet_soak()
%6 = tail call i32 @usleep(i32 200000)
br label %4
}
int g(long long a, int b) {
  int c = a != 20;
  return c + b;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x14,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xor    %eax,%eax
cmp    $0x14,%rdi
setne  %al
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @g(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = icmp ne i64 %6, 20
%8 = zext i1 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @g(i64 %0, i32 %1) {
%3 = icmp ne i64 %0, 20
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %1
ret i32 %5
}
void SPI_RP_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI_RP_RestoreConfig() {
ret void
}
int fibonacci(int n) {
  if (0 == n)
    return 0;
  if (1 == n)
    return 1;
  return fibonacci(n - 1) + fibonacci(n - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1132 <fibonacci+0x22>
movl   $0x0,-0x4(%rbp)
jmp    116f <fibonacci+0x5f>
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    114c <fibonacci+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    116f <fibonacci+0x5f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fibonacci+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fibonacci+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fibonacci(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
unsigned xrop3_142_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk2 = S ^ D;
  stk3 = T ^ D;
  stk2 = stk2 & stk3;
  stk1 = S ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_142_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_142_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
mov    %ecx,%edx
xor    $0xff,%edx
xor    $0xff,%eax
and    %edx,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_142_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = xor i32 %23, %24
store i32 %25, i32* %9
%26 = load i32, i32* %7
%27 = load i32, i32* %5
%28 = xor i32 %26, %27
store i32 %28, i32* %10
%29 = load i32, i32* %9
%30 = load i32, i32* %10
%31 = and i32 %29, %30
store i32 %31, i32* %9
%32 = load i32, i32* %6
%33 = load i32, i32* %9
%34 = xor i32 %32, %33
store i32 %34, i32* %8
%35 = load i32, i32* %8
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_142_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = xor i32 %6, 255
%9 = and i32 %8, %7
%10 = xor i32 %9, %4
ret i32 %10
}
/* Type definitions */
struct hashentry {
  int dummy;
};

/* Variables and functions */
scalar_t__ malloc(int);
void init(struct hashentry ***ptr_to_ht, long long int N) {
  *ptr_to_ht = (struct hashentry **)malloc(sizeof(struct hashentry *) * (N));
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbx
mov    %rdi,%rbx
lea    0x0(,%rsi,8),%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.hashentry = type { i32 }
define void @init(%struct.hashentry*** %0, i64 %1) {
%3 = alloca %struct.hashentry***
%4 = alloca i64
store %struct.hashentry*** %0, %struct.hashentry**** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = mul i64 8, %5
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to %struct.hashentry**
%10 = load %struct.hashentry***, %struct.hashentry**** %3
store %struct.hashentry** %9, %struct.hashentry*** %10
ret void
}

LLVM IR (-O2):
%struct.hashentry = type { i32 }
define void @init(%struct.hashentry*** nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %3, 3
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to %struct.hashentry**
store %struct.hashentry** %6, %struct.hashentry*** %0
ret void
}
double double_min(double arg1, double arg2) {
  return arg1 > arg2 ? arg2 : arg1;
}


x86 assembly (clang, -O0):
<double_min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <double_min+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <double_min+0x37>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_min>:
minsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @double_min(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 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %4
br label %12
10: ; preds = %2
%11 = load double, double* %3
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @double_min(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
char *input_limited(char *, int);
char *input(char *prompt) { return input_limited(prompt, 80); }


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

x86 assembly (clang, -O2):
<input>:
mov    $0x50,%esi
jmp    1030 <input_limited@plt>

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

LLVM IR (-O2):
define i8* @input(i8* %0) {
%2 = tail call i8* @input_limited(i8* %0, i32 80)
ret i8* %2
}
/* Type definitions */
struct _Locale_monetary {
  int dummy;
};

/* Variables and functions */
char _Locale_frac_digits(struct _Locale_monetary *lmon) { return 0; }


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

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

LLVM IR (-O0):
%struct._Locale_monetary = type { i32 }
define signext i8 @_Locale_frac_digits(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
ret i8 0
}

LLVM IR (-O2):
%struct._Locale_monetary = type { i32 }
define signext i8 @_Locale_frac_digits(%struct._Locale_monetary* nocapture readnone %0) {
ret i8 0
}
int do_075() { return 75; }


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

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

LLVM IR (-O0):
define i32 @do_075() {
ret i32 75
}

LLVM IR (-O2):
define i32 @do_075() {
ret i32 75
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
void player_getPathForPlugin(char *dest, const char *pathForPlugins,
                             const char *pluginFileName) {
  if (pathForPlugins != NULL) {
    sprintf(dest, "%s/%s", pathForPlugins, pluginFileName);
  } else {
    strcpy(dest, pluginFileName);
  }
}


x86 assembly (clang, -O0):
<player_getPathForPlugin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <player_getPathForPlugin+0x3c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeae(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1169 <player_getPathForPlugin+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<player_getPathForPlugin>:
mov    %rdx,%rcx
test   %rsi,%rsi
je     1137 <player_getPathForPlugin+0x17>
mov    %rsi,%rdx
lea    0xece(%rip),%rsi
jmp    1040 <sprintf@plt>
mov    %rcx,%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
define void @player_getPathForPlugin(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
br label %18
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = load i8*, i8** %6
%17 = call i32 @strcpy(i8* %15, i8* %16)
br label %18
18: ; preds = %14, %9
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
define void @player_getPathForPlugin(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @strcpy(i8* %0, i8* %2)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hola mundo \n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hola mundo \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GroundTruthHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void GroundTruthUpdated() { UAVObjUpdated(GroundTruthHandle()); }


x86 assembly (clang, -O0):
<GroundTruthUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GroundTruthHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GroundTruthUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <GroundTruthHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @GroundTruthUpdated() {
%1 = call i32 (...) @GroundTruthHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GroundTruthUpdated() {
%1 = tail call i32 (...) @GroundTruthHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(void) {
  fprintf(stdout, "to stdout ... ");
  fprintf(stderr, "to stderr ... ");
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [15 x i8] c"to stdout ... \00"
@stderr = global i32 0
@.str.1 = [15 x i8] c"to stderr ... \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [15 x i8] c"to stdout ... \00"
@stderr = global i32 0
@.str.1 = [15 x i8] c"to stderr ... \00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ n_base(int, long long);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, long long *);
int main(void) {
  long long num;
  while (1) {
    scanf("%lld", &num);
    if (num == -1)
      break;
    printf("%lld\n", n_base(4, num));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    115f <main+0x2f>
jmp    1180 <main+0x50>
mov    -0x10(%rbp),%rsi
mov    $0x4,%edi
call   1030 <n_base@plt>
mov    %eax,%esi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%rsi
cmp    $0xffffffffffffffff,%rsi
je     119a <main+0x6a>
lea    0xea9(%rip),%r14
lea    0xe9d(%rip),%r15
lea    0x8(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x4,%edi
call   1030 <n_base@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%rsi
cmp    $0xffffffffffffffff,%rsi
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = icmp eq i64 %4, -1
br i1 %5, label %13, label %6
6: ; preds = %0, %6
%7 = phi i64 [ %11, %6 ], [ %4, %0 ]
%8 = call i32 @n_base(i32 4, i64 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%11 = load i64, i64* %1
%12 = icmp eq i64 %11, -1
br i1 %12, label %13, label %6
13: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main() {
  int mygetline(char *, int);
  char s[100];
  int len = mygetline(s, 100);
  printf("%d %s\n", len, s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1040 <mygetline@plt>
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%esi
lea    -0x70(%rbp),%rdx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <mygetline@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @mygetline(i8* %2, i32 100)
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Enable_1302();
int /*<<< orphan*/ Read_1302_Data(unsigned char *);
int /*<<< orphan*/ Write_1302_Data(unsigned char *);
void Lock_1302(void) {
  unsigned char TimeBuffer[8];
  Read_1302_Data(&TimeBuffer[0]);
  TimeBuffer[0] = TimeBuffer[0] | 0x80;
  Enable_1302();
  Write_1302_Data(&TimeBuffer[0]);
  return;
}


x86 assembly (clang, -O0):
<Lock_1302>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <Read_1302_Data@plt>
movzbl -0x8(%rbp),%eax
or     $0x80,%eax
mov    %al,-0x8(%rbp)
mov    $0x0,%al
call   1040 <Enable_1302@plt>
lea    -0x8(%rbp),%rdi
call   1050 <Write_1302_Data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lock_1302>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <Read_1302_Data@plt>
orb    $0x80,0x8(%rsp)
xor    %eax,%eax
call   1040 <Enable_1302@plt>
mov    %rbx,%rdi
call   1050 <Write_1302_Data@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @Lock_1302() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%3 = call i32 @Read_1302_Data(i8* %2)
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = or i32 %6, 128
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
store i8 %8, i8* %9
%10 = call i32 (...) @Enable_1302()
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%12 = call i32 @Write_1302_Data(i8* %11)
ret void
}

LLVM IR (-O2):
define void @Lock_1302() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%3 = call i32 @Read_1302_Data(i8* %2)
%4 = load i8, i8* %2
%5 = or i8 %4, -128
store i8 %5, i8* %2
%6 = call i32 (...) @Enable_1302()
%7 = call i32 @Write_1302_Data(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void str_table_print(char *src[]) {
  int i;
  for (i = 0; src[i] != NULL; i++) {
    printf("%s", src[i]);
  }
}


x86 assembly (clang, -O0):
<str_table_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     115c <str_table_print+0x4c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <str_table_print+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_table_print>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1144 <str_table_print+0x34>
mov    %rdi,%rbx
add    $0x8,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <str_table_print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @str_table_print(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %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 = icmp ne i8* %9, null
br i1 %10, label %11, label %21
11: ; preds = %4
%12 = load i8**, i8*** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @str_table_print(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
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 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %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, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void NCONF_dump_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @NCONF_dump_fp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ shutdown();
void terminate(void) {
  shutdown();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <shutdown@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<terminate>:
push   %rax
xor    %eax,%eax
call   1030 <shutdown@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @terminate() {
%1 = call i32 (...) @shutdown()
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @terminate() {
%1 = tail call i32 (...) @shutdown()
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
void test1_ptr(int x) {
  int buf[100];
  int *p = buf;
  p[101] = 1;
}


x86 assembly (clang, -O0):
<test1_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x1a0(%rbp),%rax
mov    %rax,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%rax
movl   $0x1,0x194(%rax)
add    $0x130,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test1_ptr(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i32]
%4 = alloca i32*
store i32 %0, i32* %2
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
store i32* %5, i32** %4
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 101
store i32 1, i32* %7
ret void
}

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