xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int num, numero;
  scanf("%d", &num);
  scanf("%d", &numero);
  printf("%d", num + numero);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeb1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
lea    0xe92(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 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* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
char *print_dec_1(val)
unsigned long val;
{
  static char vbuf[32];
  sprintf(vbuf, "%lu", val);
  return vbuf;
}


x86 assembly (clang, -O0):
<print_dec_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0x2f19(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2f04(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_dec_1>:
push   %rbx
mov    %rdi,%rdx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@print_dec_1.vbuf = internal global [32 x i8] zeroinitializer
@.str = [4 x i8] c"%lu\00"
define i8* @print_dec_1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @print_dec_1.vbuf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @print_dec_1.vbuf, i64 0, i64 0)
}

LLVM IR (-O2):
@print_dec_1.vbuf = internal global [32 x i8] zeroinitializer
@.str = [4 x i8] c"%lu\00"
define i8* @print_dec_1(i64 %0) {
%2 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @print_dec_1.vbuf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @print_dec_1.vbuf, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int _mm_ucomigt_sd(int /*<<< orphan*/, int /*<<< orphan*/);
int test_mm_ucomigt_sd(__m128d A, __m128d B) { return _mm_ucomigt_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_ucomigt_sd>:
jmp    1030 <_mm_ucomigt_sd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_ucomigt_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_ucomigt_sd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ ft_islower(int);
scalar_t__ ft_isupper(int);
int ft_isalpha(int c) { return (ft_isupper(c) || ft_islower(c)); }


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ft_isupper@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <ft_isalpha+0x37>
mov    -0x4(%rbp),%edi
call   1030 <ft_islower@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <ft_isupper@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <ft_isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <ft_islower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ft_isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @ft_islower(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = tail call i64 @ft_isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ft_islower(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int fun730() { return 730; }


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

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

LLVM IR (-O0):
define i32 @fun730() {
ret i32 730
}

LLVM IR (-O2):
define i32 @fun730() {
ret i32 730
}
/* Variables and functions */
scalar_t__ malloc(int);
int main() {
  char *ptr;
  ptr = (char *)malloc(sizeof(char) * 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 10)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 10)
ret i32 0
}
void gdk_text_property_to_utf8_list() {}


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

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

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

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

/* Variables and functions */
uint8_t h265nal_get_temporalid1(const uint8_t *p_h265nal) {
  return p_h265nal[4] & 0x7;
}


x86 assembly (clang, -O0):
<h265nal_get_temporalid1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
and    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265nal_get_temporalid1>:
mov    0x10(%rdi),%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @h265nal_get_temporalid1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = and i32 %5, 7
ret i32 %6
}

LLVM IR (-O2):
define i32 @h265nal_get_temporalid1(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = and i32 %3, 7
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchr(int /*<<< orphan*/);
void putstr(char *s) {
  while (*s)
    putchr(*s++);
}


x86 assembly (clang, -O0):
<putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <putstr+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchr@plt>
jmp    111c <putstr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchr@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchr(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ VGA_make_entry(char, int /*<<< orphan*/);
int /*<<< orphan*/ VGA_set_at(int /*<<< orphan*/, size_t const);
void VGA_print_at(char c, uint8_t color, size_t x, size_t y) {
  const size_t index = y * 80 + x;
  VGA_set_at(VGA_make_entry(c, color), index);
}


x86 assembly (clang, -O0):
<VGA_print_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
imul   $0x50,-0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
movsbl %al,%edi
call   1040 <VGA_make_entry@plt>
mov    %eax,%edi
mov    -0x20(%rbp),%rsi
call   1030 <VGA_set_at@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VGA_print_at>:
push   %rbx
lea    (%rcx,%rcx,4),%rbx
shl    $0x4,%rbx
add    %rdx,%rbx
call   1040 <VGA_make_entry@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <VGA_set_at@plt>

LLVM IR (-O0):
define void @VGA_print_at(i8 signext %0, i32 %1, i64 %2, i64 %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i8 %0, i8* %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %8
%11 = mul i64 %10, 80
%12 = load i64, i64* %7
%13 = add i64 %11, %12
store i64 %13, i64* %9
%14 = load i8, i8* %5
%15 = load i32, i32* %6
%16 = call i32 @VGA_make_entry(i8 signext %14, i32 %15)
%17 = load i64, i64* %9
%18 = call i32 @VGA_set_at(i32 %16, i64 %17)
ret void
}

LLVM IR (-O2):
define void @VGA_print_at(i8 signext %0, i32 %1, i64 %2, i64 %3) {
%5 = mul i64 %3, 80
%6 = add i64 %5, %2
%7 = tail call i32 @VGA_make_entry(i8 signext %0, i32 %1)
%8 = tail call i32 @VGA_set_at(i32 %7, i64 %6)
ret void
}
int ft_sqrt(int nb) {
  int i;
  i = 1;
  if (nb <= 0)
    return (0);
  while (i <= 46341) {
    if ((i * i) == nb)
      return (i);
    i++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1124 <ft_sqrt+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1166 <ft_sqrt+0x66>
jmp    1129 <ft_sqrt+0x29>
cmpl   $0xb505,-0xc(%rbp)
jg     115f <ft_sqrt+0x5f>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1151 <ft_sqrt+0x51>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <ft_sqrt+0x66>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <ft_sqrt+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sqrt>:
test   %edi,%edi
jle    113c <ft_sqrt+0x3c>
mov    $0x3,%ecx
nopl   0x0(%rax)
lea    -0x2(%rcx),%eax
mov    %eax,%edx
imul   %eax,%edx
cmp    %edi,%edx
je     113e <ft_sqrt+0x3e>
lea    -0x1(%rcx),%eax
mov    %eax,%edx
imul   %eax,%edx
cmp    %edi,%edx
je     113e <ft_sqrt+0x3e>
mov    %ecx,%eax
imul   %ecx,%eax
cmp    %edi,%eax
je     113f <ft_sqrt+0x3f>
add    $0x3,%ecx
cmp    $0xb508,%ecx
jne    1110 <ft_sqrt+0x10>
xor    %eax,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_sqrt(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %18, label %3
3: ; preds = %1, %15
%4 = phi i32 [ %16, %15 ], [ 1, %1 ]
%5 = mul nuw nsw i32 %4, %4
%6 = icmp eq i32 %5, %0
br i1 %6, label %18, label %7
7: ; preds = %3
%8 = add nuw nsw i32 %4, 1
%9 = mul nuw nsw i32 %8, %8
%10 = icmp eq i32 %9, %0
br i1 %10, label %18, label %11
11: ; preds = %7
%12 = add nuw nsw i32 %4, 2
%13 = mul nuw nsw i32 %12, %12
%14 = icmp eq i32 %13, %0
br i1 %14, label %18, label %15
15: ; preds = %11
%16 = add nuw nsw i32 %4, 3
%17 = icmp eq i32 %16, 46342
br i1 %17, label %18, label %3
18: ; preds = %3, %7, %11, %15, %1
%19 = phi i32 [ 0, %1 ], [ %4, %3 ], [ %8, %7 ], [ %12, %11 ], [ 0, %15 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void hello2(int **p) {
  for (int i = 0; i < 4; i++)
    printf("%d\n", *(*p + 4 + i));
}


x86 assembly (clang, -O0):
<hello2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1156 <hello2+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
mov    0x10(%rax,%rcx,4),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <hello2+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    0x10(%rax),%esi
lea    0xedc(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rax
mov    0x14(%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rax
mov    0x18(%rax),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rax
mov    0x1c(%rax),%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @hello2(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32, i32* %2, i64 4
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %0
%7 = getelementptr inbounds i32, i32* %6, i64 5
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %0
%11 = getelementptr inbounds i32, i32* %10, i64 6
%12 = load i32, i32* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32*, i32** %0
%15 = getelementptr inbounds i32, i32* %14, i64 7
%16 = load i32, i32* %15
%17 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
ret void
}
XSetStipple() {}


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

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

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

LLVM IR (-O2):
define i32 @XSetStipple() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char n, m;
  scanf("%c", &n);
  m = 'z' - (n - 'a');
  printf("%c\n", m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x6(%rbp)
lea    0xeac(%rip),%rdi
movsbl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 97
%8 = sub nsw i32 122, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i8, i8* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}
int main(void) {
  float f = 3.14;
  double d = 2.71f;
  d = f;
  return d;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movss  0xef5(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca double
store i32 0, i32* %1
store float 0x40091EB860000000, float* %2
store double 0x4005AE1480000000, double* %3
%4 = load float, float* %2
%5 = fpext float %4 to double
store double %5, double* %3
%6 = load double, double* %3
%7 = fptosi double %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
void clear_line(char *line) {
  int i = 0;
  for (i = 0; i < 100; i++) {
    *line++ = 0;
  }
}


x86 assembly (clang, -O0):
<clear_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1140 <clear_line+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <clear_line+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_line>:
xorps  %xmm0,%xmm0
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movl   $0x0,0x60(%rdi)
ret

LLVM IR (-O0):
define void @clear_line(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
store i8 0, i8* %8
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @clear_line(i8* nocapture writeonly %0) {
ret void
}
double percent(double a, double b) { return b ? (100 * a) / b : 0; }


x86 assembly (clang, -O0):
<percent>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112b <percent+0x2b>
jp     112b <percent+0x2b>
jmp    1147 <percent+0x47>
movsd  0xecd(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1154 <percent+0x54>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1154 <percent+0x54>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<percent>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    110c <percent+0xc>
jnp    111c <percent+0x1c>
mulsd  0xeec(%rip),%xmm0
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @percent(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fcmp une double %5, 0.000000e+00
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load double, double* %3
%9 = fmul double 1.000000e+02, %8
%10 = load double, double* %4
%11 = fdiv double %9, %10
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %7
%14 = phi double [ %11, %7 ], [ 0.000000e+00, %12 ]
ret double %14
}

LLVM IR (-O2):
define double @percent(double %0, double %1) {
%3 = fcmp une double %1, 0.000000e+00
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = fmul double %0, 1.000000e+02
%6 = fdiv double %5, %1
br label %7
7: ; preds = %2, %4
%8 = phi double [ %6, %4 ], [ 0.000000e+00, %2 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  float r;
  r = 2.0;
  ;
  printf("RADIO = %f", r);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
movsd  0xed0(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"RADIO = %f\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 2.000000e+00, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"RADIO = %f\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double 2.000000e+00)
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
scalar_t__ _isalldigit(char *);
scalar_t__ _isonlyx(char *);
int _check_input(char *str) {
  return (_isalldigit(str) || _isonlyx(str)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<_check_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_isalldigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115a <_check_input+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <_isonlyx@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_input>:
push   %rbx
mov    %rdi,%rbx
call   1040 <_isalldigit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <_check_input+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <_isonlyx@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_check_input(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @_isalldigit(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @_isonlyx(i8* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @_check_input(i8* %0) {
%2 = tail call i64 @_isalldigit(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @_isonlyx(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ int8_t;

/* Variables and functions */
int /*<<< orphan*/ __wbeu08(int *, int);
int i2c_transact(int, int, int *, int, int /*<<< orphan*/);
int i2c_write_beint08(int fd, int chip_addr, int reg, int8_t value) {
  uint8_t data[1 + sizeof(uint8_t)];
  data[0] = reg;
  __wbeu08(&data[1], (uint8_t)value);
  return i2c_transact(fd, chip_addr, data, 1 + sizeof(uint8_t), 0);
}


x86 assembly (clang, -O0):
<i2c_write_beint08>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rax
mov    %eax,%esi
call   1040 <__wbeu08@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x30(%rbp),%rdx
mov    $0x5,%ecx
xor    %r8d,%r8d
call   1030 <i2c_transact@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_write_beint08>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,(%rsp)
lea    0x4(%rsp),%rdi
mov    %ecx,%esi
call   1040 <__wbeu08@plt>
mov    %rsp,%rdx
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x5,%ecx
xor    %r8d,%r8d
call   1030 <i2c_transact@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @i2c_write_beint08(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca [5 x i32]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%10 = load i32, i32* %7
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 1
%13 = load i64, i64* %8
%14 = trunc i64 %13 to i32
%15 = call i32 @__wbeu08(i32* %12, i32 %14)
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%19 = call i32 @i2c_transact(i32 %16, i32 %17, i32* %18, i32 5, i32 0)
ret i32 %19
}

LLVM IR (-O2):
define i32 @i2c_write_beint08(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca [5 x i32]
%6 = bitcast [5 x i32]* %5 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
store i32 %2, i32* %7
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 1
%9 = trunc i64 %3 to i32
%10 = call i32 @__wbeu08(i32* %8, i32 %9)
%11 = call i32 @i2c_transact(i32 %0, i32 %1, i32* %7, i32 5, i32 0)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ sleep(unsigned int const);
void sqlitexx_port_sleep(const unsigned int seconds) { sleep(seconds); }


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

x86 assembly (clang, -O2):
<sqlitexx_port_sleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @sqlitexx_port_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
/* Variables and functions */
int main();
int fib(int a) {
  int sum;
  sum = 0;
  while ((a = a - 1) > 0) {
    sum = sum + main();
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1150 <fib+0x40>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <main@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <fib+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbx
cmp    $0x2,%edi
jl     112f <fib+0x1f>
mov    %edi,%ebx
add    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <main@plt>
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     1120 <fib+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 (...) @main()
%7 = icmp ugt i32 %4, 2
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret i32 undef
}
/* Type definitions */
struct connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gzip_free(struct connection *);
int process_html(struct connection *);
int do_process_html(struct connection *conn) {
  gzip_free(conn);
  return process_html(conn);
}


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

x86 assembly (clang, -O2):
<do_process_html>:
push   %rbx
mov    %rdi,%rbx
call   1030 <gzip_free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <process_html@plt>

LLVM IR (-O0):
%struct.connection = type { i32 }
define i32 @do_process_html(%struct.connection* %0) {
%2 = alloca %struct.connection*
store %struct.connection* %0, %struct.connection** %2
%3 = load %struct.connection*, %struct.connection** %2
%4 = call i32 @gzip_free(%struct.connection* %3)
%5 = load %struct.connection*, %struct.connection** %2
%6 = call i32 @process_html(%struct.connection* %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.connection = type { i32 }
define i32 @do_process_html(%struct.connection* %0) {
%2 = tail call i32 @gzip_free(%struct.connection* %0)
%3 = tail call i32 @process_html(%struct.connection* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int);
void main(int i) {
  f(1, 1);
  f(1, 2);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <f@plt>
mov    $0x1,%edi
mov    $0x2,%esi
pop    %rax
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 @f(i32 1, i32 1)
%3 = tail call i32 @f(i32 1, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int socket(int, int, int);
int Socket(int domain, int type, int protocol) {
  int n;
  n = socket(domain, type, protocol);
  if (n == -1) {
    perror("Socket");
    exit(1);
  }
  return n;
}


x86 assembly (clang, -O0):
<Socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <socket@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1172 <Socket+0x42>
lea    0xe9d(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Socket>:
push   %rax
call   1050 <socket@plt>
cmp    $0xffffffff,%eax
je     113d <Socket+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"Socket\00"
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 %4
}
/* Variables and functions */
scalar_t__ pow(double, int);
double sqrt(scalar_t__);
double h_function(double x) { return sqrt(4 - pow(x, 2)); }


x86 assembly (clang, -O0):
<h_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    $0x4,%edi
sub    %rax,%rdi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_function>:
push   %rax
mov    $0x2,%edi
call   1030 <pow@plt>
mov    $0x4,%edi
sub    %rax,%rdi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @h_function(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @pow(double %3, i32 2)
%5 = sub nsw i64 4, %4
%6 = call double @sqrt(i64 %5)
ret double %6
}

LLVM IR (-O2):
define double @h_function(double %0) {
%2 = tail call i64 @pow(double %0, i32 2)
%3 = sub nsw i64 4, %2
%4 = tail call double @sqrt(i64 %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void PrintUsage(const char *appName) {
  fprintf(stdout,
          "usage:\n%s [ -v ] [ from [to] ]\nwhere\n  from, to: test "
          "range\noptions\n  -v        verbose reports\n  -h        help on "
          "usage\n\n",
          appName);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<PrintUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintUsage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [124 x i8] c"usage:\0A%s [ -v ] [ from [to] ]\0Awhere\0A from, to: test range\0Aoptions\0A -v verbose reports\0A -h help on usage\0A\0A\00"
define void @PrintUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [124 x i8] c"usage:\0A%s [ -v ] [ from [to] ]\0Awhere\0A from, to: test range\0Aoptions\0A -v verbose reports\0A -h help on usage\0A\0A\00"
define void @PrintUsage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Uart16550Put(char const);
void Uart16550Puts(const char *string) {
  while (*string) {
    if (*string == '\n') {
      Uart16550Put('\r');
    }
    Uart16550Put(*string);
    string++;
  }
}


x86 assembly (clang, -O0):
<Uart16550Puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <Uart16550Puts+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1143 <Uart16550Puts+0x33>
mov    $0xd,%edi
call   1030 <Uart16550Put@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <Uart16550Put@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <Uart16550Puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Uart16550Puts>:
push   %rbx
mov    %rdi,%rbx
jmp    1139 <Uart16550Puts+0x29>
cs nopw 0x0(%rax,%rax,1)
mov    $0xd,%edi
call   1030 <Uart16550Put@plt>
movzbl (%rbx),%eax
movsbl %al,%edi
call   1030 <Uart16550Put@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1120 <Uart16550Puts+0x10>
test   %al,%al
jne    112d <Uart16550Puts+0x1d>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Uart16550Puts(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %11, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %12
i8 10, label %5
]
5: ; preds = %2
%6 = tail call i32 @Uart16550Put(i8 signext 13)
%7 = load i8, i8* %3
br label %8
8: ; preds = %2, %5
%9 = phi i8 [ %4, %2 ], [ %7, %5 ]
%10 = tail call i32 @Uart16550Put(i8 signext %9)
%11 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
12: ; preds = %2
ret void
}
void OBJ_txt2obj(void) {}


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

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

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

LLVM IR (-O2):
define void @OBJ_txt2obj() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_attr_getscope(int /*<<< orphan*/ *, int *);
int my_pthread_attr_getscope(pthread_attr_t const *__attr) {
  int scope;
  pthread_attr_t *realattr = (pthread_attr_t *)*(int *)__attr;
  pthread_attr_getscope(realattr, &scope);
  return scope;
}


x86 assembly (clang, -O0):
<my_pthread_attr_getscope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <pthread_attr_getscope@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_attr_getscope>:
push   %rax
movslq (%rdi),%rdi
lea    0x4(%rsp),%rsi
call   1030 <pthread_attr_getscope@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @my_pthread_attr_getscope(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %4
%9 = load i32*, i32** %4
%10 = call i32 @pthread_attr_getscope(i32* %9, i32* %3)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @my_pthread_attr_getscope(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* %0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = call i32 @pthread_attr_getscope(i32* %6, i32* %2)
%8 = load i32, i32* %2
ret i32 %8
}
void flush_nfo_tlb_mm(struct process_vm *vm) {}


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

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

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

LLVM IR (-O2):
%struct.process_vm = type opaque
define void @flush_nfo_tlb_mm(%struct.process_vm* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int live_a_year(int age) {
  printf("Happy Birthday! You are now %d\n\n", age);
  age += 1;
  return age;
}


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

x86 assembly (clang, -O2):
<live_a_year>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Happy Birthday! You are now %d\0A\0A\00"
define i32 @live_a_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [33 x i8] c"Happy Birthday! You are now %d\0A\0A\00"
define i32 @live_a_year(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = add nsw i32 %0, 1
ret i32 %3
}
/* Variables and functions */
int set_qlut_kcal_values(int, int, int);
int set_kcal_values(int kcal_r, int kcal_g, int kcal_b) {
  return set_qlut_kcal_values(kcal_r, kcal_g, kcal_b);
}


x86 assembly (clang, -O0):
<set_kcal_values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <set_qlut_kcal_values@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_kcal_values>:
jmp    1030 <set_qlut_kcal_values@plt>

LLVM IR (-O0):
define i32 @set_kcal_values(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 = load i32, i32* %6
%10 = call i32 @set_qlut_kcal_values(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @set_kcal_values(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @set_qlut_kcal_values(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int *my_malloc(int);
void af1() {
  int *p = my_malloc(12);
  return;
}


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

x86 assembly (clang, -O2):
<af1>:
mov    $0xc,%edi
jmp    1030 <my_malloc@plt>

LLVM IR (-O0):
define void @af1() {
%1 = alloca i32*
%2 = call i32* @my_malloc(i32 12)
store i32* %2, i32** %1
ret void
}

LLVM IR (-O2):
define void @af1() {
%1 = tail call i32* @my_malloc(i32 12)
ret void
}
double sign(double x) { return (x > 0) - (x < 0); }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = load double, double* %2
%7 = fcmp olt double %6, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @sign(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = fcmp olt double %0, 0.000000e+00
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %3
%7 = sitofp i32 %6 to double
ret double %7
}