xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ vars;

/* Variables and functions */
int /*<<< orphan*/ unsetenv(char const *);
void clean_env(void) {
  const char *vars[] = {"CHALLENGE_NAME", "PORT", "TIMELIMIT",
                        "PWNABLESERVER_EXTRA_ARGS"};
  size_t i;
  for (i = 0; i < (sizeof(vars) / sizeof((vars)[0])); i++) {
    unsetenv(vars[i]);
  }
}


x86 assembly (clang, -O0):
<clean_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2ce1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cde(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cdb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cd8(%rip),%rax
mov    %rax,-0x8(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x4,-0x28(%rbp)
jae    1176 <clean_env+0x66>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,8),%rdi
call   1030 <unsetenv@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    114c <clean_env+0x3c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_env>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <unsetenv@plt>
lea    0xeeb(%rip),%rdi
call   1030 <unsetenv@plt>
lea    0xee4(%rip),%rdi
call   1030 <unsetenv@plt>
lea    0xee2(%rip),%rdi
pop    %rax
jmp    1030 <unsetenv@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"CHALLENGE_NAME\00"
@.str.1 = [5 x i8] c"PORT\00"
@.str.2 = [10 x i8] c"TIMELIMIT\00"
@.str.3 = [25 x i8] c"PWNABLESERVER_EXTRA_ARGS\00"
@__const.clean_env.vars = [4 x i8*] [i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i32 0, i32 0)]
define void @clean_env() {
%1 = alloca [4 x i8*]
%2 = alloca i64
%3 = bitcast [4 x i8*]* %1 to i8*
store i64 0, i64* %2
br label %4
4: ; preds = %12, %0
%5 = load i64, i64* %2
%6 = icmp ult i64 %5, 4
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i64, i64* %2
%9 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 %8
%10 = load i8*, i8** %9
%11 = call i32 @unsetenv(i8* %10)
br label %12
12: ; preds = %7
%13 = load i64, i64* %2
%14 = add i64 %13, 1
store i64 %14, i64* %2
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"CHALLENGE_NAME\00"
@.str.1 = [5 x i8] c"PORT\00"
@.str.2 = [10 x i8] c"TIMELIMIT\00"
@.str.3 = [25 x i8] c"PWNABLESERVER_EXTRA_ARGS\00"
define void @clean_env() {
%1 = tail call i32 @unsetenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @unsetenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @unsetenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @unsetenv(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int printf(char *, int, char, int, char);
int add(int a, int b) {
  if (a * b != 0)
    return printf("%*c%*c", a, '\r', b, '\r');
  else
    return a != 0 ? a : b;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1151 <add+0x41>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
lea    0xec5(%rip),%rdi
mov    $0xd,%r8d
mov    %r8d,%edx
call   1030 <printf@plt>
mov    %eax,-0x4(%rbp)
jmp    1172 <add+0x62>
cmpl   $0x0,-0x8(%rbp)
je     1166 <add+0x56>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116c <add+0x5c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
mov    %esi,%ecx
mov    %edi,%esi
mov    %ecx,%eax
imul   %edi,%eax
test   %eax,%eax
je     1134 <add+0x24>
lea    0xedc(%rip),%rdi
mov    $0xd,%edx
mov    $0xd,%r8d
jmp    1030 <printf@plt>
test   %esi,%esi
cmovne %esi,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%*c%*c\00"
define i32 @add(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i8 signext 13, i32 %1, i8 signext 13)
br label %10
7: ; preds = %2
%8 = icmp eq i32 %0, 0
%9 = select i1 %8, i32 %1, i32 %0
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void printHeader(int density, double maxRadius) {
  time_t genTime;
  time(&genTime);
  printf("%d 2 1\n", (density * 96 + 1) * 2);
}


x86 assembly (clang, -O0):
<printHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <time@plt>
imul   $0x60,-0x4(%rbp),%esi
add    $0x1,%esi
shl    $0x1,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHeader>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xc(%rsp),%rdi
call   1040 <time@plt>
shl    $0x6,%ebx
lea    (%rbx,%rbx,2),%esi
or     $0x2,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d 2 1\0A\00"
define void @printHeader(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
store i32 %0, i32* %3
store double %1, double* %4
%6 = call i32 @time(i32* %5)
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, 96
%9 = add nsw i32 %8, 1
%10 = mul nsw i32 %9, 2
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d 2 1\0A\00"
define void @printHeader(i32 %0, double %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @time(i32* %3)
%6 = mul i32 %0, 192
%7 = or i32 %6, 2
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
void _asm_generic2parm_retd_end(void) {}


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

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

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

LLVM IR (-O2):
define void @_asm_generic2parm_retd_end() {
ret void
}
int hash(char *s) {
  int h = 0;
  while (*s) {
    h += *s++;
    h <<= 1;
    if (h & (255 + 1))
      h |= 1;
  }
  return h & 255;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115c <hash+0x5c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     1157 <hash+0x57>
mov    -0xc(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     112f <hash+0x2f>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movzbl %al,%eax
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x7,%ecx
and    $0x1,%ecx
lea    (%rcx,%rax,2),%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
movzbl %cl,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i32 [ %14, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = zext i8 %5 to i32
%10 = add i32 %6, %9
%11 = shl i32 %10, 1
%12 = lshr i32 %10, 7
%13 = and i32 %12, 1
%14 = or i32 %13, %11
%15 = load i8, i8* %8
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4
%18 = and i32 %14, 255
br label %19
19: ; preds = %17, %1
%20 = phi i32 [ 0, %1 ], [ %18, %17 ]
ret i32 %20
}
const char *sgTTyType() { return "termio"; }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"termio\00"
define i8* @sgTTyType() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"termio\00"
define i8* @sgTTyType() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
unsigned long labs(scalar_t__);
scalar_t__ powl(long, int);
unsigned long solve_subtle(int N) {
  long res_s = 0;
  long s_res = 0;
  s_res = (long)N * ((long)N + 1L) / 2L;
  res_s = (s_res * (2L * (long)N + 1L)) / 3L;
  unsigned long res = labs(powl(s_res, 2) - res_s);
  return res;
}


x86 assembly (clang, -O0):
<solve_subtle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x4(%rbp),%rcx
add    $0x1,%rcx
imul   %rcx,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
shl    $0x1,%rcx
add    $0x1,%rcx
imul   %rcx,%rax
mov    $0x3,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1030 <powl@plt>
mov    %rax,%rdi
sub    -0x10(%rbp),%rdi
call   1040 <labs@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_subtle>:
push   %rbx
movslq %edi,%rax
lea    0x1(%rax),%rcx
imul   %rax,%rcx
mov    %rcx,%rdi
shr    $0x3f,%rdi
add    %rcx,%rdi
sar    %rdi
lea    (%rax,%rax,1),%rcx
add    $0x1,%rcx
imul   %rdi,%rcx
movabs $0x5555555555555555,%rdx
55 55 55
mov    %rcx,%rax
imul   %rdx
sub    %rcx,%rdx
mov    %rdx,%rbx
shr    $0x3f,%rbx
sar    %rdx
add    %rdx,%rbx
mov    $0x2,%esi
call   1030 <powl@plt>
add    %rbx,%rax
mov    %rax,%rcx
neg    %rcx
cmovns %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @solve_subtle(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
store i64 0, i64* %3
store i64 0, i64* %4
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, 1
%11 = mul nsw i64 %7, %10
%12 = sdiv i64 %11, 2
store i64 %12, i64* %4
%13 = load i64, i64* %4
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = mul nsw i64 2, %15
%17 = add nsw i64 %16, 1
%18 = mul nsw i64 %13, %17
%19 = sdiv i64 %18, 3
store i64 %19, i64* %3
%20 = load i64, i64* %4
%21 = call i64 @powl(i64 %20, i32 2)
%22 = load i64, i64* %3
%23 = sub nsw i64 %21, %22
%24 = call i64 @labs(i64 %23)
store i64 %24, i64* %5
%25 = load i64, i64* %5
ret i64 %25
}

LLVM IR (-O2):
define i64 @solve_subtle(i32 %0) {
%2 = sext i32 %0 to i64
%3 = add nsw i64 %2, 1
%4 = mul nsw i64 %3, %2
%5 = sdiv i64 %4, 2
%6 = shl nsw i64 %2, 1
%7 = or i64 %6, 1
%8 = mul nsw i64 %5, %7
%9 = sdiv i64 %8, -3
%10 = tail call i64 @powl(i64 %5, i32 2)
%11 = add i64 %10, %9
%12 = tail call i64 @llvm.abs.i64(i64 %11, i1 true)
ret i64 %12
}
/* Variables and functions */
size_t env_get_size(const char **env) {
  size_t size;
  size = 0;
  if (env) {
    while (env[size] != NULL)
      ++size;
  }
  return (size);
}


x86 assembly (clang, -O0):
<env_get_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <env_get_size+0x49>
jmp    1120 <env_get_size+0x20>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1144 <env_get_size+0x44>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <env_get_size+0x20>
jmp    1149 <env_get_size+0x49>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_get_size>:
test   %rdi,%rdi
je     1120 <env_get_size+0x20>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <env_get_size+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @env_get_size(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %4, %3 ]
ret i64 %10
}
void gtk_container_set_focus_hadjustment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_container_set_focus_hadjustment() {
ret void
}
int bld_sgl_op(int op, int bytemod, int as, int src, int ad, int dst) {
  int r;
  r = op | (bytemod << 6) | (as << 4) | (src << 8) | (as << 7) | dst;
  return r;
}


x86 assembly (clang, -O0):
<bld_sgl_op>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x6,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x7,%ecx
or     %ecx,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bld_sgl_op>:
shl    $0x6,%esi
or     %edi,%esi
mov    %edx,%eax
shl    $0x4,%eax
shl    $0x8,%ecx
shl    $0x7,%edx
or     %edx,%eax
or     %esi,%eax
or     %r9d,%ecx
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bld_sgl_op(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = shl i32 %1, 6
%8 = or i32 %7, %0
%9 = shl i32 %2, 4
%10 = or i32 %8, %9
%11 = shl i32 %3, 8
%12 = shl i32 %2, 7
%13 = or i32 %10, %12
%14 = or i32 %13, %11
%15 = or i32 %14, %5
ret i32 %15
}
/* Variables and functions */
double lcg_rand(unsigned long *);
double lcg_frand(unsigned long *seed) {
  return lcg_rand(seed) / ((double)(1 << 16) * (1 << 16));
}


x86 assembly (clang, -O0):
<lcg_frand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <lcg_rand@plt>
movsd  0xed3(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcg_frand>:
push   %rax
call   1030 <lcg_rand@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @lcg_frand(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = call double @lcg_rand(i64* %3)
%5 = fdiv double %4, 0x41F0000000000000
ret double %5
}

LLVM IR (-O2):
define double @lcg_frand(i64* %0) {
%2 = tail call double @lcg_rand(i64* %0)
%3 = fmul double %2, 0x3DF0000000000000
ret double %3
}
/* Variables and functions */
int setegid(int /*<<< orphan*/);
int seteuid(int /*<<< orphan*/);
void EUID_ROOT(void) {
  int rv = seteuid(0);
  rv |= setegid(0);
  (void)rv;
}


x86 assembly (clang, -O0):
<EUID_ROOT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <seteuid@plt>
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
call   1030 <setegid@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EUID_ROOT>:
push   %rax
xor    %edi,%edi
call   1040 <seteuid@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <setegid@plt>

LLVM IR (-O0):
define void @EUID_ROOT() {
%1 = alloca i32
%2 = call i32 @seteuid(i32 0)
store i32 %2, i32* %1
%3 = call i32 @setegid(i32 0)
%4 = load i32, i32* %1
%5 = or i32 %4, %3
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret void
}

LLVM IR (-O2):
define void @EUID_ROOT() {
%1 = tail call i32 @seteuid(i32 0)
%2 = tail call i32 @setegid(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wait(int *);
void handle(int s) {
  wait(&s);
  printf("child exit.....\n");
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <wait@plt>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <wait@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@str = [16 x i8] c"child exit.....\00"
define void @handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @wait(i32* %2)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
void I2CMasterIntDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = 0;
}


x86 assembly (clang, -O0):
<I2CMasterIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntDisable>:
movq   $0x0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterIntDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 16
%5 = inttoptr i64 %4 to i64*
store volatile i64 0, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntDisable(i64 %0) {
%2 = add i64 %0, 16
%3 = inttoptr i64 %2 to i64*
store volatile i64 0, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ ignoreReturnValue(int /*<<< orphan*/);
unsigned int fread_uint(FILE *fp) {
  unsigned int ret;
  ignoreReturnValue(fread(&ret, 4, 1, fp));
  return ret;
}


x86 assembly (clang, -O0):
<fread_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
mov    %eax,%edi
call   1030 <ignoreReturnValue@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fread_uint>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
mov    %eax,%edi
call   1030 <ignoreReturnValue@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fread_uint(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i32* %2, i32 4, i32 1, i32* %0)
%5 = tail call i32 @ignoreReturnValue(i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}
int _stp_perf_read_init(unsigned i, struct task_struct *pid) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @_stp_perf_read_init(i32 %0, %struct.task_struct* nocapture readnone %1) {
ret i32 0
}
int clamp_double(double *val, double min, double max) {
  if (*val < min) {
    *val = min;
    return 1;
  }
  if (*val > max) {
    *val = max;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<clamp_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <clamp_double+0x42>
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1175 <clamp_double+0x75>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    116e <clamp_double+0x6e>
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1175 <clamp_double+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_double>:
movsd  (%rdi),%xmm2
ucomisd %xmm2,%xmm0
ja     1116 <clamp_double+0x16>
xor    %eax,%eax
ucomisd %xmm1,%xmm2
movapd %xmm1,%xmm0
jbe    111f <clamp_double+0x1f>
movsd  %xmm0,(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @clamp_double(double* %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double
%7 = alloca double
store double* %0, double** %5
store double %1, double* %6
store double %2, double* %7
%8 = load double*, double** %5
%9 = load double, double* %8
%10 = load double, double* %6
%11 = fcmp olt double %9, %10
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load double, double* %6
%14 = load double*, double** %5
store double %13, double* %14
store i32 1, i32* %4
br label %24
15: ; preds = %3
%16 = load double*, double** %5
%17 = load double, double* %16
%18 = load double, double* %7
%19 = fcmp ogt double %17, %18
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load double, double* %7
%22 = load double*, double** %5
store double %21, double* %22
store i32 1, i32* %4
br label %24
23: ; preds = %15
store i32 0, i32* %4
br label %24
24: ; preds = %23, %20, %12
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @clamp_double(double* nocapture %0, double %1, double %2) {
%4 = load double, double* %0
%5 = fcmp olt double %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = fcmp ogt double %4, %2
br i1 %7, label %8, label %10
8: ; preds = %6, %3
%9 = phi double [ %1, %3 ], [ %2, %6 ]
store double %9, double* %0
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ 0, %6 ], [ 1, %8 ]
ret i32 %11
}
int okn_tsm_rot_x2(struct okn_tsm *t, float x) { return 1; }


x86 assembly (clang, -O0):
<okn_tsm_rot_x2>:
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_x2>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.okn_tsm = type opaque
define i32 @okn_tsm_rot_x2(%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_x2(%struct.okn_tsm* nocapture readnone %0, float %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ get_file(char *);
int /*<<< orphan*/ print_quotes(int /*<<< orphan*/);
int main() {
  print_quotes(get_file("rcg"));
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"rcg\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @get_file(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @print_quotes(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"rcg\00"
define i32 @main() {
%1 = tail call i32 @get_file(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_quotes(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printerror(char *);
int readchar();
int /*<<< orphan*/ skipwhite();
int /*<<< orphan*/ ungetchar(int);
int readseparator() {
  int c;
  skipwhite();
  c = readchar();
  if (c == ';' || c == ',') {
    skipwhite();
    return 1;
  } else {
    ungetchar(c);
    printerror("Separator expected");
    return 0;
  }
}


x86 assembly (clang, -O0):
<readseparator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <skipwhite@plt>
mov    $0x0,%al
call   1040 <readchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x3b,-0x8(%rbp)
je     116d <readseparator+0x2d>
cmpl   $0x2c,-0x8(%rbp)
jne    1180 <readseparator+0x40>
mov    $0x0,%al
call   1050 <skipwhite@plt>
movl   $0x1,-0x4(%rbp)
jmp    119b <readseparator+0x5b>
mov    -0x8(%rbp),%edi
call   1060 <ungetchar@plt>
lea    0xe71(%rip),%rdi
call   1030 <printerror@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readseparator>:
push   %rax
xor    %eax,%eax
call   1050 <skipwhite@plt>
xor    %eax,%eax
call   1040 <readchar@plt>
cmp    $0x3b,%eax
je     1159 <readseparator+0x19>
cmp    $0x2c,%eax
jne    1167 <readseparator+0x27>
xor    %eax,%eax
call   1050 <skipwhite@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    %eax,%edi
call   1060 <ungetchar@plt>
lea    0xe8b(%rip),%rdi
call   1030 <printerror@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Separator expected\00"
define i32 @readseparator() {
%1 = tail call i32 (...) @skipwhite()
%2 = tail call i32 (...) @readchar()
switch i32 %2, label %5 [
i32 59, label %3
i32 44, label %3
]
3: ; preds = %0, %0
%4 = tail call i32 (...) @skipwhite()
br label %8
5: ; preds = %0
%6 = tail call i32 @ungetchar(i32 %2)
%7 = tail call i32 @printerror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ 1, %3 ], [ 0, %5 ]
ret i32 %9
}
int test_imm_4Cint8_mem(signed char *val) {
  return ((*val) & (0x4C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Cint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 76
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int isupper(int ch) { return (ch >= 'A' && ch <= 'Z'); }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ *strpbrk(char const *, char const *);
int helpmod_is_lame_line(const char *line) {
  const char lamechars[] = {(char)2, (char)3, (char)22, (char)31, (char)0};
  if (strpbrk(line, lamechars) != NULL)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<helpmod_is_lame_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0xede(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xed9(%rip),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x15(%rbp),%rsi
call   1030 <strpbrk@plt>
cmp    $0x0,%rax
je     1151 <helpmod_is_lame_line+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1158 <helpmod_is_lame_line+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helpmod_is_lame_line>:
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0x1f160302,(%rsp)
mov    %rsp,%rsi
call   1030 <strpbrk@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.helpmod_is_lame_line.lamechars = [5 x i8] c"\02\03\16\1F\00"
define i32 @helpmod_is_lame_line(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [5 x i8]
store i8* %0, i8** %3
%5 = bitcast [5 x i8]* %4 to i8*
%6 = load i8*, i8** %3
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%8 = call i32* @strpbrk(i8* %6, i8* %7)
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@__const.helpmod_is_lame_line.lamechars = [5 x i8] c"\02\03\16\1F\00"
define i32 @helpmod_is_lame_line(i8* %0) {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = call i32* @strpbrk(i8* %0, i8* %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int close_output_file(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(192, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<close_output_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xc0,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_output_file>:
mov    $0xc0,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @close_output_file() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 192, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @close_output_file() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 192, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void append_char(char **string, int i, char c) {
  (*string)[i] = c;
  (*string)[i + 1] = '\0';
}


x86 assembly (clang, -O0):
<append_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_char>:
mov    (%rdi),%rax
movslq %esi,%rcx
mov    %dl,(%rax,%rcx,1)
mov    (%rdi),%rax
movb   $0x0,0x1(%rcx,%rax,1)
ret

LLVM IR (-O0):
define void @append_char(i8** %0, i32 %1, i8 signext %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %7, i8* %12
%13 = load i8**, i8*** %4
%14 = load i8*, i8** %13
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
store i8 0, i8* %18
ret void
}

LLVM IR (-O2):
define void @append_char(i8** nocapture %0, i32 %1, i8 signext %2) {
%4 = load i8*, i8** %0
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
store i8 %2, i8* %6
%7 = load i8*, i8** %0
%8 = add nsw i32 %1, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
store i8 0, i8* %10
ret void
}
int goal_state_destroy(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @goal_state_destroy() {
ret i32 0
}

LLVM IR (-O2):
define i32 @goal_state_destroy() {
ret i32 0
}
/* Type definitions */
struct ALGRAPH {
  int dummy;
};

/* Variables and functions */
struct ALGRAPH *kruskals(struct ALGRAPH *);
struct ALGRAPH *ALG_MST(struct ALGRAPH *G) {
  return kruskals(G);
}


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

x86 assembly (clang, -O2):
<ALG_MST>:
jmp    1030 <kruskals@plt>

LLVM IR (-O0):
%struct.ALGRAPH = type { i32 }
define %struct.ALGRAPH* @ALG_MST(%struct.ALGRAPH* %0) {
%2 = alloca %struct.ALGRAPH*
store %struct.ALGRAPH* %0, %struct.ALGRAPH** %2
%3 = load %struct.ALGRAPH*, %struct.ALGRAPH** %2
%4 = call %struct.ALGRAPH* @kruskals(%struct.ALGRAPH* %3)
ret %struct.ALGRAPH* %4
}

LLVM IR (-O2):
%struct.ALGRAPH = type { i32 }
define %struct.ALGRAPH* @ALG_MST(%struct.ALGRAPH* %0) {
%2 = tail call %struct.ALGRAPH* @kruskals(%struct.ALGRAPH* %0)
ret %struct.ALGRAPH* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int maxsubsum_4(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int maxsum;
  int nums[] = {10, -23, 54, 20, -12, -65, 44, 24, 12, 95, -45};
  maxsum = maxsubsum_4(nums, (int)(sizeof(nums) / sizeof(nums[0])));
  printf("Max sub sum is: %d\n", maxsum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x2c,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0xb,%esi
call   1030 <maxsubsum_4@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xb,%esi
call   1030 <maxsubsum_4@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.nums = [11 x i32] [i32 10, i32 -23, i32 54, i32 20, i32 -12, i32 -65, i32 44, i32 24, i32 12, i32 95, i32 -45]
@.str = [20 x i8] c"Max sub sum is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [11 x i32]
store i32 0, i32* %1
%4 = bitcast [11 x i32]* %3 to i8*
%5 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
%6 = call i32 @maxsubsum_4(i32* %5, i32 11)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [11 x i32] [i32 10, i32 -23, i32 54, i32 20, i32 -12, i32 -65, i32 44, i32 24, i32 12, i32 95, i32 -45]
@.str = [20 x i8] c"Max sub sum is: %d\0A\00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%4 = call i32 @maxsubsum_4(i32* %3, i32 11)
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
char *i() {
  char *p = __builtin_malloc(42);
  __builtin_memset(p, 3, 10);
  __builtin_memset(p, 7, 33);
  return p;
}


x86 assembly (clang, -O0):
<i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2a,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
mov    $0x21,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i>:
push   %rax
mov    $0x2a,%edi
call   1030 <malloc@plt>
movaps 0xede(%rip),%xmm0
movups %xmm0,(%rax)
movups %xmm0,0x10(%rax)
movb   $0x7,0x20(%rax)
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @i() {
%1 = tail call dereferenceable_or_null(42) i8* @malloc(i64 42)
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(33) %1, i8 7, i64 33, i1 false)
ret i8* %1
}
/* Variables and functions */
int strnatcmp0(char const *, char const *, int /*<<< orphan*/);
int strnatcmp(const char *a, const char *b) { return strnatcmp0(a, b, 0); }


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

x86 assembly (clang, -O2):
<strnatcmp>:
xor    %edx,%edx
jmp    1030 <strnatcmp0@plt>

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

LLVM IR (-O2):
define i32 @strnatcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strnatcmp0(i8* %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int rand();
unsigned char mk_rnd_u1() { return (rand() & 0x1); }


x86 assembly (clang, -O0):
<mk_rnd_u1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_rnd_u1>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @mk_rnd_u1() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 1
%3 = trunc i32 %2 to i8
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @mk_rnd_u1() {
%1 = tail call i32 (...) @rand()
%2 = trunc i32 %1 to i8
%3 = and i8 %2, 1
ret i8 %3
}
/* Variables and functions */
double sqrt(int);
double Tween_CircularOutEasing(double k) {
  --k;
  return sqrt(1 - (k * k));
}


x86 assembly (clang, -O0):
<Tween_CircularOutEasing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
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  0xea4(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tween_CircularOutEasing>:
addsd  0xee8(%rip),%xmm0
mulsd  %xmm0,%xmm0
movsd  0xee4(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @Tween_CircularOutEasing(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, -1.000000e+00
store double %4, double* %2
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fneg double %5
%8 = call double @llvm.fmuladd.f64(double %7, double %6, double 1.000000e+00)
%9 = fptosi double %8 to i32
%10 = call double @sqrt(i32 %9)
ret double %10
}

LLVM IR (-O2):
define double @Tween_CircularOutEasing(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = fneg double %2
%4 = tail call double @llvm.fmuladd.f64(double %3, double %2, double 1.000000e+00)
%5 = fptosi double %4 to i32
%6 = tail call double @sqrt(i32 %5)
ret double %6
}
int prod_get_number_seven(void) { return 7; }


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

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

LLVM IR (-O0):
define i32 @prod_get_number_seven() {
ret i32 7
}

LLVM IR (-O2):
define i32 @prod_get_number_seven() {
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
main() {
  char c = 65;
  switch (c) {
  case 'A':
    putchar('a');
    break;
  default:
    putchar('X');
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x5(%rbp)
mov    -0x5(%rbp),%al
sub    $0x41,%al
jne    1142 <main+0x32>
jmp    1133 <main+0x23>
mov    $0x61,%edi
call   1030 <putchar@plt>
jmp    114c <main+0x3c>
mov    $0x58,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 65, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %7 [
i32 65, label %5
]
5: ; preds = %0
%6 = call i32 @putchar(i8 signext 97)
br label %9
7: ; preds = %0
%8 = call i32 @putchar(i8 signext 88)
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 97)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void license_notice(void) {
  printf("bpt version %s -- Copyright (C) 2010  Amittai Aviram "
         "http://www.amittai.com\n",
         "1.8");
  printf("This program comes with ABSOLUTELY NO WARRANTY; for details "
         "type `show w'.\n"
         "This is free software, and you are welcome to redistribute it\n"
         "under certain conditions; type `show c' for details.\n\n");
}


x86 assembly (clang, -O0):
<license_notice>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf2b(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<license_notice>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf1e(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf14(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [77 x i8] c"bpt version %s -- Copyright (C) 2010 Amittai Aviram http://www.amittai.com\0A\00"
@.str.1 = [4 x i8] c"1.8\00"
@.str.2 = [192 x i8] c"This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions; type `show c' for details.\0A\0A\00"
define void @license_notice() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([192 x i8], [192 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [77 x i8] c"bpt version %s -- Copyright (C) 2010 Amittai Aviram http://www.amittai.com\0A\00"
@.str.1 = [4 x i8] c"1.8\00"
@str = [191 x i8] c"This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\0AThis is free software, and you are welcome to redistribute it\0Aunder certain conditions; type `show c' for details.\0A\00"
define void @license_notice() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([191 x i8], [191 x i8]* @str, i64 0, i64 0))
ret void
}