xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ g_free(char *);
char *g_strdup(char const *);
int set_string(char **in_str, const char *in) {
  if (in_str == 0) {
    return 0;
  }
  g_free(*in_str);
  *in_str = g_strdup(in);
  return 0;
}


x86 assembly (clang, -O0):
<set_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1147 <set_string+0x27>
movl   $0x0,-0x4(%rbp)
jmp    116d <set_string+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <g_free@plt>
mov    -0x18(%rbp),%rdi
call   1040 <g_strdup@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_string>:
test   %rdi,%rdi
je     1149 <set_string+0x29>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <g_free@plt>
mov    %r14,%rdi
call   1040 <g_strdup@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @set_string(i8** %0, i8* %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8*, i8** %0
%6 = tail call i32 @g_free(i8* %5)
%7 = tail call i8* @g_strdup(i8* %1)
store i8* %7, i8** %0
br label %8
8: ; preds = %2, %4
ret i32 0
}
int Total(const char *context) { return 22; }


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

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

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

LLVM IR (-O2):
define i32 @Total(i8* nocapture readnone %0) {
ret i32 22
}
/* Variables and functions */
bool path_is_absolute(const char *p) { return p[0] == '/'; }


x86 assembly (clang, -O0):
<path_is_absolute>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_is_absolute>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @path_is_absolute(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @path_is_absolute(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int f148(int *);
int f149(int *p) { return f148(p); }


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

x86 assembly (clang, -O2):
<f149>:
jmp    1030 <f148@plt>

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

LLVM IR (-O2):
define i32 @f149(i32* %0) {
%2 = tail call i32 @f148(i32* %0)
ret i32 %2
}
double fabs(arg)
double arg;
{ return (arg < 0 ? -arg : arg); }


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <fabs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <fabs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @fabs(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 %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
int input_char(int flag, unsigned char *out, const unsigned char **in,
               const unsigned char *end) {
  if (!flag)
    *out = 0;
  else if (end == *in)
    return 0;
  else
    *out = *(*in)++;
  return 1;
}


x86 assembly (clang, -O0):
<input_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1129 <input_char+0x29>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    1164 <input_char+0x64>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jne    1146 <input_char+0x46>
movl   $0x0,-0x4(%rbp)
jmp    116b <input_char+0x6b>
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    1164 <input_char+0x64>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_char>:
xor    %eax,%eax
test   %edi,%edi
je     1117 <input_char+0x17>
mov    (%rdx),%rdi
cmp    %rcx,%rdi
je     111e <input_char+0x1e>
lea    0x1(%rdi),%rax
mov    %rax,(%rdx)
mov    (%rdi),%al
mov    %al,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @input_char(i32 %0, i8* nocapture writeonly %1, i8** nocapture %2, i8* readnone %3) {
%5 = icmp eq i32 %0, 0
br i1 %5, label %12, label %6
6: ; preds = %4
%7 = load i8*, i8** %2
%8 = icmp eq i8* %7, %3
br i1 %8, label %14, label %9
9: ; preds = %6
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %10, i8** %2
%11 = load i8, i8* %7
br label %12
12: ; preds = %4, %9
%13 = phi i8 [ %11, %9 ], [ 0, %4 ]
store i8 %13, i8* %1
br label %14
14: ; preds = %6, %12
%15 = phi i32 [ 1, %12 ], [ 0, %6 ]
ret i32 %15
}
/* Type definitions */
struct mat4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat4_rotation_axis(float *, float *, float);
__attribute__((always_)) struct mat4 *
psmat4_rotation_axis(struct mat4 *result, struct mat4 *a, float angle) {
  mat4_rotation_axis((float *)result, (float *)a, angle);
  return result;
}


x86 assembly (clang, -O0):
<psmat4_rotation_axis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
call   1030 <mat4_rotation_axis@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psmat4_rotation_axis>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat4_rotation_axis@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_rotation_axis(%struct.mat4* %0, %struct.mat4* %1, float %2) {
%4 = alloca %struct.mat4*
%5 = alloca %struct.mat4*
%6 = alloca float
store %struct.mat4* %0, %struct.mat4** %4
store %struct.mat4* %1, %struct.mat4** %5
store float %2, float* %6
%7 = load %struct.mat4*, %struct.mat4** %4
%8 = bitcast %struct.mat4* %7 to float*
%9 = load %struct.mat4*, %struct.mat4** %5
%10 = bitcast %struct.mat4* %9 to float*
%11 = load float, float* %6
%12 = call i32 @mat4_rotation_axis(float* %8, float* %10, float %11)
%13 = load %struct.mat4*, %struct.mat4** %4
ret %struct.mat4* %13
}

LLVM IR (-O2):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_rotation_axis(%struct.mat4* returned %0, %struct.mat4* %1, float %2) {
%4 = bitcast %struct.mat4* %0 to float*
%5 = bitcast %struct.mat4* %1 to float*
%6 = tail call i32 @mat4_rotation_axis(float* %4, float* %5, float %2)
ret %struct.mat4* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  char s[] = "Hello world";
  int length = 0;
  int i = 0;
  while (s[i]) {
    if (s[i] == ' ') {
      length = 0;
    } else {
      length++;
    }
    i++;
  }
  printf("Length is: %d", length);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movslq -0x18(%rbp),%rax
cmpb   $0x0,-0x10(%rbp,%rax,1)
je     1185 <main+0x75>
movslq -0x18(%rbp),%rax
movsbl -0x10(%rbp,%rax,1),%eax
cmp    $0x20,%eax
jne    116e <main+0x5e>
movl   $0x0,-0x14(%rbp)
jmp    1177 <main+0x67>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1141 <main+0x31>
mov    -0x14(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.s = [12 x i8] c"Hello world\00"
@.str = [14 x i8] c"Length is: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [12 x i8]* %2 to i8*
store i32 0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %23, %0
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %26
12: ; preds = %6
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 32
br i1 %18, label %19, label %20
19: ; preds = %12
store i32 0, i32* %3
br label %23
20: ; preds = %12
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %23
23: ; preds = %20, %19
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %6
26: ; preds = %6
%27 = load i32, i32* %3
%28 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@.str = [14 x i8] c"Length is: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SCOTCHFRANDOMRESET();
void scotchfrandomreset_() { SCOTCHFRANDOMRESET(); }


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

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

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

LLVM IR (-O2):
define void @scotchfrandomreset_() {
%1 = tail call i32 (...) @SCOTCHFRANDOMRESET()
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, struct timeval *);
void data_wait(int fd) {
  fd_set fds;
  struct timeval tv;
  FD_ZERO(&fds);
  FD_SET(fd, &fds);
  tv.tv_sec = 1;
  tv.tv_usec = 0;
  select(fd + 1, &fds, NULL, NULL, &tv);
}


x86 assembly (clang, -O0):
<data_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <FD_SET@plt>
movl   $0x1,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rdx
call   1040 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_wait>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
movl   $0x1,0x8(%rsp)
movq   $0x0,0x10(%rsp)
add    $0x1,%ebx
lea    0x8(%rsp),%r8
mov    %ebx,%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <select@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define void @data_wait(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timeval
store i32 %0, i32* %2
%5 = call i32 @FD_ZERO(i32* %3)
%6 = load i32, i32* %2
%7 = call i32 @FD_SET(i32 %6, i32* %3)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
store i32 1, i32* %8
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
store i64 0, i64* %9
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
%12 = call i32 @select(i32 %11, i32* %3, i32* null, i32* null, %struct.timeval* %4)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define void @data_wait(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
%4 = bitcast i32* %2 to i8*
%5 = bitcast %struct.timeval* %3 to i8*
%6 = call i32 @FD_ZERO(i32* %2)
%7 = call i32 @FD_SET(i32 %0, i32* %2)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 1, i32* %8
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
store i64 0, i64* %9
%10 = add nsw i32 %0, 1
%11 = call i32 @select(i32 %10, i32* %2, i32* null, i32* null, %struct.timeval* %3)
ret void
}
/* Variables and functions */
int roadmap_tile_get_scale(int);
int roadmap_square_scale(int square) { return roadmap_tile_get_scale(square); }


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

x86 assembly (clang, -O2):
<roadmap_square_scale>:
jmp    1030 <roadmap_tile_get_scale@plt>

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

LLVM IR (-O2):
define i32 @roadmap_square_scale(i32 %0) {
%2 = tail call i32 @roadmap_tile_get_scale(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assume(int);
int /*<<< orphan*/ static_assert(int);
void main(int n) {
  assume(n >= 0);
  int i = 0, j = 0;
  while (i < n) {
    i++;
    j++;
  }
  static_assert(j == n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116d <main+0x4d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <main+0x2a>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <static_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
not    %ebx
shr    $0x1f,%ebx
mov    %ebx,%edi
call   1040 <assume@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <static_assert@plt>

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assume(i32 %7)
store i32 0, i32* %3
store i32 0, i32* %4
br label %9
9: ; preds = %13, %1
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %9
18: ; preds = %9
%19 = load i32, i32* %4
%20 = load i32, i32* %2
%21 = icmp eq i32 %19, %20
%22 = zext i1 %21 to i32
%23 = call i32 @static_assert(i32 %22)
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assume(i32 %3)
%5 = xor i32 %0, -1
%6 = lshr i32 %5, 31
%7 = tail call i32 @static_assert(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void greet(int n) {
  for (int i = 0; i < 5; i++) {
    puts("Hello, World!");
  }
}


x86 assembly (clang, -O0):
<greet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1146 <greet+0x36>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <greet+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greet>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World!\00"
define void @greet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define void @greet(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
void str_replaceChar(char *pStr, char c1, char c2) {
  while (*pStr) {
    if (*pStr == c1)
      *pStr = c2;
    pStr++;
  }
}


x86 assembly (clang, -O0):
<str_replaceChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <str_replaceChar+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113c <str_replaceChar+0x3c>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <str_replaceChar+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_replaceChar>:
mov    (%rdi),%al
test   %al,%al
je     1125 <str_replaceChar+0x25>
add    $0x1,%rdi
jmp    111b <str_replaceChar+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <str_replaceChar+0x25>
cmp    %sil,%al
jne    1110 <str_replaceChar+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <str_replaceChar+0x10>
ret

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

LLVM IR (-O2):
define void @str_replaceChar(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %10, %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, int);
void test_indirection(int *ptr) { __emit_expression_range(0, *ptr); }


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

x86 assembly (clang, -O2):
<test_indirection>:
mov    (%rdi),%esi
xor    %edi,%edi
jmp    1030 <__emit_expression_range@plt>

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

LLVM IR (-O2):
define void @test_indirection(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @__emit_expression_range(i32 0, i32 %2)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
scalar_t__ fstat(int, struct stat *);
int /*<<< orphan*/ t_error(char *);
off_t xfstat_size(int fd) {
  struct stat buf;
  if (fstat(fd, &buf) != 0) {
    t_error("failed to fstat file descriptor");
  }
  return buf.st_size;
}


x86 assembly (clang, -O0):
<xfstat_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0x0,%rax
je     114d <xfstat_size+0x2d>
lea    0xeb8(%rip),%rdi
call   1030 <t_error@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfstat_size>:
push   %rax
mov    %rsp,%rsi
call   1040 <fstat@plt>
test   %rax,%rax
je     113a <xfstat_size+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <t_error@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [32 x i8] c"failed to fstat file descriptor\00"
define i32 @xfstat_size(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @fstat(i32 %4, %struct.stat* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @t_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [32 x i8] c"failed to fstat file descriptor\00"
define i32 @xfstat_size(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @t_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}
void f1(void) {
#pragma omp cancel parallel
#pragma omp cancel for
#pragma omp cancel sections
#pragma omp cancel taskgroup
#pragma omp cancellation point parallel
#pragma omp cancellation point for
#pragma omp cancellation point sections
#pragma omp cancellation point taskgroup
}


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

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

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

LLVM IR (-O2):
define void @f1() {
ret void
}
void glmAddVector2f(float result[2], const float v1[2], const float v2[2]) {
  result[0] = v1[0] + v2[0];
  result[1] = v1[1] + v2[1];
}


x86 assembly (clang, -O0):
<glmAddVector2f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmAddVector2f>:
movss  (%rsi),%xmm0
addss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
addss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
ret

LLVM IR (-O0):
define void @glmAddVector2f(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
ret void
}

LLVM IR (-O2):
define void @glmAddVector2f(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fadd float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
ret void
}
int main() {
  int a, b;
  a = 12;
  b = 20;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 12, i32* %2
store i32 20, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int testfunc(int q) {
  int i, j;
  for (i = 1; i < 100; i++) {
    j += (i + j * 3 + 17) ^ 0x35;
  }
  return j * q;
}


x86 assembly (clang, -O0):
<testfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    113b <testfunc+0x3b>
mov    -0x8(%rbp),%eax
imul   $0x3,-0xc(%rbp),%ecx
add    %ecx,%eax
add    $0x11,%eax
xor    $0x35,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <testfunc+0xe>
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @testfunc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, 3
%12 = add nsw i32 %9, %11
%13 = add nsw i32 %12, 17
%14 = xor i32 %13, 53
%15 = load i32, i32* %4
%16 = add nsw i32 %15, %14
store i32 %16, i32* %4
br label %17
17: ; preds = %8
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %5
20: ; preds = %5
%21 = load i32, i32* %4
%22 = load i32, i32* %2
%23 = mul nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @testfunc(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void bb_clean() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @bb_clean() {
%1 = tail call i32 (...) @endwin()
ret void
}
unsigned xrop3_119_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = D & S;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_119_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %3
%8 = xor i32 %7, -1
%9 = xor i32 %3, -1
%10 = and i32 %9, %5
%11 = or i32 %10, %4
%12 = or i32 %11, %8
ret i32 %12
}
double B23(double t) {
  double tmp = 1.0 - t;
  return t * t * (3 * tmp + t);
}


x86 assembly (clang, -O0):
<B23>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  0xec9(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<B23>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @B23(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = load double, double* %3
%10 = load double, double* %2
%11 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %9, double %10)
%12 = fmul double %8, %11
ret double %12
}

LLVM IR (-O2):
define double @B23(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fmul double %0, %0
%4 = tail call double @llvm.fmuladd.f64(double %2, double 3.000000e+00, double %0)
%5 = fmul double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int checkIfNumber(char *num) {
  char *temp = num;
  while (*temp) {
    if (!isdigit(*temp))
      return 0;
    temp++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<checkIfNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <checkIfNumber+0x53>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1152 <checkIfNumber+0x42>
movl   $0x0,-0x4(%rbp)
jmp    116a <checkIfNumber+0x5a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <checkIfNumber+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkIfNumber>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <checkIfNumber+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <checkIfNumber+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <checkIfNumber+0x20>
jmp    114b <checkIfNumber+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @checkIfNumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ count(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
void main() {
  char *string;
  printf("Enter an string:\n");
  gets(string);
  printf("length:%d\n", strlen(string));
  count(string);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <gets@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb3(%rip),%rdi
call   1040 <puts@plt>
call   1070 <gets@plt>
call   1050 <strlen@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
pop    %rax
jmp    1030 <count@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Enter an string:\0A\00"
@.str.1 = [11 x i8] c"length:%d\0A\00"
define void @main() {
%1 = alloca i8*
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = load i8*, i8** %1
%4 = call i32 @gets(i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @strlen(i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %1
%9 = call i32 @count(i8* %8)
ret void
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"length:%d\0A\00"
@str = [17 x i8] c"Enter an string:\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @gets(i8* undef)
%3 = tail call i32 @strlen(i8* undef)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @count(i8* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Push(int);
void pOSTYPE() { Push(3); }


x86 assembly (clang, -O0):
<pOSTYPE>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <Push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pOSTYPE>:
mov    $0x3,%edi
jmp    1030 <Push@plt>

LLVM IR (-O0):
define void @pOSTYPE() {
%1 = call i32 @Push(i32 3)
ret void
}

LLVM IR (-O2):
define void @pOSTYPE() {
%1 = tail call i32 @Push(i32 3)
ret void
}
/* Type definitions */
struct picture {
  int dummy;
};

/* Variables and functions */
int read_fb(char *, int, struct picture *);
int TakeScreenshot(char *device, struct picture *pict) {
  int vt_num = -1;
  return read_fb(device, vt_num, pict);
}


x86 assembly (clang, -O0):
<TakeScreenshot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <read_fb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TakeScreenshot>:
mov    %rsi,%rdx
mov    $0xffffffff,%esi
jmp    1030 <read_fb@plt>

LLVM IR (-O0):
%struct.picture = type { i32 }
define i32 @TakeScreenshot(i8* %0, %struct.picture* %1) {
%3 = alloca i8*
%4 = alloca %struct.picture*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.picture* %1, %struct.picture** %4
store i32 -1, i32* %5
%6 = load i8*, i8** %3
%7 = load i32, i32* %5
%8 = load %struct.picture*, %struct.picture** %4
%9 = call i32 @read_fb(i8* %6, i32 %7, %struct.picture* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.picture = type { i32 }
define i32 @TakeScreenshot(i8* %0, %struct.picture* %1) {
%3 = tail call i32 @read_fb(i8* %0, i32 -1, %struct.picture* %1)
ret i32 %3
}
void dummyfunc(void) {
  int fatarray[64];
  fatarray[0] = 0xdeadbeaf;
  fatarray[8] = 0xdeadbeaf;
  fatarray[16] = 0xdeadbeaf;
  fatarray[32] = 0xdeadbeaf;
}


x86 assembly (clang, -O0):
<dummyfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0xdeadbeaf,-0x100(%rbp)
be ad de
movl   $0xdeadbeaf,-0xe0(%rbp)
be ad de
movl   $0xdeadbeaf,-0xc0(%rbp)
be ad de
movl   $0xdeadbeaf,-0x80(%rbp)
add    $0x80,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dummyfunc() {
%1 = alloca [64 x i32]
%2 = getelementptr inbounds [64 x i32], [64 x i32]* %1, i64 0, i64 0
store i32 -559038801, i32* %2
%3 = getelementptr inbounds [64 x i32], [64 x i32]* %1, i64 0, i64 8
store i32 -559038801, i32* %3
%4 = getelementptr inbounds [64 x i32], [64 x i32]* %1, i64 0, i64 16
store i32 -559038801, i32* %4
%5 = getelementptr inbounds [64 x i32], [64 x i32]* %1, i64 0, i64 32
store i32 -559038801, i32* %5
ret void
}

LLVM IR (-O2):
define void @dummyfunc() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ set_rounding(int /*<<< orphan*/ const *);
void cvt_s_w(const uint32_t *fcr31, const int32_t *source, float *dest) {
  set_rounding(fcr31);
  *dest = (float)*source;
}


x86 assembly (clang, -O0):
<cvt_s_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <set_rounding@plt>
mov    -0x10(%rbp),%rax
cvtsi2ssq (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_s_w>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <set_rounding@plt>
cvtsi2ssq (%rbx),%xmm0
movss  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @cvt_s_w(i32* %0, i64* %1, float* %2) {
%4 = alloca i32*
%5 = alloca i64*
%6 = alloca float*
store i32* %0, i32** %4
store i64* %1, i64** %5
store float* %2, float** %6
%7 = load i32*, i32** %4
%8 = call i32 @set_rounding(i32* %7)
%9 = load i64*, i64** %5
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to float
%12 = load float*, float** %6
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @cvt_s_w(i32* %0, i64* nocapture %1, float* nocapture writeonly %2) {
%4 = tail call i32 @set_rounding(i32* %0)
%5 = load i64, i64* %1
%6 = sitofp i64 %5 to float
store float %6, float* %2
ret void
}
__attribute__((__no__)) char *sf(char *s, char *s0) {
  asm("");
  while (*--s == '9')
    if (s == s0) {
      *s = '0';
      break;
    }
  ++*s++;
  return s;
}


x86 assembly (clang, -O0):
<sf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
movsbl -0x1(%rax),%eax
cmp    $0x39,%eax
jne    1147 <sf+0x47>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1142 <sf+0x42>
mov    -0x8(%rbp),%rax
movb   $0x30,(%rax)
jmp    1147 <sf+0x47>
jmp    110c <sf+0xc>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
add    $0x1,%cl
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sf>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rdi,%rax
movzbl (%rdi),%ecx
cmp    $0x39,%cl
jne    112b <sf+0x2b>
lea    -0x1(%rax),%rdi
cmp    %rsi,%rax
jne    1110 <sf+0x10>
movb   $0x30,(%rsi)
mov    $0x31,%cl
jmp    1131 <sf+0x31>
add    $0x1,%cl
mov    %rax,%rsi
mov    %cl,(%rsi)
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i8* @sf(i8* %0, i8* readnone %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%5 = sub i64 %4, %3
%6 = getelementptr i8, i8* %0, i64 %5
br label %7
7: ; preds = %12, %2
%8 = phi i8* [ %0, %2 ], [ %9, %12 ]
%9 = getelementptr inbounds i8, i8* %8, i64 -1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 57
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = icmp eq i8* %9, %1
br i1 %13, label %14, label %7
14: ; preds = %12
store i8 48, i8* %6
br label %17
15: ; preds = %7
%16 = add i8 %10, 1
br label %17
17: ; preds = %15, %14
%18 = phi i8 [ %16, %15 ], [ 49, %14 ]
%19 = phi i8* [ %9, %15 ], [ %6, %14 ]
store i8 %18, i8* %19
ret i8* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int safe_atou(char const *, unsigned int *);
int safe_atou32(const char *s, uint32_t *ret_u) {

#pragma GCC diagnostic push
  ;
#pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
  ;
  struct _assert_struct_0 {
    char x[(sizeof(uint32_t) == sizeof(unsigned)) ? 0 : -1];
  };
#pragma GCC diagnostic pop
  ;
  return safe_atou(s, (unsigned *)ret_u);
}


x86 assembly (clang, -O0):
<safe_atou32>:
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 <safe_atou@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_atou32>:
jmp    1030 <safe_atou@plt>

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

LLVM IR (-O2):
define i32 @safe_atou32(i8* %0, i32* %1) {
%3 = tail call i32 @safe_atou(i8* %0, i32* %1)
ret i32 %3
}
void d2i_RSA_PUBKEY_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_RSA_PUBKEY_bio() {
ret void
}
/* Variables and functions */
int f101(int *);
int f102(int *p) { return f101(p); }


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

x86 assembly (clang, -O2):
<f102>:
jmp    1030 <f101@plt>

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

LLVM IR (-O2):
define i32 @f102(i32* %0) {
%2 = tail call i32 @f101(i32* %0)
ret i32 %2
}