xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float pot(float exp, float num) {
  int i;
  float r = 1;
  for (i = 0; i < exp; i++)
    r *= num;
  printf("%f\n", r);
  return r;
}


x86 assembly (clang, -O0):
<pot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1166 <pot+0x56>
movss  -0x8(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <pot+0x26>
movss  -0x10(%rbp),%xmm0
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pot>:
push   %rax
xorps  %xmm2,%xmm2
movss  0xee4(%rip),%xmm3
ucomiss %xmm2,%xmm0
jbe    1143 <pot+0x33>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xorps  %xmm2,%xmm2
cvtsi2ss %eax,%xmm2
mulss  %xmm1,%xmm3
add    $0x1,%eax
ucomiss %xmm2,%xmm0
ja     1130 <pot+0x20>
movss  %xmm3,0x4(%rsp)
lea    0xeb4(%rip),%rdi
movaps %xmm3,%xmm0
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define float @pot(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
store float 1.000000e+00, float* %6
store i32 0, i32* %5
br label %7
7: ; preds = %16, %2
%8 = load i32, i32* %5
%9 = sitofp i32 %8 to float
%10 = load float, float* %3
%11 = fcmp olt float %9, %10
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fmul float %14, %13
store float %15, float* %6
br label %16
16: ; preds = %12
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %7
19: ; preds = %7
%20 = load float, float* %6
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %20)
%22 = load float, float* %6
ret float %22
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define float @pot(float %0, float %1) {
%3 = fcmp ogt float %0, 0.000000e+00
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi float [ %7, %4 ], [ 1.000000e+00, %2 ]
%6 = phi i32 [ %8, %4 ], [ 0, %2 ]
%7 = fmul float %5, %1
%8 = add nuw nsw i32 %6, 1
%9 = sitofp i32 %8 to float
%10 = fcmp olt float %9, %0
br i1 %10, label %4, label %11
11: ; preds = %4, %2
%12 = phi float [ 1.000000e+00, %2 ], [ %7, %4 ]
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %12)
ret float %12
}
char *date() {
  char *str, *ctime();
  long time(), nseconds;
  nseconds = time((long *)0);
  str = ctime(&nseconds);
  return (str);
}


x86 assembly (clang, -O0):
<date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
mov    $0x0,%al
call   1040 <time@plt>
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <ctime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1040 <time@plt>
mov    %rax,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <ctime@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @date() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i64 (i64*, ...) bitcast (i64 (...)* @time to i64 (i64*, ...)*)(i64* null)
store i64 %3, i64* %2
%4 = call i8* (i64*, ...) bitcast (i8* (...)* @ctime to i8* (i64*, ...)*)(i64* %2)
store i8* %4, i8** %1
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define i8* @date() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i64 (i64*, ...) bitcast (i64 (...)* @time to i64 (i64*, ...)*)(i64* null)
store i64 %3, i64* %1
%4 = call i8* (i64*, ...) bitcast (i8* (...)* @ctime to i8* (i64*, ...)*)(i64* %1)
ret i8* %4
}
void doSleep(int interval) {}


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

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

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

LLVM IR (-O2):
define void @doSleep(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Welcome to Git World"); }


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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Welcome to Git World\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Welcome to Git World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct state {
  int dummy;
};
struct debug_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void cli_unrecognized(struct state *context, struct debug_state *dbg_state,
                      char **args) {
  printf("unrecognized instruction: %s\n", args[0]);
}


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

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

LLVM IR (-O0):
%struct.state = type { i32 }
%struct.debug_state = type { i32 }
@.str = [30 x i8] c"unrecognized instruction: %s\0A\00"
define void @cli_unrecognized(%struct.state* %0, %struct.debug_state* %1, i8** %2) {
%4 = alloca %struct.state*
%5 = alloca %struct.debug_state*
%6 = alloca i8**
store %struct.state* %0, %struct.state** %4
store %struct.debug_state* %1, %struct.debug_state** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
%struct.state = type { i32 }
%struct.debug_state = type { i32 }
@.str = [30 x i8] c"unrecognized instruction: %s\0A\00"
define void @cli_unrecognized(%struct.state* nocapture readnone %0, %struct.debug_state* nocapture readnone %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
double pathconN_nm8_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<pathconN_nm8_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <pathconN_nm8_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <pathconN_nm8_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <pathconN_nm8_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <pathconN_nm8_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm8_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pathconN_nm8_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @pathconN_nm8_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
char tolower(char);
void strtolo(char *s) {
  if (s != 0)
    while (*s) {
      *s = tolower(*s);
      s++;
    }
}


x86 assembly (clang, -O0):
<strtolo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <strtolo+0x53>
jmp    112c <strtolo+0x1c>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115e <strtolo+0x4e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <strtolo+0x1c>
jmp    1163 <strtolo+0x53>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolo>:
push   %rbx
test   %rdi,%rdi
je     1146 <strtolo+0x36>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1146 <strtolo+0x36>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strtolo+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @strtolo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %18
5: ; preds = %1
br label %6
6: ; preds = %10, %5
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = call signext i8 @tolower(i8 signext %12)
%14 = load i8*, i8** %2
store i8 %13, i8* %14
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %2
br label %6
17: ; preds = %6
br label %18
18: ; preds = %17, %1
ret void
}

LLVM IR (-O2):
define void @strtolo(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call signext i8 @tolower(i8 signext %7)
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret void
}
int my_isneg(int n) {
  int r;
  if (n < 0)
    r = 0;
  else
    r = 1;
  return (r);
}


x86 assembly (clang, -O0):
<my_isneg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111d <my_isneg+0x1d>
movl   $0x0,-0x8(%rbp)
jmp    1124 <my_isneg+0x24>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isneg>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @my_isneg(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
/* Type definitions */
struct fwsocket {
  int dummy;
};

/* Variables and functions */
struct fwsocket *_opensocket(int, int, int, char const *, char const *, void *,
                             int /*<<< orphan*/, int /*<<< orphan*/);
extern struct fwsocket *sockconnect(int family, int stype, int proto,
                                    const char *ipaddr, const char *port,
                                    void *ssl) {
  return (_opensocket(family, stype, proto, ipaddr, port, ssl, 0, 0));
}


x86 assembly (clang, -O0):
<sockconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <_opensocket@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockconnect>:
push   %rax
push   $0x0
push   $0x0
call   1030 <_opensocket@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.fwsocket = type { i32 }
define %struct.fwsocket* @sockconnect(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i8*, i8** %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call %struct.fwsocket* @_opensocket(i32 %13, i32 %14, i32 %15, i8* %16, i8* %17, i8* %18, i32 0, i32 0)
ret %struct.fwsocket* %19
}

LLVM IR (-O2):
%struct.fwsocket = type { i32 }
define %struct.fwsocket* @sockconnect(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call %struct.fwsocket* @_opensocket(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5, i32 0, i32 0)
ret %struct.fwsocket* %7
}
/* Variables and functions */
int /*<<< orphan*/ lcd_wr_char(char);
void lcd_string(char *str) {
  while (*str != '\0') {
    lcd_wr_char(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<lcd_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <lcd_string+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <lcd_wr_char@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lcd_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @lcd_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @lcd_wr_char(i8 signext %10)
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @lcd_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @lcd_wr_char(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
size_t j64_eobj_encode(char *buf, size_t len) {
  len = ((len) < (2) ? (len) : (2));
  memcpy(buf, "{}", len);
  return len;
}


x86 assembly (clang, -O0):
<j64_eobj_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x2,-0x10(%rbp)
jae    1138 <j64_eobj_encode+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1146 <j64_eobj_encode+0x36>
mov    $0x2,%eax
mov    %rax,-0x18(%rbp)
jmp    1146 <j64_eobj_encode+0x36>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j64_eobj_encode>:
push   %rbx
cmp    $0x2,%rsi
mov    $0x2,%ebx
cmovb  %rsi,%rbx
lea    0xedb(%rip),%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"{}\00"
define i64 @j64_eobj_encode(i8* %0, i64 %1) {
%3 = icmp ult i64 %1, 2
%4 = select i1 %3, i64 %1, i64 2
%5 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ stderr;
void runtime_error(int line, char *msg) {
  fprintf(stderr, "\nRuntime error at line %d: %s\n", line, msg);
  free(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<runtime_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<runtime_error>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%edx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
mov    %rbx,%rcx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"\0ARuntime error at line %d: %s\0A\00"
define void @runtime_error(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @free(i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"\0ARuntime error at line %d: %s\0A\00"
define void @runtime_error(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%5 = tail call i32 @free(i8* %1)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  time_t t;
  t = time(NULL);
  printf("UNIX Time: %ld\n", t);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"UNIX Time: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"UNIX Time: %ld\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t gffi_get_uint_32_swapped(uint8_t *location, int offset) {
  uint8_t buf[4];
  buf[3] = location[offset];
  buf[2] = location[offset + 1];
  buf[1] = location[offset + 2];
  buf[0] = location[offset + 3];
  return *(uint32_t *)buf;
}


x86 assembly (clang, -O0):
<gffi_get_uint_32_swapped>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gffi_get_uint_32_swapped>:
movslq %esi,%rax
mov    0xc(%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @gffi_get_uint_32_swapped(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [4 x i32]
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
store i32 %10, i32* %11
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %12, i64 %15
%17 = load i32, i32* %16
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
store i32 %17, i32* %18
%19 = load i32*, i32** %3
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %19, i64 %22
%24 = load i32, i32* %23
%25 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
store i32 %24, i32* %25
%26 = load i32*, i32** %3
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %26, i64 %29
%31 = load i32, i32* %30
%32 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 %31, i32* %32
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%34 = load i32, i32* %33
ret i32 %34
}

LLVM IR (-O2):
define i32 @gffi_get_uint_32_swapped(i32* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
__typeof__(isalpha("")) test_isalpha_2(void) { return isalpha(""); }


x86 assembly (clang, -O0):
<test_isalpha_2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rax
mov    %eax,%edi
call   1030 <isalpha@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_isalpha_2() {
%1 = call i32 @isalpha(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_isalpha_2() {
%1 = tail call i32 @isalpha(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_value(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<free_value>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_value(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ fma(double, double, double);
long double fmal(long double x, long double y, long double z) {
  return (long double)fma((double)x, (double)y, (double)z);
}


x86 assembly (clang, -O0):
<fmal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x48(%rbp)
movsd  -0x48(%rbp),%xmm1
fldt   -0x30(%rbp)
fstpl  -0x40(%rbp)
movsd  -0x40(%rbp),%xmm2
call   1030 <fma@plt>
mov    %rax,-0x38(%rbp)
fildll -0x38(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmal>:
sub    $0x28,%rsp
fldt   0x50(%rsp)
fldt   0x40(%rsp)
fldt   0x30(%rsp)
fstpl  0x18(%rsp)
movsd  0x18(%rsp),%xmm0
fstpl  0x10(%rsp)
movsd  0x10(%rsp),%xmm1
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm2
call   1030 <fma@plt>
mov    %rax,0x20(%rsp)
fildll 0x20(%rsp)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @fmal(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80 %2, x86_fp80* %6
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = load x86_fp80, x86_fp80* %5
%10 = fptrunc x86_fp80 %9 to double
%11 = load x86_fp80, x86_fp80* %6
%12 = fptrunc x86_fp80 %11 to double
%13 = call i64 @fma(double %8, double %10, double %12)
%14 = sitofp i64 %13 to x86_fp80
ret x86_fp80 %14
}

LLVM IR (-O2):
define x86_fp80 @fmal(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = fptrunc x86_fp80 %0 to double
%5 = fptrunc x86_fp80 %1 to double
%6 = fptrunc x86_fp80 %2 to double
%7 = tail call i64 @fma(double %4, double %5, double %6)
%8 = sitofp i64 %7 to x86_fp80
ret x86_fp80 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void braf_displayError(const char *msg) { printf("braf: error: %s\n", msg); }


x86 assembly (clang, -O0):
<braf_displayError>:
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):
<braf_displayError>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"braf: error: %s\0A\00"
define void @braf_displayError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int main(void) {
  struct S {
    char w[8];
  } p[4] = {"abcdefg", "ABCDEFG", "zyxwvut", "ZYXWVUT"};
  foo(p, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.S = type { [8 x i8] }
@__const.main.p = [4 x %struct.S] [%struct.S { [8 x i8] c"abcdefg\00" }, %struct.S { [8 x i8] c"ABCDEFG\00" }, %struct.S { [8 x i8] c"zyxwvut\00" }, %struct.S { [8 x i8] c"ZYXWVUT\00" }]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x %struct.S]
store i32 0, i32* %1
%3 = bitcast [4 x %struct.S]* %2 to i8*
%4 = getelementptr inbounds [4 x %struct.S], [4 x %struct.S]* %2, i64 0, i64 0
%5 = call i32 (%struct.S*, i32, ...) bitcast (i32 (...)* @foo to i32 (%struct.S*, i32, ...)*)(%struct.S* %4, i32 8)
ret i32 0
}

LLVM IR (-O2):
%struct.S = type { [8 x i8] }
@__const.main.p = [4 x %struct.S] [%struct.S { [8 x i8] c"abcdefg\00" }, %struct.S { [8 x i8] c"ABCDEFG\00" }, %struct.S { [8 x i8] c"zyxwvut\00" }, %struct.S { [8 x i8] c"ZYXWVUT\00" }]
define i32 @main() {
%1 = alloca [4 x %struct.S]
%2 = getelementptr inbounds [4 x %struct.S], [4 x %struct.S]* %1, i64 0, i64 0, i32 0, i64 0
%3 = getelementptr inbounds [4 x %struct.S], [4 x %struct.S]* %1, i64 0, i64 0
%4 = call i32 (%struct.S*, i32, ...) bitcast (i32 (...)* @foo to i32 (%struct.S*, i32, ...)*)(%struct.S* %3, i32 8)
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int string_compare(void *a, void *b) {
  return (strcmp((char *)a, (char *)b) == 0);
}


x86 assembly (clang, -O0):
<string_compare>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_compare>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_compare(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @string_compare(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int socket(int, int, int);
int Socket(int domain, int type, int protocol) {
  int sockfd = socket(domain, type, protocol);
  if (sockfd == -1) {
    perror("socket() error");
  }
  return sockfd;
}


x86 assembly (clang, -O0):
<Socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1158 <Socket+0x38>
lea    0xead(%rip),%rdi
call   1030 <perror@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Socket>:
push   %rbx
call   1040 <socket@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1131 <Socket+0x11>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec8(%rip),%rdi
call   1030 <perror@plt>
jmp    112d <Socket+0xd>

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

LLVM IR (-O2):
@.str = [15 x i8] c"socket() error\00"
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
unsigned long *lvector(long nl, long nh) {
  unsigned long *v;
  v = (unsigned long *)malloc(
      (size_t)((nh - nl + 1 + 1) * sizeof(unsigned long)));
  if (!v)
    nrerror("allocation failure in lvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<lvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <lvector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <lvector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i64*
store i64* %13, i64** %5
%14 = load i64*, i64** %5
%15 = icmp ne i64* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load i64*, i64** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i64, i64* %19, i64 %21
%23 = getelementptr inbounds i64, i64* %22, i64 1
ret i64* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i64* @lvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to i64*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i64, i64* %11, i64 %12
%14 = getelementptr inbounds i64, i64* %13, i64 1
ret i64* %14
}
void zzTraceGuessFail(void) {}


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

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

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

LLVM IR (-O2):
define void @zzTraceGuessFail() {
ret void
}
char *langRomTypeVmx80() { return "Microsol VMX-80"; }


x86 assembly (clang, -O0):
<langRomTypeVmx80>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langRomTypeVmx80>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Microsol VMX-80\00"
define i8* @langRomTypeVmx80() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"Microsol VMX-80\00"
define i8* @langRomTypeVmx80() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
long hash(char *word) {
  int result;
  static int counter = 0;
  counter++;
  result = *word * counter;
  return result;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2f16(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0d(%rip)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   0x2eff(%rip),%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
movslq 0x2f1d(%rip),%rcx
add    $0x1,%rcx
mov    %ecx,0x2f13(%rip)
movsbq (%rdi),%rax
imul   %rcx,%rax
ret

LLVM IR (-O0):
@hash.counter = internal global i32 0
define i64 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @hash.counter
%5 = add nsw i32 %4, 1
store i32 %5, i32* @hash.counter
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i32, i32* @hash.counter
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
@hash.counter = internal unnamed_addr global i32 0
define i64 @hash(i8* nocapture %0) {
%2 = load i32, i32* @hash.counter
%3 = add nsw i32 %2, 1
store i32 %3, i32* @hash.counter
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
%6 = mul nsw i32 %3, %5
%7 = sext i32 %6 to i64
ret i64 %7
}
int test_imm_14uint8_reg(unsigned char val) {
  return ((val) & (-0x14 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_14uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffec,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_14uint8_reg>:
test   $0xec,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_14uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -20
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void main() {
  int *ptr;
  *ptr = 0;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @main() {
%1 = alloca i32*
%2 = load i32*, i32** %1
store i32 0, i32* %2
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ dropuidgid(int /*<<< orphan*/, int, int);
scalar_t__ geteuid();
void droproot(void) {
  if (geteuid() == 0) {
    if (!dropuidgid(0, 1230, 1230))
      _exit(111);
  }
  if (geteuid() == 0)
    _exit(111);
}


x86 assembly (clang, -O0):
<droproot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <geteuid@plt>
cmp    $0x0,%rax
jne    116b <droproot+0x3b>
xor    %edi,%edi
mov    $0x4ce,%edx
mov    %edx,%esi
call   1050 <dropuidgid@plt>
cmp    $0x0,%eax
jne    1166 <droproot+0x36>
mov    $0x6f,%edi
call   1030 <_exit@plt>
jmp    116b <droproot+0x3b>
mov    $0x0,%al
call   1040 <geteuid@plt>
cmp    $0x0,%rax
jne    1186 <droproot+0x56>
mov    $0x6f,%edi
call   1030 <_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<droproot>:
push   %rax
xor    %eax,%eax
call   1040 <geteuid@plt>
test   %rax,%rax
jne    1152 <droproot+0x22>
xor    %edi,%edi
mov    $0x4ce,%esi
mov    $0x4ce,%edx
call   1050 <dropuidgid@plt>
test   %eax,%eax
je     1160 <droproot+0x30>
xor    %eax,%eax
call   1040 <geteuid@plt>
test   %rax,%rax
je     1160 <droproot+0x30>
pop    %rax
ret
mov    $0x6f,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @droproot() {
%1 = call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i32 @dropuidgid(i32 0, i32 1230, i32 1230)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = call i32 @_exit(i32 111)
unreachable
8: ; preds = %3
br label %9
9: ; preds = %8, %0
%10 = call i64 (...) @geteuid()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @_exit(i32 111)
unreachable
14: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @droproot() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 @dropuidgid(i32 0, i32 1230, i32 1230)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @_exit(i32 111)
unreachable
8: ; preds = %3, %0
%9 = tail call i64 (...) @geteuid()
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @_exit(i32 111)
unreachable
13: ; preds = %8
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double Sfile_microtime(int flag) {
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  return ((double)(tv.tv_sec + 1.0e-6 * tv.tv_usec));
}


x86 assembly (clang, -O0):
<Sfile_microtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xec5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sfile_microtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
%struct.timezone = type { i32 }
define double @Sfile_microtime(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
%4 = alloca %struct.timezone
store i32 %0, i32* %2
%5 = call i32 @gettimeofday(%struct.timeval* %3, %struct.timezone* %4)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%10 = load double, double* %9
%11 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %10, double %8)
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
%struct.timezone = type { i32 }
define double @Sfile_microtime(i32 %0) {
%2 = alloca %struct.timeval
%3 = alloca %struct.timezone
%4 = bitcast %struct.timeval* %2 to i8*
%5 = bitcast %struct.timezone* %3 to i8*
%6 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %3)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%11 = load double, double* %10
%12 = tail call double @llvm.fmuladd.f64(double %11, double 0x3EB0C6F7A0B5ED8D, double %9)
ret double %12
}
void main() {
  int a = 125;
  int *p = &a;
  test(p != *p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7d,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <test@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 125, i32* %1
store i32* %1, i32** %2
%3 = load i32*, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = icmp ne i32* %3, %7
%9 = zext i1 %8 to i32
%10 = call i32 (i32, ...) bitcast (i32 (...)* @test to i32 (i32, ...)*)(i32 %9)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @test to i32 (i32, ...)*)(i32 1)
ret void
}
/* Variables and functions */
int rom_present(char *);
int s3_9fx_available() { return rom_present("s3_764.bin"); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"s3_764.bin\00"
define i32 @s3_9fx_available() {
%1 = tail call i32 @rom_present(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void g1() {
#define X 1
  int resync_parser_3;
}


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

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

LLVM IR (-O0):
define void @g1() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @g1() {
ret void
}
void use_buf_malloc(int *buf, int len) {
  for (int i = 0; i < len; i++)
    buf[i] = 0;
}


x86 assembly (clang, -O0):
<use_buf_malloc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <use_buf_malloc+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <use_buf_malloc+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_buf_malloc>:
test   %esi,%esi
jle    1126 <use_buf_malloc+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @use_buf_malloc(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
int test_imm_53int8_mem(signed char *val) {
  return ((*val) & (0x53 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_53int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x53,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_53int8_mem>:
testb  $0x53,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_53int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 83
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(unsigned char);
void print_err_char(unsigned char byte) { __console_tx_char(byte); }


x86 assembly (clang, -O0):
<print_err_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_err_char>:
jmp    1030 <__console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_err_char(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_char(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_53(int /*<<< orphan*/);
int gen_53(void) {
  handle_53(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_53>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_53@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_53() {
%1 = call i32 @handle_53(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_53() {
%1 = tail call i32 @handle_53(i32 0)
ret i32 0
}