xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf(" __VMS_VERSION: (undefined)<.\n");
  printf(" __VMS_VER  = (undefined).\n");
  printf(" __DECC_VER = (undefined).\n");
  printf(" __CRTL_VER = (undefined).\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c" __VMS_VERSION: (undefined)<.\0A\00"
@.str.1 = [28 x i8] c" __VMS_VER = (undefined).\0A\00"
@.str.2 = [28 x i8] c" __DECC_VER = (undefined).\0A\00"
@.str.3 = [28 x i8] c" __CRTL_VER = (undefined).\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c" __VMS_VERSION: (undefined)<.\00"
@str.4 = [27 x i8] c" __VMS_VER = (undefined).\00"
@str.5 = [27 x i8] c" __DECC_VER = (undefined).\00"
@str.6 = [27 x i8] c" __CRTL_VER = (undefined).\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ snprintf(int /*<<< orphan*/ *, int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *xmalloc(scalar_t__);
char *parse_opera(char *token) {
  char *val = xmalloc(snprintf(NULL, 0, "Opera%s", token) + 1);
  sprintf(val, "Opera%s", token);
  return val;
}


x86 assembly (clang, -O0):
<parse_opera>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe8f(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_opera>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xec1(%rip),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <snprintf@plt>
lea    0x1(%rax),%rdi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Opera%s\00"
define i8* @parse_opera(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [8 x i8] c"Opera%s\00"
define i8* @parse_opera(i8* %0) {
%2 = tail call i64 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ General_Timer_Init();
void ESP8266_Timer_Init(void) { General_Timer_Init(); }


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

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

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

LLVM IR (-O2):
define void @ESP8266_Timer_Init() {
%1 = tail call i32 (...) @General_Timer_Init()
ret void
}
/* Variables and functions */
long long plus(long long, long long);
int /*<<< orphan*/ printf(char *, long long);
int main(void) {
  long long int a = 5;
  long long int b = 4;
  long long int x = plus(a, b);
  while (x > 43)
    x--;
  printf("La somme vaut %li\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x5,-0x10(%rbp)
movq   $0x4,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <plus@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x2b,-0x20(%rbp)
jle    116c <main+0x4c>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1150 <main+0x30>
mov    -0x20(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x4,%esi
call   1030 <plus@plt>
cmp    $0x2b,%rax
mov    $0x2b,%esi
cmovl  %rax,%rsi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"La somme vaut %li\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
store i64 5, i64* %2
store i64 4, i64* %3
%5 = load i64, i64* %2
%6 = load i64, i64* %3
%7 = call i64 @plus(i64 %5, i64 %6)
store i64 %7, i64* %4
br label %8
8: ; preds = %11, %0
%9 = load i64, i64* %4
%10 = icmp sgt i64 %9, 43
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i64, i64* %4
%13 = add nsw i64 %12, -1
store i64 %13, i64* %4
br label %8
14: ; preds = %8
%15 = load i64, i64* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"La somme vaut %li\0A\00"
define i32 @main() {
%1 = tail call i64 @plus(i64 5, i64 4)
%2 = call i64 @llvm.smin.i64(i64 %1, i64 43)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}
void X509_issuer_name_cmp(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_issuer_name_cmp() {
ret void
}
void putrgb(char *buf, long stride, long x, long y, long r, long g, long b) {
  long i = 3 * (x + (y * stride));
  buf[i] = r;
  buf[i + 1] = g;
  buf[i + 2] = b;
}


x86 assembly (clang, -O0):
<putrgb>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x10(%rbp),%rcx
add    %rcx,%rax
imul   $0x3,%rax,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x30(%rbp),%rax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %dl,0x1(%rax,%rcx,1)
mov    0x10(%rbp),%rax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %dl,0x2(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putrgb>:
mov    0x8(%rsp),%al
imul   %rcx,%rsi
add    %rdx,%rsi
lea    (%rsi,%rsi,2),%rcx
mov    %r8b,(%rdi,%rcx,1)
mov    %r9b,0x1(%rdi,%rcx,1)
mov    %al,0x2(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @putrgb(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
store i8* %0, i8** %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%16 = load i64, i64* %10
%17 = load i64, i64* %11
%18 = load i64, i64* %9
%19 = mul nsw i64 %17, %18
%20 = add nsw i64 %16, %19
%21 = mul nsw i64 3, %20
store i64 %21, i64* %15
%22 = load i64, i64* %12
%23 = trunc i64 %22 to i8
%24 = load i8*, i8** %8
%25 = load i64, i64* %15
%26 = getelementptr inbounds i8, i8* %24, i64 %25
store i8 %23, i8* %26
%27 = load i64, i64* %13
%28 = trunc i64 %27 to i8
%29 = load i8*, i8** %8
%30 = load i64, i64* %15
%31 = add nsw i64 %30, 1
%32 = getelementptr inbounds i8, i8* %29, i64 %31
store i8 %28, i8* %32
%33 = load i64, i64* %14
%34 = trunc i64 %33 to i8
%35 = load i8*, i8** %8
%36 = load i64, i64* %15
%37 = add nsw i64 %36, 2
%38 = getelementptr inbounds i8, i8* %35, i64 %37
store i8 %34, i8* %38
ret void
}

LLVM IR (-O2):
define void @putrgb(i8* nocapture writeonly %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = mul nsw i64 %3, %1
%9 = add nsw i64 %8, %2
%10 = mul nsw i64 %9, 3
%11 = trunc i64 %4 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %11, i8* %12
%13 = trunc i64 %5 to i8
%14 = add nsw i64 %10, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 %13, i8* %15
%16 = trunc i64 %6 to i8
%17 = add nsw i64 %10, 2
%18 = getelementptr inbounds i8, i8* %0, i64 %17
store i8 %16, i8* %18
ret void
}
int colliding_name(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @colliding_name() {
ret i32 1
}

LLVM IR (-O2):
define i32 @colliding_name() {
ret i32 1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ check();
int main() {
  check();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @check()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ vecNd_copy(double *, double const *, int);
void vec4d_copy(double result[4], const double a[4]) {
  vecNd_copy(result, a, 4);
}


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

x86 assembly (clang, -O2):
<vec4d_copy>:
mov    $0x4,%edx
jmp    1030 <vecNd_copy@plt>

LLVM IR (-O0):
define void @vec4d_copy(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 = call i32 @vecNd_copy(double* %5, double* %6, i32 4)
ret void
}

LLVM IR (-O2):
define void @vec4d_copy(double* %0, double* %1) {
%3 = tail call i32 @vecNd_copy(double* %0, double* %1, i32 4)
ret void
}
/* Variables and functions */
double pow(double, double);
double SDL_pow(double x, double y) { return pow(x, y); }


x86 assembly (clang, -O0):
<SDL_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_pow>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @SDL_pow(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 = call double @pow(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @SDL_pow(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
unsigned short SSWAPIL(unsigned short a) { return ((a >> 8) + (a << 8)); }


x86 assembly (clang, -O0):
<SSWAPIL>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSWAPIL>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @SSWAPIL(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = add nsw i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @SSWAPIL(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr1setBank3(int);
void m32setParamsBXX3(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank3(val << 10);
}


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

x86 assembly (clang, -O2):
<m32setParamsBXX3>:
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank3@plt>

LLVM IR (-O0):
define void @m32setParamsBXX3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %6, 10
%8 = call i32 @chr1setBank3(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m32setParamsBXX3(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank3(i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
int *ivector(long nl, long nh) {
  int *v;
  v = (int *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(int)));
  if (!v)
    nrerror("allocation failure in dvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<ivector>:
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    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <ivector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define i32* @ivector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
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, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %5
%14 = load i32*, i32** %5
%15 = icmp ne i32* %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 i32*, i32** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = getelementptr inbounds i32, i32* %22, i64 1
ret i32* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define i32* @ivector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 8
%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 i32*
%12 = sub i64 0, %0
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = getelementptr inbounds i32, i32* %13, i64 1
ret i32* %14
}
/* Variables and functions */
scalar_t__ malloc(int);
int *malloc_no_check_bad() {
  int *p = (int *)malloc(sizeof(int));
  *p = 42;
  return p;
}


x86 assembly (clang, -O0):
<malloc_no_check_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_no_check_bad>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0x2a,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i32* @malloc_no_check_bad() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
store i32 42, i32* %4
%5 = load i32*, i32** %1
ret i32* %5
}

LLVM IR (-O2):
define i32* @malloc_no_check_bad() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 42, i32* %2
ret i32* %2
}
int au_br_cmoo(int brperm) {
  return brperm & (((1 << 3) | (1 << 4)) | (1 << 9));
}


x86 assembly (clang, -O0):
<au_br_cmoo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x218,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<au_br_cmoo>:
mov    %edi,%eax
and    $0x218,%eax
ret

LLVM IR (-O0):
define i32 @au_br_cmoo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 536
ret i32 %4
}

LLVM IR (-O2):
define i32 @au_br_cmoo(i32 %0) {
%2 = and i32 %0, 536
ret i32 %2
}
double parabola(double x, double *coeffs) {
  return (coeffs[0] * x + coeffs[1]) * x + coeffs[2];
}


x86 assembly (clang, -O0):
<parabola>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x8(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<parabola>:
movsd  (%rdi),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rdi),%xmm1
mulsd  %xmm1,%xmm0
addsd  0x10(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @parabola(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double, double* %3
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
%13 = load double, double* %3
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 2
%16 = load double, double* %15
%17 = call double @llvm.fmuladd.f64(double %12, double %13, double %16)
ret double %17
}

LLVM IR (-O2):
define double @parabola(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %5)
%7 = getelementptr inbounds double, double* %1, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %6, double %0, double %8)
ret double %9
}
void ASN1_STRING_get_default_mask(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_STRING_get_default_mask() {
ret void
}
int cmd_help(int argc, char **argv) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cmd_help(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int is_modifier(unsigned char b) {
  b &= ~0x80;
  return b == 0x38 || b == 0x1d || b == 0x2a;
}


x86 assembly (clang, -O0):
<is_modifier>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xffffff7f,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x38,%ecx
mov    %al,-0x2(%rbp)
je     1147 <is_modifier+0x47>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x1d,%ecx
mov    %al,-0x2(%rbp)
je     1147 <is_modifier+0x47>
movzbl -0x1(%rbp),%eax
cmp    $0x2a,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_modifier>:
mov    $0x1,%eax
cmp    $0x1c,%dil
jg     1118 <is_modifier+0x18>
cmp    $0x9d,%dil
je     1117 <is_modifier+0x17>
cmp    $0xb8,%dil
jne    1124 <is_modifier+0x24>
ret
cmp    $0x1d,%dil
je     1117 <is_modifier+0x17>
cmp    $0x38,%dil
je     1117 <is_modifier+0x17>
and    $0x7f,%dil
xor    %eax,%eax
cmp    $0x2a,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_modifier(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, -129
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 56
br i1 %9, label %18, label %10
10: ; preds = %1
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 29
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 42
br label %18
18: ; preds = %14, %10, %1
%19 = phi i1 [ true, %10 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_modifier(i8 zeroext %0) {
switch i8 %0, label %2 [
i8 -72, label %6
i8 -99, label %6
i8 56, label %6
i8 29, label %6
]
2: ; preds = %1
%3 = and i8 %0, 127
%4 = icmp eq i8 %3, 42
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %1, %1, %2
%7 = phi i32 [ 1, %1 ], [ %5, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ glVertex2f(float const, float const);
void lineto(const float x, const float y) { glVertex2f(x, y); }


x86 assembly (clang, -O0):
<lineto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <glVertex2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineto>:
jmp    1030 <glVertex2f@plt>

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

LLVM IR (-O2):
define void @lineto(float %0, float %1) {
%3 = tail call i32 @glVertex2f(float %0, float %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void mbed_trace_realloc(char **buffer, int *length_ptr, int new_length) {
  free(*buffer);
  *buffer = malloc(new_length);
  *length_ptr = new_length;
}


x86 assembly (clang, -O0):
<mbed_trace_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbed_trace_realloc>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
mov    %ebp,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @mbed_trace_realloc(i8** %0, i32* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32
store i8** %0, i8*** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = call i32 @free(i8* %8)
%10 = load i32, i32* %6
%11 = call i8* @malloc(i32 %10)
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
%13 = load i32, i32* %6
%14 = load i32*, i32** %5
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @mbed_trace_realloc(i8** nocapture %0, i32* nocapture writeonly %1, i32 %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @free(i8* %4)
%6 = tail call i8* @malloc(i32 %2)
store i8* %6, i8** %0
store i32 %2, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __softboundmpx_read_shadow_stack_metadata_store(char **,
                                                                   int);
unsigned long strtoul(char const *, char **, int);
__attribute__((__weak__, __always___)) unsigned long int
softboundmpx_strtoul(const char *nptr, char **endptr, int base) {
  unsigned long temp = strtoul(nptr, endptr, base);
  if (endptr != NULL) {
    __softboundmpx_read_shadow_stack_metadata_store(endptr, 1);
  }
  return temp;
}


x86 assembly (clang, -O0):
<softboundmpx_strtoul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtoul@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1160 <softboundmpx_strtoul+0x40>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <__softboundmpx_read_shadow_stack_metadata_store@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_strtoul>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <strtoul@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1141 <softboundmpx_strtoul+0x21>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <__softboundmpx_read_shadow_stack_metadata_store@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define weak i64 @softboundmpx_strtoul(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @strtoul(i8* %0, i8** %1, i32 %2)
%5 = icmp eq i8** %1, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @__softboundmpx_read_shadow_stack_metadata_store(i8** %1, i32 1)
br label %8
8: ; preds = %6, %3
ret i64 %4
}
exists(fname) char *fname;
{
  int fd;
  fd = open(fname, 0);
  if (fd < 0)
    return 0;
  (void)close(fd);
  return 1;
}


x86 assembly (clang, -O0):
<exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1152 <exists+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1163 <exists+0x43>
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1030 <close@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists>:
push   %rbx
xor    %ebx,%ebx
xor    %esi,%esi
xor    %eax,%eax
call   1040 <open@plt>
test   %eax,%eax
js     113e <exists+0x1e>
mov    %eax,%edi
xor    %eax,%eax
call   1030 <close@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @open to i32 (i8*, i32, ...)*)(i8* %5, i32 0)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %13
10: ; preds = %1
%11 = load i32, i32* %4
%12 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %11)
store i32 1, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @exists(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @open to i32 (i8*, i32, ...)*)(i8* %0, i32 0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
void sendMessage() {}


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

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

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

LLVM IR (-O2):
define void @sendMessage() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned char, unsigned char,
                          unsigned char, unsigned char);
void shwsd(unsigned int cseed, unsigned char *sd) {
  unsigned char *p;
  p = (unsigned char *)sd;
  printf("%08x %02x %02x %02x %02x  "
         "little endian\n",
         cseed, *p, *(p + 1), *(p + 2), *(p + 3));
}


x86 assembly (clang, -O0):
<shwsd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%dl
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%r8b
mov    -0x18(%rbp),%rax
lea    0xeb6(%rip),%rdi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl 0x3(%rax),%r9d
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shwsd>:
mov    %edi,%eax
movzbl (%rsi),%edx
movzbl 0x1(%rsi),%ecx
movzbl 0x2(%rsi),%r8d
movzbl 0x3(%rsi),%r9d
lea    0xed6(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"%08x %02x %02x %02x %02x little endian\0A\00"
define void @shwsd(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
%7 = load i32, i32* %3
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 3
%18 = load i8, i8* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %7, i8 zeroext %9, i8 zeroext %12, i8 zeroext %15, i8 zeroext %18)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"%08x %02x %02x %02x %02x little endian\0A\00"
define void @shwsd(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = getelementptr inbounds i8, i8* %1, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %1, i64 2
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %1, i64 3
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0, i8 zeroext %3, i8 zeroext %5, i8 zeroext %7, i8 zeroext %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void print(int *arr) {
  printf("%d %d %d %d %d\n", *arr, *(arr + 1), *(arr + 2), *(arr + 3),
         *(arr + 4));
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%r9d
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    (%rdi),%esi
mov    0x4(%rdi),%edx
mov    0x8(%rdi),%ecx
mov    0xc(%rdi),%r8d
mov    0x10(%rdi),%r9d
lea    0xed9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%d %d %d %d %d\0A\00"
define void @print(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32, i32* %12
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 4
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %10, i32 %13, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%d %d %d %d %d\0A\00"
define void @print(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %0, i64 4
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %6, i32 %8, i32 %10)
ret void
}
/* Variables and functions */
scalar_t__ IsDecimal(char *);
scalar_t__ IsHex(char *);
int IsNumber(char *buf) { return (IsHex(buf) || IsDecimal(buf)); }


x86 assembly (clang, -O0):
<IsNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <IsHex@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115a <IsNumber+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <IsDecimal@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsNumber>:
push   %rbx
mov    %rdi,%rbx
call   1030 <IsHex@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <IsNumber+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <IsDecimal@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @IsNumber(i8* %0) {
%2 = tail call i64 @IsHex(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @IsDecimal(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME_ENTRY;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_dup(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_NAME_ENTRY_it;
X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *x) {
  return ASN1_item_dup(&X509_NAME_ENTRY_it, x);
}


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

x86 assembly (clang, -O2):
<X509_NAME_ENTRY_dup>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rdi
jmp    1030 <ASN1_item_dup@plt>

LLVM IR (-O0):
@X509_NAME_ENTRY_it = global i32 0
define i32* @X509_NAME_ENTRY_dup(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32* @ASN1_item_dup(i32* @X509_NAME_ENTRY_it, i32* %3)
ret i32* %4
}

LLVM IR (-O2):
@X509_NAME_ENTRY_it = global i32 0
define i32* @X509_NAME_ENTRY_dup(i32* %0) {
%2 = tail call i32* @ASN1_item_dup(i32* @X509_NAME_ENTRY_it, i32* %0)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ parse_rebind(char *);
void cmd_rebind(char *arg) { parse_rebind(arg); }


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

x86 assembly (clang, -O2):
<cmd_rebind>:
jmp    1030 <parse_rebind@plt>

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

LLVM IR (-O2):
define void @cmd_rebind(i8* %0) {
%2 = tail call i32 @parse_rebind(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ timeShift();
void threeTS(void) {
  {
    {
      timeShift();
      timeShift();
      timeShift();
    }
    return;
  }
}


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

x86 assembly (clang, -O2):
<threeTS>:
push   %rax
xor    %eax,%eax
call   1030 <timeShift@plt>
xor    %eax,%eax
call   1030 <timeShift@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <timeShift@plt>

LLVM IR (-O0):
define void @threeTS() {
%1 = call i32 (...) @timeShift()
%2 = call i32 (...) @timeShift()
%3 = call i32 (...) @timeShift()
ret void
}

LLVM IR (-O2):
define void @threeTS() {
%1 = tail call i32 (...) @timeShift()
%2 = tail call i32 (...) @timeShift()
%3 = tail call i32 (...) @timeShift()
ret void
}
void timer_run() {
  ((*((volatile unsigned char *)(0xFFD80004))) =
       ((unsigned int)(*((volatile unsigned char *)(0xFFD80004))) | (1 << 2)));
}


x86 assembly (clang, -O0):
<timer_run>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffd80004,%eax
mov    (%rax),%al
movzbl %al,%eax
or     $0x4,%eax
mov    %al,%cl
mov    $0xffd80004,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_run>:
mov    $0xffd80004,%eax
orb    $0x4,(%rax)
ret

LLVM IR (-O0):
define void @timer_run() {
%1 = load volatile i8, i8* inttoptr (i64 4292345860 to i8*)
%2 = zext i8 %1 to i32
%3 = or i32 %2, 4
%4 = trunc i32 %3 to i8
store volatile i8 %4, i8* inttoptr (i64 4292345860 to i8*)
ret void
}

LLVM IR (-O2):
define void @timer_run() {
%1 = load volatile i8, i8* inttoptr (i64 4292345860 to i8*)
%2 = or i8 %1, 4
store volatile i8 %2, i8* inttoptr (i64 4292345860 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RegReadA(int, unsigned char *);
unsigned char CmdRdChk(void) {
  unsigned char UcTestRD;
  unsigned char UcCount;
  for (UcCount = 0; UcCount < 3; UcCount++) {
    RegReadA(0x027F, &UcTestRD);
    if (UcTestRD == 0xAC) {
      return (0);
    }
  }
  return (1);
}


x86 assembly (clang, -O0):
<CmdRdChk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x3,%eax
jge    1161 <CmdRdChk+0x51>
mov    $0x27f,%edi
lea    -0x2(%rbp),%rsi
call   1030 <RegReadA@plt>
movzbl -0x2(%rbp),%eax
cmp    $0xac,%eax
jne    114f <CmdRdChk+0x3f>
movb   $0x0,-0x1(%rbp)
jmp    1165 <CmdRdChk+0x55>
jmp    1154 <CmdRdChk+0x44>
mov    -0x3(%rbp),%al
add    $0x1,%al
mov    %al,-0x3(%rbp)
jmp    111c <CmdRdChk+0xc>
movb   $0x1,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdRdChk>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x27f,%edi
call   1030 <RegReadA@plt>
cmpb   $0xac,0x7(%rsp)
je     113d <CmdRdChk+0x2d>
lea    0x7(%rsp),%rsi
mov    $0x27f,%edi
call   1030 <RegReadA@plt>
cmpb   $0xac,0x7(%rsp)
jne    1141 <CmdRdChk+0x31>
xor    %eax,%eax
pop    %rcx
ret
lea    0x7(%rsp),%rsi
mov    $0x27f,%edi
call   1030 <RegReadA@plt>
cmpb   $0xac,0x7(%rsp)
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define zeroext i8 @CmdRdChk() {
%1 = alloca i8
%2 = call i32 @RegReadA(i32 639, i8* %1)
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, -84
br i1 %4, label %14, label %5
5: ; preds = %0
%6 = call i32 @RegReadA(i32 639, i8* %1)
%7 = load i8, i8* %1
%8 = icmp eq i8 %7, -84
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = call i32 @RegReadA(i32 639, i8* %1)
%11 = load i8, i8* %1
%12 = icmp ne i8 %11, -84
%13 = zext i1 %12 to i8
br label %14
14: ; preds = %9, %5, %0
%15 = phi i8 [ 0, %0 ], [ 0, %5 ], [ %13, %9 ]
ret i8 %15
}
int voltDataProcess(long *buffer, int current, unsigned char *voltCPU,
                    unsigned char *voltMotor) {
  int counter = current;
  *voltCPU = (unsigned char)buffer[counter++];
  *voltMotor = (unsigned char)buffer[counter++];
  return (counter);
}


x86 assembly (clang, -O0):
<voltDataProcess>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x24(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x24(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<voltDataProcess>:
movslq %esi,%rsi
mov    (%rdi,%rsi,8),%al
mov    %al,(%rdx)
lea    0x2(%rsi),%eax
mov    0x8(%rdi,%rsi,8),%dl
mov    %dl,(%rcx)
ret

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

LLVM IR (-O2):
define i32 @voltDataProcess(i64* nocapture %0, i32 %1, i8* nocapture writeonly %2, i8* nocapture writeonly %3) {
%5 = add nsw i32 %1, 1
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i8
store i8 %9, i8* %2
%10 = add nsw i32 %1, 2
%11 = sext i32 %5 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 %11
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i8
store i8 %14, i8* %3
ret i32 %10
}
/* Variables and functions */
int biscSendByte(int);
int biscWaitTime(int mseconds) {
  if (mseconds <= 0)
    return -1;
  if (biscSendByte(155) == -1)
    return -1;
  if (biscSendByte(mseconds / 100) == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<biscWaitTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <biscWaitTime+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <biscWaitTime+0x6e>
mov    $0x9b,%edi
call   1030 <biscSendByte@plt>
cmp    $0xffffffff,%eax
jne    1150 <biscWaitTime+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <biscWaitTime+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <biscSendByte@plt>
cmp    $0xffffffff,%eax
jne    1177 <biscWaitTime+0x67>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <biscWaitTime+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<biscWaitTime>:
push   %rbp
push   %rbx
push   %rax
mov    $0xffffffff,%ebx
test   %edi,%edi
jle    1149 <biscWaitTime+0x39>
mov    %edi,%ebp
mov    $0x9b,%edi
call   1030 <biscSendByte@plt>
cmp    $0xffffffff,%eax
je     1149 <biscWaitTime+0x39>
mov    %ebp,%eax
imul   $0x51eb851f,%rax,%rdi
shr    $0x25,%rdi
call   1030 <biscSendByte@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
sete   %bl
neg    %ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @biscWaitTime(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @biscSendByte(i32 155)
%5 = icmp eq i32 %4, -1
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = udiv i32 %0, 100
%8 = tail call i32 @biscSendByte(i32 %7)
%9 = icmp eq i32 %8, -1
%10 = sext i1 %9 to i32
br label %11
11: ; preds = %6, %3, %1
%12 = phi i32 [ -1, %1 ], [ -1, %3 ], [ %10, %6 ]
ret i32 %12
}
void marker_update_probe_range(struct marker *begin, struct marker *end) {}


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

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

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

LLVM IR (-O2):
%struct.marker = type opaque
define void @marker_update_probe_range(%struct.marker* nocapture %0, %struct.marker* nocapture %1) {
ret void
}