xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_server_create() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_server_create>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_server_create>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_server_create() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_server_create() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void StartCalibration(void) {}


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

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

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

LLVM IR (-O2):
define void @StartCalibration() {
ret void
}
int needsextension(char *name) {
  while (*name)
    if (*name++ == '.')
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<needsextension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <needsextension+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    113c <needsextension+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1148 <needsextension+0x48>
jmp    1108 <needsextension+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<needsextension>:
movzbl (%rdi),%eax
test   %al,%al
je     1112 <needsextension+0x12>
add    $0x1,%rdi
cmp    $0x2e,%al
jne    1100 <needsextension>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @needsextension(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = icmp eq i8 %4, 46
br i1 %8, label %9, label %2
9: ; preds = %2, %6
%10 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %10
}
unsigned xrop3_241_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | S;
  stk2 = ~stk2;
  stk1 = T | stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

x86 assembly (clang, -O2):
<xrop3_241_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rdi,1),%edx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    $0xffffff00,%ecx
and    %eax,%edx
not    %eax
and    %ecx,%eax
not    %edi
and    %esi,%edi
or     %edi,%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_241_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = xor i32 %4, -256
%9 = and i32 %7, %5
%10 = xor i32 %7, -1
%11 = and i32 %8, %10
%12 = xor i32 %3, -1
%13 = and i32 %12, %6
%14 = or i32 %11, %13
%15 = or i32 %14, %9
ret i32 %15
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
int /*<<< orphan*/ vmefail();
char *xstrdup(const char *str) {
  size_t size = strlen(str) + 1;
  char *newstr = (char *)malloc(size);
  if (newstr == NULL)
    vmefail();
  strcpy(newstr, str);
  return newstr;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117d <xstrdup+0x3d>
mov    $0x0,%al
call   1060 <vmefail@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1166 <xstrdup+0x26>
xor    %eax,%eax
call   1060 <vmefail@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i64 @malloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = call i32 (...) @vmefail()
br label %16
16: ; preds = %14, %1
%17 = load i8*, i8** %4
%18 = load i8*, i8** %2
%19 = call i32 @strcpy(i8* %17, i8* %18)
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i32 (...) @vmefail()
br label %10
10: ; preds = %8, %1
%11 = tail call i32 @strcpy(i8* %6, i8* %0)
ret i8* %6
}
int do_message_long(client, dummy)
struct client *client;
char **dummy;
{
  _do_message(client, 1);
  return 0;
}


x86 assembly (clang, -O0):
<do_message_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <_do_message@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_message_long>:
push   %rax
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <_do_message@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.client = type opaque
define i32 @do_message_long(%struct.client* %0, i8** %1) {
%3 = alloca %struct.client*
%4 = alloca i8**
store %struct.client* %0, %struct.client** %3
store i8** %1, i8*** %4
%5 = load %struct.client*, %struct.client** %3
%6 = call i32 (%struct.client*, i32, ...) bitcast (i32 (...)* @_do_message to i32 (%struct.client*, i32, ...)*)(%struct.client* %5, i32 1)
ret i32 0
}

LLVM IR (-O2):
%struct.client = type opaque
define i32 @do_message_long(%struct.client* %0, i8** nocapture readnone %1) {
%3 = tail call i32 (%struct.client*, i32, ...) bitcast (i32 (...)* @_do_message to i32 (%struct.client*, i32, ...)*)(%struct.client* %0, i32 1)
ret i32 0
}
/* Variables and functions */
scalar_t__ EOF;
int EXIT_SUCCESS;
scalar_t__ getint(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a;
  while (getint(&a) != EOF) {
    printf("%d\n", a);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <getint@plt>
mov    0x2ea9(%rip),%rcx
cmp    (%rcx),%rax
je     115c <main+0x3c>
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1040 <getint@plt>
mov    0x2eae(%rip),%r15
cmp    (%r15),%rax
je     1169 <main+0x49>
lea    0xeba(%rip),%r14
lea    0xc(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <getint@plt>
cmp    (%r15),%rax
jne    1150 <main+0x30>
mov    0x2e68(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i64 @getint(i32* %2)
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %3
10: ; preds = %3
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @getint(i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i64 @getint(i32* %1)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %0
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}
int test_solution() {}


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

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

LLVM IR (-O0):
define i32 @test_solution() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @test_solution() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exp(double);
double log1p(int /*<<< orphan*/);
double log_sum(double log_a, double log_b) {
  if (log_a > log_b) {
    return log_a + log1p(exp(log_b - log_a));
  } else {
    return log_b + log1p(exp(log_a - log_b));
  }
}


x86 assembly (clang, -O0):
<log_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1178 <log_sum+0x58>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
mov    %eax,%edi
call   1040 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a9 <log_sum+0x89>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
mov    %eax,%edi
call   1040 <log1p@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_sum>:
push   %rax
movapd %xmm0,%xmm4
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
movapd %xmm1,%xmm3
subsd  %xmm0,%xmm3
movapd %xmm1,%xmm0
cmpltsd %xmm4,%xmm0
andpd  %xmm0,%xmm3
andnpd %xmm2,%xmm0
orpd   %xmm3,%xmm0
maxsd  %xmm1,%xmm4
movsd  %xmm4,(%rsp)
call   1030 <exp@plt>
mov    %eax,%edi
call   1040 <log1p@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @log_sum(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = fsub double %0, %1
%5 = fsub double %1, %0
%6 = select i1 %3, double %5, double %4
%7 = select i1 %3, double %0, double %1
%8 = tail call i32 @exp(double %6)
%9 = tail call double @log1p(i32 %8)
%10 = fadd double %9, %7
ret double %10
}
/* Type definitions */
struct havege_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ r_int(struct havege_state *, void *);
void r_u_int(struct havege_state *state, unsigned int *i) {
  r_int(state, (void *)i);
}


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

x86 assembly (clang, -O2):
<r_u_int>:
jmp    1030 <r_int@plt>

LLVM IR (-O0):
%struct.havege_state = type { i32 }
define void @r_u_int(%struct.havege_state* %0, i32* %1) {
%3 = alloca %struct.havege_state*
%4 = alloca i32*
store %struct.havege_state* %0, %struct.havege_state** %3
store i32* %1, i32** %4
%5 = load %struct.havege_state*, %struct.havege_state** %3
%6 = load i32*, i32** %4
%7 = bitcast i32* %6 to i8*
%8 = call i32 @r_int(%struct.havege_state* %5, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.havege_state = type { i32 }
define void @r_u_int(%struct.havege_state* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @r_int(%struct.havege_state* %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putCommand(int);
void lcdHome() { putCommand(0x02); }


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

x86 assembly (clang, -O2):
<lcdHome>:
mov    $0x2,%edi
jmp    1030 <putCommand@plt>

LLVM IR (-O0):
define void @lcdHome() {
%1 = call i32 @putCommand(i32 2)
ret void
}

LLVM IR (-O2):
define void @lcdHome() {
%1 = tail call i32 @putCommand(i32 2)
ret void
}
unsigned int round_up_to_power_of_two(unsigned int v) {
  v--;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  v++;
  return (v);
}


x86 assembly (clang, -O0):
<round_up_to_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up_to_power_of_two>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @round_up_to_power_of_two(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
/* Type definitions */
struct _childs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ trie_add_first_n_childs(struct _childs *const, int);
void trie_add_first_two_childs(struct _childs *const childs) {
  trie_add_first_n_childs(childs, 2);
}


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

x86 assembly (clang, -O2):
<trie_add_first_two_childs>:
mov    $0x2,%esi
jmp    1030 <trie_add_first_n_childs@plt>

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

LLVM IR (-O2):
%struct._childs = type { i32 }
define void @trie_add_first_two_childs(%struct._childs* %0) {
%2 = tail call i32 @trie_add_first_n_childs(%struct._childs* %0, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void panic(char *s) {
  printf("%s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @panic(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct i8x_object {
  int dummy;
};
struct i8x_funcref {
  int dummy;
};

/* Variables and functions */
void *i8x_ob_get_userdata(struct i8x_object *);
void *__attribute__((always_)) i8x_funcref_get_userdata(struct i8x_funcref *x) {
  return i8x_ob_get_userdata((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_funcref_get_userdata>:
jmp    1030 <i8x_ob_get_userdata@plt>

LLVM IR (-O0):
%struct.i8x_funcref = type { i32 }
%struct.i8x_object = type { i32 }
define i8* @i8x_funcref_get_userdata(%struct.i8x_funcref* %0) {
%2 = alloca %struct.i8x_funcref*
store %struct.i8x_funcref* %0, %struct.i8x_funcref** %2
%3 = load %struct.i8x_funcref*, %struct.i8x_funcref** %2
%4 = bitcast %struct.i8x_funcref* %3 to %struct.i8x_object*
%5 = call i8* @i8x_ob_get_userdata(%struct.i8x_object* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.i8x_funcref = type { i32 }
%struct.i8x_object = type { i32 }
define i8* @i8x_funcref_get_userdata(%struct.i8x_funcref* %0) {
%2 = bitcast %struct.i8x_funcref* %0 to %struct.i8x_object*
%3 = tail call i8* @i8x_ob_get_userdata(%struct.i8x_object* %2)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t readl(const void *addr) { return *((volatile uint32_t *)addr); }


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

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

LLVM IR (-O0):
define i32 @readl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @readl(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
void *exam201409_32_malloc(unsigned long);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned long);
void *exam201409_32_calloc(unsigned long count, unsigned long size) {
  unsigned long len = count * size;
  void *p = exam201409_32_malloc(len);
  if (p)
    memset(p, 0, len);
  return (p);
}


x86 assembly (clang, -O0):
<exam201409_32_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <exam201409_32_malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1164 <exam201409_32_calloc+0x44>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exam201409_32_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <exam201409_32_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <exam201409_32_calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @exam201409_32_calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @exam201409_32_malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
_Bool allBitsSet(const int flags, const int mask) {
  if (~flags & mask)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<allBitsSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1125 <allBitsSet+0x25>
movb   $0x0,-0x1(%rbp)
jmp    1129 <allBitsSet+0x29>
movb   $0x1,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<allBitsSet>:
not    %edi
test   %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define zeroext i1 @allBitsSet(i32 %0, i32 %1) {
%3 = alloca i1
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = xor i32 %6, -1
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i1 false, i1* %3
br label %13
12: ; preds = %2
store i1 true, i1* %3
br label %13
13: ; preds = %12, %11
%14 = load i1, i1* %3
ret i1 %14
}

LLVM IR (-O2):
define zeroext i1 @allBitsSet(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = and i32 %3, %1
%5 = icmp eq i32 %4, 0
ret i1 %5
}
int test_imm_A0int16_reg(short val) {
  return ((val) & (0xA0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A0int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xa0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_A0int16_reg(i16 signext %0) {
%2 = and i16 %0, 160
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
vdfram(type) int *type;
{ vifram(type); }


x86 assembly (clang, -O0):
<vdfram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <vifram@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @vdfram(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i32 (i32*, ...) bitcast (i32 (...)* @vifram to i32 (i32*, ...)*)(i32* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @vdfram(i32* %0) {
%2 = tail call i32 (i32*, ...) bitcast (i32 (...)* @vifram to i32 (i32*, ...)*)(i32* %0)
ret i32 undef
}
int dns_v_rel(void) { return 0x20130619; }


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

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

LLVM IR (-O0):
define i32 @dns_v_rel() {
ret i32 538117657
}

LLVM IR (-O2):
define i32 @dns_v_rel() {
ret i32 538117657
}
int test_imm_B7int8_reg(signed char val) {
  return ((val) & (0xB7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B7int8_reg(i8 signext %0) {
%2 = and i8 %0, -73
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ pipe(int *);
void pipe_aux(int pipes[2]) {
  if (pipe(pipes)) {
    error("esh: pipe creation failed.");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<pipe_aux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pipe@plt>
cmp    $0x0,%rax
je     1169 <pipe_aux+0x39>
lea    0xeaa(%rip),%rdi
call   1040 <error@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe_aux>:
push   %rax
call   1030 <pipe@plt>
test   %rax,%rax
jne    113d <pipe_aux+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <error@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"esh: pipe creation failed.\00"
@EXIT_FAILURE = global i32 0
define void @pipe_aux(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pipe(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"esh: pipe creation failed.\00"
@EXIT_FAILURE = global i32 0
define void @pipe_aux(i32* %0) {
%2 = tail call i64 @pipe(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
int pmi_simple_client_kvs_commit(struct pmi_simple_client *pmi,
                                 const char *kvsname) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.pmi_simple_client = type opaque
define i32 @pmi_simple_client_kvs_commit(%struct.pmi_simple_client* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ function_with_leak4(int);
void use_function_with_leak4(int y) { function_with_leak4(y); }


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

x86 assembly (clang, -O2):
<use_function_with_leak4>:
jmp    1030 <function_with_leak4@plt>

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

LLVM IR (-O2):
define void @use_function_with_leak4(i32 %0) {
%2 = tail call i32 @function_with_leak4(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ install_pmcl_exception_handlers();
void exception_init() { install_pmcl_exception_handlers(); }


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

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

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

LLVM IR (-O2):
define void @exception_init() {
%1 = tail call i32 (...) @install_pmcl_exception_handlers()
ret void
}
/* Variables and functions */
float sqrt(int);
float sq_diagonal_perimeter(float perimeter) {
  float square_root_2 = sqrt(2);
  float diagonal = (perimeter / 4) * square_root_2;
  return diagonal;
}


x86 assembly (clang, -O0):
<sq_diagonal_perimeter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xec7(%rip),%xmm1
divss  %xmm1,%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sq_diagonal_perimeter>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x2,%edi
call   1030 <sqrt@plt>
movss  0x4(%rsp),%xmm1
mulss  0xed1(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sq_diagonal_perimeter(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = call float @sqrt(i32 2)
store float %5, float* %3
%6 = load float, float* %2
%7 = fdiv float %6, 4.000000e+00
%8 = load float, float* %3
%9 = fmul float %7, %8
store float %9, float* %4
%10 = load float, float* %4
ret float %10
}

LLVM IR (-O2):
define float @sq_diagonal_perimeter(float %0) {
%2 = tail call float @sqrt(i32 2)
%3 = fmul float %0, 2.500000e-01
%4 = fmul float %3, %2
ret float %4
}
int ld_bun_mm2(long double *a1, long double *a2) {
  return !(__builtin_isunordered(*a1, *a2));
}


x86 assembly (clang, -O0):
<ld_bun_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bun_mm2>:
fldt   (%rdi)
fldt   (%rsi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %al
ret

LLVM IR (-O0):
define i32 @ld_bun_mm2(x86_fp80* %0, x86_fp80* %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80*, x86_fp80** %4
%8 = load x86_fp80, x86_fp80* %7
%9 = fcmp uno x86_fp80 %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @ld_bun_mm2(x86_fp80* nocapture %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = load x86_fp80, x86_fp80* %1
%5 = fcmp ord x86_fp80 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void glUniform3f(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniform3f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x41() {
  Assert_real((iscntrl(65) == 0),
              "/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/ctype/test_iscntrl.c",
              330, ("iscntrl should be 0 for A"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x41>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x14a,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x41>:
push   %rax
mov    $0x41,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x14a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for A\00"
define void @t_iscntrl_0x41() {
%1 = call i64 @iscntrl(i32 65)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 330, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for A\00"
define void @t_iscntrl_0x41() {
%1 = tail call i64 @iscntrl(i32 65)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 330, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char **cm_argvarg(char const *const *, char const *);
int cm_argvpos(char const *const *argv, char const *arg) {
  char **a = cm_argvarg(argv, arg);
  if (a)
    return a - (char **)argv;
  else
    return -1;
}


x86 assembly (clang, -O0):
<cm_argvpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <cm_argvarg@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1153 <cm_argvpos+0x43>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sar    $0x3,%rax
mov    %eax,-0x4(%rbp)
jmp    115a <cm_argvpos+0x4a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cm_argvpos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <cm_argvarg@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
shr    $0x3,%rcx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cm_argvpos(i8** %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8**
store i8** %0, i8*** %4
store i8* %1, i8** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %5
%9 = call i8** @cm_argvarg(i8** %7, i8* %8)
store i8** %9, i8*** %6
%10 = load i8**, i8*** %6
%11 = icmp ne i8** %10, null
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = load i8**, i8*** %6
%14 = load i8**, i8*** %4
%15 = ptrtoint i8** %13 to i64
%16 = ptrtoint i8** %14 to i64
%17 = sub i64 %15, %16
%18 = sdiv exact i64 %17, 8
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
br label %21
20: ; preds = %2
store i32 -1, i32* %3
br label %21
21: ; preds = %20, %12
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @cm_argvpos(i8** %0, i8* %1) {
%3 = tail call i8** @cm_argvarg(i8** %0, i8* %1)
%4 = icmp eq i8** %3, null
%5 = ptrtoint i8** %3 to i64
%6 = ptrtoint i8** %0 to i64
%7 = sub i64 %5, %6
%8 = lshr exact i64 %7, 3
%9 = trunc i64 %8 to i32
%10 = select i1 %4, i32 -1, i32 %9
ret i32 %10
}
int function(void) {
  static int i, state = 0;
  switch (state) {
  case 0:
    for (i = 0; i < 10; i++) {
      state = 19 + 2;
      return i;
    case 21:;
    }
  }
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1e(%rip),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     112b <function+0x2b>
jmp    111a <function+0x1a>
mov    -0x8(%rbp),%eax
sub    $0x15,%eax
je     115a <function+0x5a>
jmp    1178 <function+0x78>
movl   $0x0,0x2eef(%rip)
cmpl   $0xa,0x2ee8(%rip)
jge    1173 <function+0x73>
movl   $0x15,0x2edc(%rip)
mov    0x2ed2(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <function+0x78>
jmp    115f <function+0x5f>
mov    0x2ebf(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eb6(%rip)
jmp    1135 <function+0x35>
jmp    1178 <function+0x78>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
mov    0x2f1e(%rip),%ecx
add    $0x1,%ecx
xor    %eax,%eax
cmpb   $0x0,0x2f16(%rip)
cmovne %ecx,%eax
mov    %eax,0x2f09(%rip)
cmp    $0x9,%eax
jg     1127 <function+0x27>
movb   $0x1,0x2f01(%rip)
ret

LLVM IR (-O0):
@function.i = internal global i32 0
@function.state = internal global i32 0
define i32 @function() {
%1 = alloca i32
%2 = load i32, i32* @function.state
switch i32 %2, label %14 [
i32 0, label %3
i32 21, label %9
]
3: ; preds = %0
store i32 0, i32* @function.i
br label %4
4: ; preds = %10, %3
%5 = load i32, i32* @function.i
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
store i32 21, i32* @function.state
%8 = load i32, i32* @function.i
store i32 %8, i32* %1
br label %14
9: ; preds = %0
br label %10
10: ; preds = %9
%11 = load i32, i32* @function.i
%12 = add nsw i32 %11, 1
store i32 %12, i32* @function.i
br label %4
13: ; preds = %4
br label %14
14: ; preds = %7, %13, %0
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@function.i = internal unnamed_addr global i32 0
@function.state = internal unnamed_addr global i1 false
define i32 @function() {
%1 = load i1, i1* @function.state
%2 = load i32, i32* @function.i
%3 = add nsw i32 %2, 1
%4 = select i1 %1, i32 %3, i32 0
store i32 %4, i32* @function.i
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %0
store i1 true, i1* @function.state
br label %7
7: ; preds = %0, %6
ret i32 %4
}
void yy_1_PostParaWsMore(char *yytext, int yyleng) {
  ;
  ;
}


x86 assembly (clang, -O0):
<yy_1_PostParaWsMore>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @yy_1_PostParaWsMore(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ setgid(int /*<<< orphan*/);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
void main(void) {
  setuid(0);
  setgid(0);
  execl("/bin/sh", "sh", NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <setuid@plt>
xor    %edi,%edi
call   1030 <setgid@plt>
lea    0xeb7(%rip),%rdi
lea    0xeb5(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <execl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <setuid@plt>
xor    %edi,%edi
call   1030 <setgid@plt>
lea    0xeba(%rip),%rdi
lea    0xeb8(%rip),%rsi
xor    %edx,%edx
pop    %rax
jmp    1050 <execl@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"sh\00"
define void @main() {
%1 = call i32 @setuid(i32 0)
%2 = call i32 @setgid(i32 0)
%3 = call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"sh\00"
define void @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @setgid(i32 0)
%3 = tail call i32 @execl(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ cc_t;

/* Variables and functions */
cc_t special_char_decode(u_int c) { return c; }


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

x86 assembly (clang, -O2):
<special_char_decode>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @special_char_decode(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_dup(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_NAME_it;
X509_NAME *X509_NAME_dup(X509_NAME *x) {
  return ASN1_item_dup(&X509_NAME_it, x);
}


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

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

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

LLVM IR (-O2):
@X509_NAME_it = global i32 0
define i32* @X509_NAME_dup(i32* %0) {
%2 = tail call i32* @ASN1_item_dup(i32* @X509_NAME_it, i32* %0)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("_OPENMP is not defined; is OpenMP compilation working?\n");
  return 1;
}


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>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [56 x i8] c"_OPENMP is not defined; is OpenMP compilation working?\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [55 x i8] c"_OPENMP is not defined; is OpenMP compilation working?\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
ret i32 1
}
int g(void) {
  volatile int x;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @g() {
ret i32 0
}