xunge/DecIR huggingface dataset:
int is_prime(int number) {
  int divide;
  for (divide = 2; divide < number; divide++) {
    if (number % divide == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <is_prime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <is_prime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <is_prime+0x50>
jmp    113b <is_prime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <is_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <is_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <is_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ testIIOCtl();
int /*<<< orphan*/ testMultiRW();
int /*<<< orphan*/ testRW();
int main(int argc, char *argv[]) {
  testRW();
  testMultiRW();
  testIIOCtl();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <testRW@plt>
mov    $0x0,%al
call   1030 <testMultiRW@plt>
mov    $0x0,%al
call   1040 <testIIOCtl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <testRW@plt>
xor    %eax,%eax
call   1030 <testMultiRW@plt>
xor    %eax,%eax
call   1040 <testIIOCtl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @testRW()
%7 = call i32 (...) @testMultiRW()
%8 = call i32 (...) @testIIOCtl()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testRW()
%4 = tail call i32 (...) @testMultiRW()
%5 = tail call i32 (...) @testIIOCtl()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bwputstr(char *);
void entry(void) {
  bwputstr("Whatever entry is...this is it.\n\r");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<entry>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <bwputstr@plt>
jmp    1120 <entry+0x10>

x86 assembly (clang, -O2):
<entry>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <bwputstr@plt>
nopl   (%rax)
jmp    1120 <entry+0x10>

LLVM IR (-O0):
@.str = [34 x i8] c"Whatever entry is...this is it.\0A\0D\00"
define void @entry() {
%1 = call i32 @bwputstr(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [34 x i8] c"Whatever entry is...this is it.\0A\0D\00"
define void @entry() {
%1 = tail call i32 @bwputstr(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello, World.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
long long zsss() { return 0x0000ffffffffffffLL; }


x86 assembly (clang, -O0):
<zsss>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zsss>:
movabs $0xffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @zsss() {
ret i64 281474976710655
}

LLVM IR (-O2):
define i64 @zsss() {
ret i64 281474976710655
}
long maxe(const long a, const long b) {
  if (a > b) {
    return a;
  } else if (b > a) {
    return b;
  } else if (b == a) {
    return a;
  }
}


x86 assembly (clang, -O0):
<maxe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <maxe+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <maxe+0x67>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1142 <maxe+0x42>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <maxe+0x67>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    115d <maxe+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <maxe+0x67>
jmp    1162 <maxe+0x62>
jmp    1167 <maxe+0x67>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxe>:
mov    %rsi,%rax
cmp    %rdi,%rsi
cmovle %rdi,%rax
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @maxe(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = icmp sgt i64 %1, %0
%5 = select i1 %4, i64 %1, i64 %0
%6 = select i1 %3, i64 %0, i64 %5
ret i64 %6
}
/* Type definitions */
struct ParseContext {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cleanUp(struct ParseContext *);
int /*<<< orphan*/ reportError(char const *, struct ParseContext *);
void reportAndClean(const char *ccaMessage, struct ParseContext *ppcContext) {
  reportError(ccaMessage, ppcContext);
  cleanUp(ppcContext);
}


x86 assembly (clang, -O0):
<reportAndClean>:
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 <reportError@plt>
mov    -0x10(%rbp),%rdi
call   1040 <cleanUp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reportAndClean>:
push   %rbx
mov    %rsi,%rbx
call   1030 <reportError@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <cleanUp@plt>

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

LLVM IR (-O2):
%struct.ParseContext = type { i32 }
define void @reportAndClean(i8* %0, %struct.ParseContext* %1) {
%3 = tail call i32 @reportError(i8* %0, %struct.ParseContext* %1)
%4 = tail call i32 @cleanUp(%struct.ParseContext* %1)
ret void
}
void WSBStartup(void) {}


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

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

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

LLVM IR (-O2):
define void @WSBStartup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void do_print(int thread_no, char *msg) {
  printf("[Thread: %d] %s\n", thread_no, msg);
}


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

x86 assembly (clang, -O2):
<do_print>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"[Thread: %d] %s\0A\00"
define void @do_print(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"[Thread: %d] %s\0A\00"
define void @do_print(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
_Bool Float__EQ_(float x, float y) { return x == y; }


x86 assembly (clang, -O0):
<Float__EQ_>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Float__EQ_>:
cmpeqss %xmm1,%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define zeroext i1 @Float__EQ_(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oeq float %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @Float__EQ_(float %0, float %1) {
%3 = fcmp oeq float %0, %1
ret i1 %3
}
/* Variables and functions */
int sumDivisors(int);
int abundant(int a) {
  int flag;
  int temp;
  temp = sumDivisors(a);
  if (temp > a) {
    flag = 1;
  } else {
    flag = 0;
  }
  return flag;
}


x86 assembly (clang, -O0):
<abundant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sumDivisors@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    113e <abundant+0x2e>
movl   $0x1,-0x8(%rbp)
jmp    1145 <abundant+0x35>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abundant>:
push   %rbx
mov    %edi,%ebx
call   1030 <sumDivisors@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setg   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @abundant(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @sumDivisors(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %3
br label %12
11: ; preds = %1
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @abundant(i32 %0) {
%2 = tail call i32 @sumDivisors(i32 %0)
%3 = icmp sgt i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef unsigned int wint_t;

/* Variables and functions */
int iswalpha(wint_t wc) { return (32U | wc) - 'a' < 26; }


x86 assembly (clang, -O0):
<iswalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x20,%eax
sub    $0x61,%eax
cmp    $0x1a,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswalpha>:
or     $0x20,%edi
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @iswalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 32, %3
%5 = sub i32 %4, 97
%6 = icmp ult i32 %5, 26
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @iswalpha(i32 %0) {
%2 = or i32 %0, 32
%3 = add i32 %2, -97
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int rand();
int randab(int a, int b) {
  int tmp;
  if (b < a) {
    tmp = a;
    a = b;
    b = tmp;
  }
  return (rand() % (b - a)) + a;
}


x86 assembly (clang, -O0):
<randab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113c <randab+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randab>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    %edi,%esi
mov    %esi,%ebp
cmovl  %edi,%ebp
cmovl  %esi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebx,%ebp
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randab(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
store i32 %10, i32* %5
%11 = load i32, i32* %4
store i32 %11, i32* %3
%12 = load i32, i32* %5
store i32 %12, i32* %4
br label %13
13: ; preds = %9, %2
%14 = call i32 (...) @rand()
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = sub nsw i32 %15, %16
%18 = srem i32 %14, %17
%19 = load i32, i32* %3
%20 = add nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @randab(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
%6 = tail call i32 (...) @rand()
%7 = sub nsw i32 %4, %5
%8 = srem i32 %6, %7
%9 = add nsw i32 %8, %5
ret i32 %9
}
/* Variables and functions */
char **Cvar_CompleteBuildListWithFlag(char const *, int);
char **Cvar_CompleteBuildListServer(const char *partial) {
  return Cvar_CompleteBuildListWithFlag(partial, 4);
}


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

x86 assembly (clang, -O2):
<Cvar_CompleteBuildListServer>:
mov    $0x4,%esi
jmp    1030 <Cvar_CompleteBuildListWithFlag@plt>

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

LLVM IR (-O2):
define i8** @Cvar_CompleteBuildListServer(i8* %0) {
%2 = tail call i8** @Cvar_CompleteBuildListWithFlag(i8* %0, i32 4)
ret i8** %2
}
int getMinInt() {
  return 1 << 31;
  return 1 << -1;
}


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

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

LLVM IR (-O0):
define i32 @getMinInt() {
ret i32 -2147483648
}

LLVM IR (-O2):
define i32 @getMinInt() {
ret i32 -2147483648
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void printStr(char *str, int k) {
  for (int i = 0; i < k; i++) {
    putchar(str[i]);
  }
  printf(" ");
}


x86 assembly (clang, -O0):
<printStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <printStr+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <printStr+0x16>
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStr>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <printStr+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printStr+0x20>
mov    $0x20,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printStr(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 32)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @putchar(i8 signext %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char *);
void error(char *function, char *error_message) {
  printf("%s(): %s\n", function, error_message);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"%s(): %s\0A\00"
define void @error(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 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s(): %s\0A\00"
define void @error(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ GLeeInit();
int pglXSwapIntervalSGI(int);
int _Lazy_glXSwapIntervalSGI(int interval) {
  if (GLeeInit())
    return pglXSwapIntervalSGI(interval);
  return (int)0;
}


x86 assembly (clang, -O0):
<_Lazy_glXSwapIntervalSGI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <GLeeInit@plt>
cmp    $0x0,%rax
je     114c <_Lazy_glXSwapIntervalSGI+0x2c>
mov    -0x8(%rbp),%edi
call   1040 <pglXSwapIntervalSGI@plt>
mov    %eax,-0x4(%rbp)
jmp    1153 <_Lazy_glXSwapIntervalSGI+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Lazy_glXSwapIntervalSGI>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <GLeeInit@plt>
test   %rax,%rax
je     1137 <_Lazy_glXSwapIntervalSGI+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <pglXSwapIntervalSGI@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_Lazy_glXSwapIntervalSGI(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @GLeeInit()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @pglXSwapIntervalSGI(i32 %7)
store i32 %8, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @_Lazy_glXSwapIntervalSGI(i32 %0) {
%2 = tail call i64 (...) @GLeeInit()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @pglXSwapIntervalSGI(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
struct genlist_link {
  int dummy;
};
struct fc_sockaddr_list_link {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_link_prev(struct genlist_link const *);
struct fc_sockaddr_list_link *
fc_sockaddr_list_link_prev(const struct fc_sockaddr_list_link *plink) {
  return ((struct fc_sockaddr_list_link *)genlist_link_prev(
      (const struct genlist_link *)plink));
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_link_prev>:
jmp    1030 <genlist_link_prev@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.fc_sockaddr_list_link* @fc_sockaddr_list_link_prev(%struct.fc_sockaddr_list_link* %0) {
%2 = alloca %struct.fc_sockaddr_list_link*
store %struct.fc_sockaddr_list_link* %0, %struct.fc_sockaddr_list_link** %2
%3 = load %struct.fc_sockaddr_list_link*, %struct.fc_sockaddr_list_link** %2
%4 = bitcast %struct.fc_sockaddr_list_link* %3 to %struct.genlist_link*
%5 = call i64 @genlist_link_prev(%struct.genlist_link* %4)
%6 = inttoptr i64 %5 to %struct.fc_sockaddr_list_link*
ret %struct.fc_sockaddr_list_link* %6
}

LLVM IR (-O2):
%struct.fc_sockaddr_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.fc_sockaddr_list_link* @fc_sockaddr_list_link_prev(%struct.fc_sockaddr_list_link* %0) {
%2 = bitcast %struct.fc_sockaddr_list_link* %0 to %struct.genlist_link*
%3 = tail call i64 @genlist_link_prev(%struct.genlist_link* %2)
%4 = inttoptr i64 %3 to %struct.fc_sockaddr_list_link*
ret %struct.fc_sockaddr_list_link* %4
}
/* Type definitions */
struct catmc_atomic_unsigned_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_unsigned_char *);
void catmc_atomic_unsigned_char_destroy(
    struct catmc_atomic_unsigned_char *wrapper) {
  free(wrapper);
}


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

x86 assembly (clang, -O2):
<catmc_atomic_unsigned_char_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.catmc_atomic_unsigned_char = type { i32 }
define void @catmc_atomic_unsigned_char_destroy(%struct.catmc_atomic_unsigned_char* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_unsigned_char* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *acquire_output_buffer(void *context, size_t size,
                            void **acquired_handle) {
  void *mem;
  ((void)(context));
  mem = malloc(size);
  *acquired_handle = mem;
  fprintf(stderr, "acquired output buffer, handle %p\n", *acquired_handle);
  return mem;
}


x86 assembly (clang, -O0):
<acquire_output_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acquire_output_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,(%r14)
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"acquired output buffer, handle %p\0A\00"
define i8* @acquire_output_buffer(i8* %0, i64 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8**
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8**, i8*** %6
store i8* %11, i8** %12
%13 = load i32, i32* @stderr
%14 = load i8**, i8*** %6
%15 = load i8*, i8** %14
%16 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"acquired output buffer, handle %p\0A\00"
define i8* @acquire_output_buffer(i8* nocapture readnone %0, i64 %1, i8** nocapture writeonly %2) {
%4 = tail call i8* @malloc(i64 %1)
store i8* %4, i8** %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i8* %4
}
int _thash_compare(const void *key1, const void *key2) {
  return (((unsigned long)key1) != ((unsigned long)key2));
}


x86 assembly (clang, -O0):
<_thash_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_thash_compare>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @_thash_compare(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 = ptrtoint i8* %5 to i64
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = icmp ne i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @_thash_compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int do_send(int, char *, char const *);
int irc_join(int fd, const char *channel) {
  return do_send(fd, "JOIN %s", channel);
}


x86 assembly (clang, -O0):
<irc_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rsi
call   1030 <do_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_join>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <do_send@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"JOIN %s\00"
define i32 @irc_join(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @do_send(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"JOIN %s\00"
define i32 @irc_join(i32 %0, i8* %1) {
%3 = tail call i32 @do_send(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS7;
typedef int /*<<< orphan*/ BIO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int PEM_write_bio_ASN1_stream(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *, int, char *,
                              int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS7_it;
int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags) {
  return PEM_write_bio_ASN1_stream(out, (ASN1_VALUE *)p7, in, flags, "PKCS7",
                                   &PKCS7_it);
}


x86 assembly (clang, -O0):
<PEM_write_bio_PKCS7_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xec3(%rip),%r8
mov    0x2e9c(%rip),%r9
call   1030 <PEM_write_bio_ASN1_stream@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_bio_PKCS7_stream>:
lea    0xee9(%rip),%r8
mov    0x2ec2(%rip),%r9
jmp    1030 <PEM_write_bio_ASN1_stream@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"PKCS7\00"
@PKCS7_it = global i32 0
define i32 @PEM_write_bio_PKCS7_stream(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @PEM_write_bio_ASN1_stream(i32* %9, i32* %10, i32* %11, i32 %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* @PKCS7_it)
ret i32 %13
}

LLVM IR (-O2):
@.str = [6 x i8] c"PKCS7\00"
@PKCS7_it = global i32 0
define i32 @PEM_write_bio_PKCS7_stream(i32* %0, i32* %1, i32* %2, i32 %3) {
%5 = tail call i32 @PEM_write_bio_ASN1_stream(i32* %0, i32* %1, i32* %2, i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* @PKCS7_it)
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void reset_ctrl() {
  uint32_t val;
  val = (*(volatile uint32_t *)((0x40048000 + 0x004)));
  val |= 1 << (3);
  (*(volatile uint32_t *)((0x40048000 + 0x004)) = (val));
}


x86 assembly (clang, -O0):
<reset_ctrl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40048004,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x40048004,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_ctrl>:
orl    $0x8,0x40048004
08
ret

LLVM IR (-O0):
define void @reset_ctrl() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1074036740 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 8
store i32 %4, i32* %1
%5 = load i32, i32* %1
store volatile i32 %5, i32* inttoptr (i64 1074036740 to i32*)
ret void
}

LLVM IR (-O2):
define void @reset_ctrl() {
%1 = load volatile i32, i32* inttoptr (i64 1074036740 to i32*)
%2 = or i32 %1, 8
store volatile i32 %2, i32* inttoptr (i64 1074036740 to i32*)
ret void
}
/* Type definitions */
struct mloop_timer {
  int dummy;
};

/* Variables and functions */
int mloop__unref_any(struct mloop_timer *);
__attribute__((visibility("default"))) int
mloop_timer_unref(struct mloop_timer *self) {
  return mloop__unref_any(self);
}


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

x86 assembly (clang, -O2):
<mloop_timer_unref>:
jmp    1030 <mloop__unref_any@plt>

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

LLVM IR (-O2):
%struct.mloop_timer = type { i32 }
define i32 @mloop_timer_unref(%struct.mloop_timer* %0) {
%2 = tail call i32 @mloop__unref_any(%struct.mloop_timer* %0)
ret i32 %2
}
/* Variables and functions */
int strcmp(char *, char *);
int strptrcmp(const void *a, const void *b) {
  return strcmp((char *)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<strptrcmp>:
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @strptrcmp(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 = bitcast i8* %6 to i8**
%8 = load i8*, i8** %7
%9 = call i32 @strcmp(i8* %5, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @strptrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %4)
ret i32 %5
}
const char *td_curses_version(void) { return "None"; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"None\00"
define i8* @td_curses_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
void foo522(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo522(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int SPI_getMode(int);
int SPI_getClockMode(int spidev_fd) {
  uint8_t clock_mode;
  clock_mode = SPI_getMode(spidev_fd);
  if (clock_mode < 0)
    return clock_mode;
  return clock_mode & 0x3;
}


x86 assembly (clang, -O0):
<SPI_getClockMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <SPI_getMode@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    113b <SPI_getClockMode+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <SPI_getClockMode+0x34>
mov    -0xc(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_getClockMode>:
push   %rax
call   1030 <SPI_getMode@plt>
mov    %eax,%ecx
and    $0x3,%ecx
test   %eax,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SPI_getClockMode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @SPI_getMode(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = and i32 %12, 3
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @SPI_getClockMode(i32 %0) {
%2 = tail call i32 @SPI_getMode(i32 %0)
%3 = icmp slt i32 %2, 0
%4 = and i32 %2, 3
%5 = select i1 %3, i32 %2, i32 %4
ret i32 %5
}
int f(int x, int y) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b;
  char c;
  char s[32];
  scanf("%d", &a);
  printf("%d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
int airtime_policy_update_init(struct hostapd_iface *iface) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define i32 @airtime_policy_update_init(%struct.hostapd_iface* nocapture readnone %0) {
ret i32 -1
}
int is_alpha(char c) {
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <is_alpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <is_alpha+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <is_alpha+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_alpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
int max(int a, int b, int c) {
  if (a < b)
    a = b;
  if (a < c)
    a = c;
  return a;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    111f <max+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1131 <max+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tm_normalize(struct tm *);
time_t tm_tobinary(struct tm date) { return tm_normalize(&date); }


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

x86 assembly (clang, -O2):
<tm_tobinary>:
push   %rax
mov    %edi,(%rsp)
mov    %rsp,%rdi
call   1030 <tm_normalize@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @tm_tobinary(i32 %0) {
%2 = alloca %struct.tm
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
store i32 %0, i32* %3
%4 = call i32 @tm_normalize(%struct.tm* %2)
ret i32 %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @tm_tobinary(i32 %0) {
%2 = alloca %struct.tm
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
store i32 %0, i32* %3
%4 = call i32 @tm_normalize(%struct.tm* %2)
ret i32 %4
}
/* Variables and functions */
int ifile(char *);
int rlreply(char *, char *, int);
int insfile(int f, int n) {
  int s;
  char fname[80];
  if ((s = rlreply("Insert file: ", fname, 80)) != 1)
    return (s);
  return (ifile(fname));
}


x86 assembly (clang, -O0):
<insfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x60(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x50,%edx
call   1030 <rlreply@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x1,%eax
je     115a <insfile+0x3a>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <insfile+0x46>
lea    -0x60(%rbp),%rdi
call   1040 <ifile@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insfile>:
sub    $0x58,%rsp
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
mov    $0x50,%edx
call   1030 <rlreply@plt>
cmp    $0x1,%eax
jne    1145 <insfile+0x25>
mov    %rsp,%rdi
call   1040 <ifile@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Insert file: \00"
define i32 @insfile(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [80 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%9 = call i32 @rlreply(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %8, i32 80)
store i32 %9, i32* %6
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %6
store i32 %12, i32* %3
br label %16
13: ; preds = %2
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i64 0, i64 0
%15 = call i32 @ifile(i8* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [14 x i8] c"Insert file: \00"
define i32 @insfile(i32 %0, i32 %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = call i32 @rlreply(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4, i32 80)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @ifile(i8* %4)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %5, %2 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __wsum;
typedef int /*<<< orphan*/ __sum16;
typedef int /*<<< orphan*/ __be32;

/* Variables and functions */
int /*<<< orphan*/ csum_fold(int /*<<< orphan*/);
int /*<<< orphan*/ csum_tcpudp_nofold(int /*<<< orphan*/, int /*<<< orphan*/,
                                      unsigned short, unsigned short,
                                      int /*<<< orphan*/);
__sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
                          unsigned short proto, __wsum sum) {
  return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
}


x86 assembly (clang, -O0):
<csum_tcpudp_magic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    %r8d,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xa(%rbp),%cx
mov    -0xc(%rbp),%ax
mov    -0x10(%rbp),%r8d
movzwl %cx,%edx
movzwl %ax,%ecx
call   1040 <csum_tcpudp_nofold@plt>
mov    %eax,%edi
call   1030 <csum_fold@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csum_tcpudp_magic>:
push   %rax
call   1040 <csum_tcpudp_nofold@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <csum_fold@plt>

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

LLVM IR (-O2):
define i32 @csum_tcpudp_magic(i32 %0, i32 %1, i16 zeroext %2, i16 zeroext %3, i32 %4) {
%6 = tail call i32 @csum_tcpudp_nofold(i32 %0, i32 %1, i16 zeroext %2, i16 zeroext %3, i32 %4)
%7 = tail call i32 @csum_fold(i32 %6)
ret i32 %7
}
void gather_variable(double *var) {}


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

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

LLVM IR (-O0):
define void @gather_variable(double* %0) {
%2 = alloca double*
store double* %0, double** %2
ret void
}

LLVM IR (-O2):
define void @gather_variable(double* nocapture %0) {
ret void
}