xunge/DecIR huggingface dataset:
/* Type definitions */
struct quat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ quat_normalize(float *, float *);
__attribute__((always_)) struct quat *psquat_normalize(struct quat *result,
                                                       struct quat *a) {
  quat_normalize((float *)result, (float *)a);
  return result;
}


x86 assembly (clang, -O0):
<psquat_normalize>:
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 <quat_normalize@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.quat = type { i32 }
define %struct.quat* @psquat_normalize(%struct.quat* %0, %struct.quat* %1) {
%3 = alloca %struct.quat*
%4 = alloca %struct.quat*
store %struct.quat* %0, %struct.quat** %3
store %struct.quat* %1, %struct.quat** %4
%5 = load %struct.quat*, %struct.quat** %3
%6 = bitcast %struct.quat* %5 to float*
%7 = load %struct.quat*, %struct.quat** %4
%8 = bitcast %struct.quat* %7 to float*
%9 = call i32 @quat_normalize(float* %6, float* %8)
%10 = load %struct.quat*, %struct.quat** %3
ret %struct.quat* %10
}

LLVM IR (-O2):
%struct.quat = type { i32 }
define %struct.quat* @psquat_normalize(%struct.quat* returned %0, %struct.quat* %1) {
%3 = bitcast %struct.quat* %0 to float*
%4 = bitcast %struct.quat* %1 to float*
%5 = tail call i32 @quat_normalize(float* %3, float* %4)
ret %struct.quat* %0
}
float max2(float x, float y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<max2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <max2+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <max2+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max2>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @max2(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_238() {
  Assert_real((isqrt(238) == 15),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1195, ("Integer square root of 238 should be 15"));
}


x86 assembly (clang, -O0):
<t_sqrt_238>:
push   %rbp
mov    %rsp,%rbp
mov    $0xee,%edi
call   1030 <isqrt@plt>
cmp    $0xf,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x4ab,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_238>:
push   %rax
mov    $0xee,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xf,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x4ab,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 238 should be 15\00"
define void @t_sqrt_238() {
%1 = call i32 @isqrt(i32 238)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1195, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 238 should be 15\00"
define void @t_sqrt_238() {
%1 = tail call i32 @isqrt(i32 238)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1195, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _ndelay(int);
void _udelay(unsigned int n) {
  while (n >= 10) {
    _ndelay(10000);
    n -= 10;
  }
  while (n-- > 0)
    _ndelay(1000);
}


x86 assembly (clang, -O0):
<_udelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jb     113d <_udelay+0x2d>
mov    $0x2710,%edi
call   1030 <_ndelay@plt>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <_udelay+0xb>
jmp    1142 <_udelay+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jbe    1165 <_udelay+0x55>
mov    $0x3e8,%edi
call   1030 <_ndelay@plt>
jmp    1142 <_udelay+0x32>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_udelay>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jb     1132 <_udelay+0x22>
nopl   0x0(%rax,%rax,1)
mov    $0x2710,%edi
call   1030 <_ndelay@plt>
add    $0xfffffff6,%ebx
cmp    $0x9,%ebx
ja     1120 <_udelay+0x10>
test   %ebx,%ebx
je     114f <_udelay+0x3f>
cs nopw 0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <_ndelay@plt>
add    $0xffffffff,%ebx
jne    1140 <_udelay+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @_udelay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp uge i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 @_ndelay(i32 10000)
%8 = load i32, i32* %2
%9 = sub i32 %8, 10
store i32 %9, i32* %2
br label %3
10: ; preds = %3
br label %11
11: ; preds = %15, %10
%12 = load i32, i32* %2
%13 = add i32 %12, -1
store i32 %13, i32* %2
%14 = icmp ugt i32 %12, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @_ndelay(i32 1000)
br label %11
17: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @_udelay(i32 %0) {
%2 = icmp ugt i32 %0, 9
br i1 %2, label %6, label %3
3: ; preds = %6, %1
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %11
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ %0, %1 ]
%8 = tail call i32 @_ndelay(i32 10000)
%9 = add i32 %7, -10
%10 = icmp ugt i32 %9, 9
br i1 %10, label %6, label %3
11: ; preds = %3, %11
%12 = phi i32 [ %13, %11 ], [ %4, %3 ]
%13 = add i32 %12, -1
%14 = tail call i32 @_ndelay(i32 1000)
%15 = icmp eq i32 %13, 0
br i1 %15, label %16, label %11
16: ; preds = %11, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stderr;
void log_char(char c) { fprintf(stderr, "%c\n", c); }


x86 assembly (clang, -O0):
<log_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
lea    0xed2(%rip),%rsi
movsbl -0x1(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_char>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%c\0A\00"
define void @log_char(i8 signext %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void test54_PrintImpl_printReal__E(float f) { printf("%f", (float)f); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @test54_PrintImpl_printReal__E(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
void XtMenuPopupAction() {}


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

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

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

LLVM IR (-O2):
define void @XtMenuPopupAction() {
ret void
}
int pretos(char senha[5]) {
  int i = 0, cont = 0;
  for (; i < 5 - 1; i++)
    if (senha[i] == 'B')
      cont++;
  return cont;
}


x86 assembly (clang, -O0):
<pretos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1151 <pretos+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x42,%eax
jne    113e <pretos+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1143 <pretos+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <pretos+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pretos>:
movd   (%rdi),%xmm0
pcmpeqb 0xef4(%rip),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
movmskps %xmm0,%eax
mov    %eax,%ecx
shr    %cl
and    $0x5,%cl
sub    %cl,%al
mov    %eax,%ecx
and    $0x33,%cl
shr    $0x2,%al
and    $0x33,%al
add    %cl,%al
mov    %eax,%ecx
shr    $0x4,%cl
add    %al,%cl
and    $0xf,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @pretos(i8* nocapture %0) {
%2 = bitcast i8* %0 to <4 x i8>*
%3 = load <4 x i8>, <4 x i8>* %2
%4 = icmp eq <4 x i8> %3, <i8 66, i8 66, i8 66, i8 66>
%5 = bitcast <4 x i1> %4 to i4
%6 = call i4 @llvm.ctpop.i4(i4 %5)
%7 = zext i4 %6 to i32
ret i32 %7
}
unsigned int rev_l_m(const unsigned char *p) {
  unsigned int a, b, c, d;
  a = p[0];
  b = p[1];
  c = p[2];
  d = p[3];
  return (a << 24) | (b << 16) | (c << 8) | (d << 0);
}


x86 assembly (clang, -O0):
<rev_l_m>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_l_m>:
mov    (%rdi),%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @rev_l_m(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw i32 %3, 24
%14 = shl nuw nsw i32 %6, 16
%15 = or i32 %14, %13
%16 = shl nuw nsw i32 %9, 8
%17 = or i32 %15, %16
%18 = or i32 %17, %12
ret i32 %18
}
int atoi(char *str) {
  char c;
  int i = 0;
  while ((c = *str++) != 0) {
    if (c < '0' || c > '9') {
      break;
    }
    i = i * 10 + c - '0';
  }
  return i;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1163 <atoi+0x63>
movsbl -0x9(%rbp),%eax
cmp    $0x30,%eax
jl     1149 <atoi+0x49>
movsbl -0x9(%rbp),%eax
cmp    $0x39,%eax
jle    114e <atoi+0x4e>
jmp    1163 <atoi+0x63>
imul   $0xa,-0x10(%rbp),%eax
movsbl -0x9(%rbp),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x10(%rbp)
jmp    110f <atoi+0xf>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
lea    -0x3a(%rcx),%edx
xor    %eax,%eax
cmp    $0xf6,%dl
jb     113b <atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x3a(%rcx),%edx
add    $0x1,%rdi
cmp    $0xf5,%dl
ja     1120 <atoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -58
%4 = icmp ult i8 %3, -10
br i1 %4, label %17, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %13, %5 ], [ 0, %1 ]
%8 = phi i8* [ %10, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = mul nsw i32 %7, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %9
%14 = load i8, i8* %10
%15 = add i8 %14, -58
%16 = icmp ult i8 %15, -10
br i1 %16, label %17, label %5
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
/* Variables and functions */
scalar_t__ ceil(double);
scalar_t__ floor(double);
int commROUNDnear_D(double x) {
  return (int)((x < 0.0) ? ceil(x - 0.5) : floor(x + 0.5));
}


x86 assembly (clang, -O0):
<commROUNDnear_D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    115a <commROUNDnear_D+0x3a>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %rax,-0x10(%rbp)
jmp    1170 <commROUNDnear_D+0x50>
movsd  0xe9e(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commROUNDnear_D>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    113a <commROUNDnear_D+0x1a>
addsd  0xed5(%rip),%xmm0
call   1030 <ceil@plt>
pop    %rcx
ret
addsd  0xebe(%rip),%xmm0
call   1040 <floor@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @commROUNDnear_D(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 %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fsub double %6, 5.000000e-01
%8 = call i64 @ceil(double %7)
br label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fadd double %10, 5.000000e-01
%12 = call i64 @floor(double %11)
br label %13
13: ; preds = %9, %5
%14 = phi i64 [ %8, %5 ], [ %12, %9 ]
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @commROUNDnear_D(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd double %0, -5.000000e-01
%5 = tail call i64 @ceil(double %4)
br label %9
6: ; preds = %1
%7 = fadd double %0, 5.000000e-01
%8 = tail call i64 @floor(double %7)
br label %9
9: ; preds = %6, %3
%10 = phi i64 [ %5, %3 ], [ %8, %6 ]
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
double sqrt(double);
double f(double x) { return sqrt(4.0 - x * x); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xee0(%rip),%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1133 <f+0x23>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fneg double %3
%6 = call double @llvm.fmuladd.f64(double %5, double %4, double 4.000000e+00)
%7 = call double @sqrt(double %6)
ret double %7
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 4.000000e+00)
%4 = tail call double @sqrt(double %3)
ret double %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void lamport_sign(uint8_t *sig, uint8_t msg, uint8_t **secret_keys) {
  if (msg)
    sig = secret_keys[0];
  else
    sig = secret_keys[1];
  return;
}


x86 assembly (clang, -O0):
<lamport_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     112b <lamport_sign+0x2b>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1137 <lamport_sign+0x37>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @lamport_sign(i64* nocapture %0, i64 %1, i64** nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
scalar_t__ malloc(int);
fd_set *Selective_InitSet(void) {
  fd_set *s = (fd_set *)malloc(sizeof(fd_set));
  return s;
}


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

x86 assembly (clang, -O2):
<Selective_InitSet>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @Selective_InitSet() {
%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
ret i32* %4
}

LLVM IR (-O2):
define i32* @Selective_InitSet() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
void glUniform4fv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniform4fv() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *trim(char *src) {
  while (isspace(*src))
    ++src;
  return src;
}


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

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <trim+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @trim(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
int main(void) {
  "a" || "b";
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
mov    %al,-0x5(%rbp)
jne    1122 <main+0x22>
mov    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1122 <main+0x22>
mov    -0x5(%rbp),%al
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"b\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br i1 true, label %3, label %2
2: ; preds = %0
br label %3
3: ; preds = %2, %0
%4 = phi i1 [ true, %0 ], [ true, %2 ]
%5 = zext i1 %4 to i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int okn_tsm_rot_x(struct okn_tsm *t, float x) { return 1; }


x86 assembly (clang, -O0):
<okn_tsm_rot_x>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.okn_tsm = type opaque
define i32 @okn_tsm_rot_x(%struct.okn_tsm* %0, float %1) {
%3 = alloca %struct.okn_tsm*
%4 = alloca float
store %struct.okn_tsm* %0, %struct.okn_tsm** %3
store float %1, float* %4
ret i32 1
}

LLVM IR (-O2):
%struct.okn_tsm = type opaque
define i32 @okn_tsm_rot_x(%struct.okn_tsm* nocapture readnone %0, float %1) {
ret i32 1
}
int render_sys_init(struct system *system) { return 0; }


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

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

LLVM IR (-O0):
%struct.system = type opaque
define i32 @render_sys_init(%struct.system* %0) {
%2 = alloca %struct.system*
store %struct.system* %0, %struct.system** %2
ret i32 0
}

LLVM IR (-O2):
%struct.system = type opaque
define i32 @render_sys_init(%struct.system* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error_exit(char *, unsigned long);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ret = malloc(size);
  if (NULL == ret) {
    error_exit("Could not allocate %lu bytes of memory", (unsigned long)size);
  }
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1155 <xmalloc+0x35>
mov    -0x8(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <error_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xmalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <error_exit@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Could not allocate %lu bytes of memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* null, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @error_exit(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [39 x i8] c"Could not allocate %lu bytes of memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error_exit(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_tos(void) { printf("TOS"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"TOS\00"
define void @print_tos() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int gename(char *, char *);
char *unixname_to_riscos(char const *);
int rename(const char *unix_old, const char *unix_new) {
  char *riscos_old = unixname_to_riscos(unix_old);
  char *riscos_new = unixname_to_riscos(unix_new);
  int error = gename(riscos_old, riscos_new);
  free(riscos_old);
  free(riscos_new);
  return error;
}


x86 assembly (clang, -O0):
<rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <unixname_to_riscos@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <unixname_to_riscos@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <gename@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rename>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1050 <unixname_to_riscos@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1050 <unixname_to_riscos@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <gename@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i8* @unixname_to_riscos(i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = call i8* @unixname_to_riscos(i8* %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = call i32 @gename(i8* %12, i8* %13)
store i32 %14, i32* %7
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
%17 = load i8*, i8** %6
%18 = call i32 @free(i8* %17)
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @rename(i8* %0, i8* %1) {
%3 = tail call i8* @unixname_to_riscos(i8* %0)
%4 = tail call i8* @unixname_to_riscos(i8* %1)
%5 = tail call i32 @gename(i8* %3, i8* %4)
%6 = tail call i32 @free(i8* %3)
%7 = tail call i32 @free(i8* %4)
ret i32 %5
}
/* Variables and functions */
int rshft_l(int *, int *);
int intr_wrap_564(int p1, int p2) { return rshft_l(&p1, &p2); }


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

x86 assembly (clang, -O2):
<intr_wrap_564>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <rshft_l@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @intr_wrap_564(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @rshft_l(i32* %3, i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @intr_wrap_564(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @rshft_l(i32* %3, i32* %4)
ret i32 %5
}
void jump_start(void *init, void *exit_func, void *entry) {
  register long rsp __asm__("rsp") = (long)init;
  register long rdx __asm__("rdx") = (long)exit_func;
  __asm__ __volatile__("jmp *%0\n" : : "r"(entry), "r"(rsp), "r"(rdx) :);
}


x86 assembly (clang, -O0):
<jump_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    %rcx,%rsp
jmp    *%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump_start>:
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rsp
jmp    *%rax
ret

LLVM IR (-O0):
define void @jump_start(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
store i64 %10, i64* %7
%11 = load i8*, i8** %5
%12 = ptrtoint i8* %11 to i64
store i64 %12, i64* %8
%13 = load i8*, i8** %6
%14 = load i64, i64* %7
%15 = load i64, i64* %8
ret void
}

LLVM IR (-O2):
define void @jump_start(i8* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %0 to i64
%5 = ptrtoint i8* %1 to i64
tail call void asm sideeffect "jmp *$0\0A", "r,{rsp},{rdx},~{dirflag},~{fpsr},~{flags}"(i8* %2, i64 %4, i64 %5)
ret void
}
void gtk_window_set_icon_name() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_icon_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void safe_free(void *ptr) {
  if (ptr) {
    free(ptr);
    ptr = 0;
  }
}


x86 assembly (clang, -O0):
<safe_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <safe_free+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_free>:
test   %rdi,%rdi
je     111a <safe_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @safe_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
store i8* null, i8** %2
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @safe_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ breakpoint();
int /*<<< orphan*/ printk(char *, char *);
int /*<<< orphan*/ show_stack(void *);
void pminisock_evictN(int count) {
  do {
    if (!(0)) {
      printk("kgdb assertion failed: %s\n", "BUG");
      show_stack(((void *)0));
      breakpoint();
    }
  } while (0);
}


x86 assembly (clang, -O0):
<pminisock_evictN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <printk@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <show_stack@plt>
mov    $0x0,%al
call   1040 <breakpoint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pminisock_evictN>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1030 <printk@plt>
xor    %edi,%edi
call   1050 <show_stack@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <breakpoint@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"kgdb assertion failed: %s\0A\00"
@.str.1 = [4 x i8] c"BUG\00"
define void @pminisock_evictN(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @show_stack(i8* null)
%6 = call i32 (...) @breakpoint()
br label %7
7: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"kgdb assertion failed: %s\0A\00"
@.str.1 = [4 x i8] c"BUG\00"
define void @pminisock_evictN(i32 %0) {
%2 = tail call i32 @printk(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @show_stack(i8* null)
%4 = tail call i32 (...) @breakpoint()
ret void
}
/* Variables and functions */
double swe_radnorm(double);
double swe_difrad2n(double p1, double p2) {
  double dif;
  dif = swe_radnorm(p1 - p2);
  if (dif >= (2.0 * 3.14159265358979323846) / 2)
    return (dif - (2.0 * 3.14159265358979323846));
  return (dif);
}


x86 assembly (clang, -O0):
<swe_difrad2n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <swe_radnorm@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1168 <swe_difrad2n+0x58>
movsd  -0x20(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1172 <swe_difrad2n+0x62>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swe_difrad2n>:
push   %rax
subsd  %xmm1,%xmm0
call   1030 <swe_radnorm@plt>
movsd  0xede(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm2
cmpnlesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @swe_difrad2n(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = call double @swe_radnorm(double %9)
store double %10, double* %6
%11 = load double, double* %6
%12 = fcmp oge double %11, 0x400921FB54442D18
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load double, double* %6
%15 = fsub double %14, 0x401921FB54442D18
store double %15, double* %3
br label %18
16: ; preds = %2
%17 = load double, double* %6
store double %17, double* %3
br label %18
18: ; preds = %16, %13
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @swe_difrad2n(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @swe_radnorm(double %3)
%5 = fcmp ult double %4, 0x400921FB54442D18
%6 = fadd double %4, 0xC01921FB54442D18
%7 = select i1 %5, double %4, double %6
ret double %7
}
int C_Utils_min_int(const int item1, const int item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_min_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <C_Utils_min_int+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <C_Utils_min_int+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_min_int>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @C_Utils_min_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write1and1(char *, char *);
int main() {
  char *s1;
  s1 = "Hello";
  char *s2;
  s2 = "World!\n";
  write1and1(s1, s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xed5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <write1and1@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [8 x i8] c"World!\0A\00"
define i32 @main() {
%1 = tail call i32 @write1and1(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char **stb_tokens_raw(char *, char *, int *, int /*<<< orphan*/,
                      int /*<<< orphan*/, char *, char *);
char **stb_tokens_nested(char *src, char *delimit, int *count, char *nest_in,
                         char *nest_out) {
  return stb_tokens_raw(src, delimit, count, 0, 0, nest_in, nest_out);
}


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

x86 assembly (clang, -O2):
<stb_tokens_nested>:
push   %rax
mov    %rcx,%r9
mov    %r8,(%rsp)
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <stb_tokens_raw@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i8** @stb_tokens_nested(i8* %0, i8* %1, i32* %2, i8* %3, i8* %4) {
%6 = tail call i8** @stb_tokens_raw(i8* %0, i8* %1, i32* %2, i32 0, i32 0, i8* %3, i8* %4)
ret i8** %6
}
/* Variables and functions */
double M_PI;
double radToDeg(double angleRad) { return (180.0 * angleRad / M_PI); }


x86 assembly (clang, -O0):
<radToDeg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radToDeg>:
mulsd  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @radToDeg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 1.800000e+02, %3
%5 = load double, double* @M_PI
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @radToDeg(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = load double, double* @M_PI
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int helper2(int /*<<< orphan*/, int, int *, int, int **);
int **init_array(int);
int rob2(int *nums, int numsSize) {
  int **array = init_array(numsSize);
  return helper2(0, numsSize - 1, nums, numsSize, array);
}


x86 assembly (clang, -O0):
<rob2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <init_array@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
xor    %edi,%edi
call   1040 <helper2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rob2>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1030 <init_array@plt>
lea    -0x1(%rbx),%esi
xor    %edi,%edi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    %rax,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <helper2@plt>

LLVM IR (-O0):
define i32 @rob2(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32**
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32** @init_array(i32 %6)
store i32** %7, i32*** %5
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = load i32**, i32*** %5
%13 = call i32 @helper2(i32 0, i32 %9, i32* %10, i32 %11, i32** %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @rob2(i32* %0, i32 %1) {
%3 = tail call i32** @init_array(i32 %1)
%4 = add nsw i32 %1, -1
%5 = tail call i32 @helper2(i32 0, i32 %4, i32* %0, i32 %1, i32** %3)
ret i32 %5
}
unsigned leftrotate(unsigned r, short N) {
  unsigned mask1 = (1 << N) - 1;
  return ((r >> (32 - N)) & mask1) | ((r << N) & ~mask1);
}


x86 assembly (clang, -O0):
<leftrotate>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
movswl -0x6(%rbp),%edx
mov    $0x20,%ecx
sub    %edx,%ecx
shr    %cl,%eax
and    -0xc(%rbp),%eax
mov    -0x4(%rbp),%edx
movswl -0x6(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftrotate>:
mov    $0xffffffff,%edx
mov    %esi,%ecx
shl    %cl,%edx
not    %edx
neg    %cl
mov    %edi,%eax
shr    %cl,%eax
and    %edx,%eax
mov    %esi,%ecx
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @leftrotate(i32 %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca i32
store i32 %0, i32* %3
store i16 %1, i16* %4
%6 = load i16, i16* %4
%7 = sext i16 %6 to i32
%8 = shl i32 1, %7
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i16, i16* %4
%12 = sext i16 %11 to i32
%13 = sub nsw i32 32, %12
%14 = lshr i32 %10, %13
%15 = load i32, i32* %5
%16 = and i32 %14, %15
%17 = load i32, i32* %3
%18 = load i16, i16* %4
%19 = sext i16 %18 to i32
%20 = shl i32 %17, %19
%21 = load i32, i32* %5
%22 = xor i32 %21, -1
%23 = and i32 %20, %22
%24 = or i32 %16, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @leftrotate(i32 %0, i16 signext %1) {
%3 = sext i16 %1 to i32
%4 = shl nsw i32 -1, %3
%5 = xor i32 %4, -1
%6 = sub nsw i32 32, %3
%7 = lshr i32 %0, %6
%8 = and i32 %7, %5
%9 = shl i32 %0, %3
%10 = or i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("This is test #3.\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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"This is test.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"This is test.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ co_init();
void test() {
  co_init();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <co_init@plt>
jmp    111b <test+0xb>

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %eax,%eax
call   1030 <co_init@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <test+0x10>

LLVM IR (-O0):
define void @test() {
%1 = call i32 (...) @co_init()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @co_init()
br label %2
2: ; preds = %0, %2
br label %2
}