xunge/DecIR huggingface dataset:
/* Variables and functions */
void *my_xcalloc(int a, size_t b) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @my_xcalloc(i32 %0, i64 %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void seven(const char *a) {
  char c = *a;
  if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
    printf("a is a letter.\n");
  else
    printf("a is not a letter.\n");
}


x86 assembly (clang, -O0):
<seven>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jl     113f <seven+0x2f>
movsbl -0x9(%rbp),%eax
cmp    $0x5a,%eax
jle    1159 <seven+0x49>
movsbl -0x9(%rbp),%eax
cmp    $0x61,%eax
jl     116a <seven+0x5a>
movsbl -0x9(%rbp),%eax
cmp    $0x7a,%eax
jg     116a <seven+0x5a>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    1176 <seven+0x66>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seven>:
mov    (%rdi),%al
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
lea    0xef4(%rip),%rax
lea    0xeda(%rip),%rdi
cmovb  %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"a is a letter.\0A\00"
@.str.1 = [20 x i8] c"a is not a letter.\0A\00"
define void @seven(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 90
br i1 %12, label %21, label %13
13: ; preds = %9, %1
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 97
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 122
br i1 %20, label %21, label %23
21: ; preds = %17, %9
%22 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %25
23: ; preds = %17, %13
%24 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"a is not a letter.\00"
@str.2 = [15 x i8] c"a is a letter.\00"
define void @seven(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -33
%4 = add i8 %3, -65
%5 = icmp ult i8 %4, 26
%6 = select i1 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
ret void
}
int test_specialBits(void) { return 0xffca3fff; }


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

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

LLVM IR (-O0):
define i32 @test_specialBits() {
ret i32 -3522561
}

LLVM IR (-O2):
define i32 @test_specialBits() {
ret i32 -3522561
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void I2C_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @I2C_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @I2C_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
__attribute__((always_)) void writel(unsigned int val, volatile void *addr) {
  asm volatile("mov"
               "l"
               " %0,%1"
               :
               : "r"(val), "m"(*(volatile unsigned int *)addr)
               : "memory");
}


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

x86 assembly (clang, -O2):
<writel>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @writel(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 = bitcast i8* %6 to i32*
ret void
}

LLVM IR (-O2):
define void @writel(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
tail call void asm sideeffect "movl $0,$1", "r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32* elementtype(i32) %3)
ret void
}
int mymax(int x, int y) {
  if (x > y) {
    return x;
  } else {
    return y;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @mymax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int foo(unsigned char c, char s) { return c + s + 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    (%rdi,%rsi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @foo(i8 zeroext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = add nsw i32 %6, %8
%10 = add nsw i32 %9, 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo(i8 zeroext %0, i8 signext %1) {
%3 = zext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = add nuw nsw i32 %3, 1
%6 = add nsw i32 %5, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ putch(char);
void puth2(unsigned int i) {
  char c[] = "0123456789abcdef";
  for (int pos = 4; pos != -4; pos -= 4) {
    putch(c[(i >> (unsigned int)(pos)) & 0xFU]);
  }
}


x86 assembly (clang, -O0):
<puth2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed9(%rip),%al
mov    %al,-0x10(%rbp)
movl   $0x4,-0x24(%rbp)
cmpl   $0xfffffffc,-0x24(%rbp)
je     1170 <puth2+0x60>
mov    -0x4(%rbp),%eax
mov    -0x24(%rbp),%ecx
shr    %cl,%eax
and    $0xf,%eax
mov    %eax,%eax
movsbl -0x20(%rbp,%rax,1),%edi
call   1030 <putch@plt>
mov    -0x24(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x24(%rbp)
jmp    1141 <puth2+0x31>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puth2>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    0xedb(%rip),%r14
movsbl (%rax,%r14,1),%edi
call   1030 <putch@plt>
and    $0xf,%ebx
movsbl (%rbx,%r14,1),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putch@plt>

LLVM IR (-O0):
@__const.puth2.c = [17 x i8] c"0123456789abcdef\00"
define void @puth2(i32 %0) {
%2 = alloca i32
%3 = alloca [17 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = bitcast [17 x i8]* %3 to i8*
store i32 4, i32* %4
br label %6
6: ; preds = %18, %1
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, -4
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = lshr i32 %10, %11
%13 = and i32 %12, 15
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = call i32 @putch(i8 signext %16)
br label %18
18: ; preds = %9
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 4
store i32 %20, i32* %4
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@__const.puth2.c = [17 x i8] c"0123456789abcdef\00"
define void @puth2(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @__const.puth2.c, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @putch(i8 signext %6)
%8 = and i32 %0, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @__const.puth2.c, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @putch(i8 signext %11)
ret void
}
/* Type definitions */
struct katcp_dispatch {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ append_string_katcp(struct katcp_dispatch *, int, char *);
void print_string_type_katcp(struct katcp_dispatch *d, char *key, void *data) {
  char *o;
  o = data;
  if (o == NULL)
    return;
  append_string_katcp(d, 0x10 | 0x01, "#string:");
  append_string_katcp(d, 0x10 | 0x02, o);
}


x86 assembly (clang, -O0):
<print_string_type_katcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    113c <print_string_type_katcp+0x2c>
jmp    1163 <print_string_type_katcp+0x53>
mov    -0x8(%rbp),%rdi
mov    $0x11,%esi
lea    0xeb4(%rip),%rdx
call   1030 <append_string_katcp@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x12,%esi
call   1030 <append_string_katcp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string_type_katcp>:
test   %rdx,%rdx
je     1147 <print_string_type_katcp+0x37>
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
lea    0xeda(%rip),%rdx
mov    $0x11,%esi
call   1030 <append_string_katcp@plt>
mov    %r14,%rdi
mov    $0x12,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <append_string_katcp@plt>
ret

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

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
@.str = [9 x i8] c"#string:\00"
define void @print_string_type_katcp(%struct.katcp_dispatch* %0, i8* nocapture readnone %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @append_string_katcp(%struct.katcp_dispatch* %0, i32 17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @append_string_katcp(%struct.katcp_dispatch* %0, i32 18, i8* %2)
br label %8
8: ; preds = %3, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, int);
void send_do(int n, unsigned char val) {
  printf("value: %c, addr: %d\n", (val != 0) ? 'T' : 'F', n);
}


x86 assembly (clang, -O0):
<send_do>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%edx
mov    $0x46,%eax
mov    $0x54,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    -0x4(%rbp),%edx
lea    0xec1(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_do>:
mov    %edi,%edx
test   %esi,%esi
mov    $0x46,%eax
mov    $0x54,%esi
cmove  %eax,%esi
lea    0xed8(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"value: %c, addr: %d\0A\00"
define void @send_do(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 84, i32 70
%10 = trunc i32 %9 to i8
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"value: %c, addr: %d\0A\00"
define void @send_do(i32 %0, i8 zeroext %1) {
%3 = icmp eq i8 %1, 0
%4 = select i1 %3, i8 70, i8 84
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 signext %4, i32 %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void GoRgbaResetPuddles(void *rgbaBytes, int byteSize) {
  uint8_t *alphaPixel = (uint8_t *)rgbaBytes + 3;
  for (int i = byteSize >> 2; i > 0; --i, alphaPixel += 4) {
    *alphaPixel = 255;
  }
}


x86 assembly (clang, -O0):
<GoRgbaResetPuddles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    114e <GoRgbaResetPuddles+0x4e>
mov    -0x18(%rbp),%rax
movl   $0xff,(%rax)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <GoRgbaResetPuddles+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GoRgbaResetPuddles>:
cmp    $0x4,%esi
jl     1122 <GoRgbaResetPuddles+0x22>
shr    $0x2,%esi
add    $0xc,%rdi
add    $0x1,%esi
nop
movl   $0xff,(%rdi)
add    $0x10,%rdi
add    $0xffffffff,%esi
cmp    $0x1,%esi
ja     1110 <GoRgbaResetPuddles+0x10>
ret

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

LLVM IR (-O2):
define void @GoRgbaResetPuddles(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 3
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = lshr i32 %1, 2
%6 = getelementptr inbounds i8, i8* %0, i64 12
%7 = bitcast i8* %6 to i32*
br label %9
8: ; preds = %9, %2
ret void
9: ; preds = %4, %9
%10 = phi i32 [ %12, %9 ], [ %5, %4 ]
%11 = phi i32* [ %13, %9 ], [ %7, %4 ]
store i32 255, i32* %11
%12 = add nsw i32 %10, -1
%13 = getelementptr inbounds i32, i32* %11, i64 4
%14 = icmp ugt i32 %10, 1
br i1 %14, label %9, label %8
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  time_t curtime;
  time(&curtime);
  printf("Current time = %s", ctime(&curtime));
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
lea    0xeaf(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Current time = %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* %2)
%4 = call i8* @ctime(i32* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Current time = %s\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call i8* @ctime(i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
unsigned int __bytes_required_for_bits(unsigned int bits) {
  return (0 < (bits % 8) ? 1 : 0) + (bits / 8);
}


x86 assembly (clang, -O0):
<__bytes_required_for_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x7,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%eax
cmovb  %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bytes_required_for_bits>:
mov    %edi,%eax
mov    %edi,%ecx
and    $0x7,%ecx
shr    $0x3,%eax
cmp    $0x1,%ecx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @__bytes_required_for_bits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = urem i32 %3, 8
%5 = icmp ult i32 0, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
%8 = load i32, i32* %2
%9 = udiv i32 %8, 8
%10 = add i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @__bytes_required_for_bits(i32 %0) {
%2 = and i32 %0, 7
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
%5 = lshr i32 %0, 3
%6 = add nuw nsw i32 %5, %4
ret i32 %6
}
int xmlUCSIsCatCs(int code) {
  return ((code == 0xd800) || ((code >= 0xdb7f) && (code <= 0xdb80)) ||
          ((code >= 0xdbff) && (code <= 0xdc00)) || (code == 0xdfff));
}


x86 assembly (clang, -O0):
<xmlUCSIsCatCs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xd800,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1164 <xmlUCSIsCatCs+0x64>
cmpl   $0xdb7f,-0x4(%rbp)
jl     1138 <xmlUCSIsCatCs+0x38>
mov    $0x1,%al
cmpl   $0xdb80,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1164 <xmlUCSIsCatCs+0x64>
cmpl   $0xdbff,-0x4(%rbp)
jl     1157 <xmlUCSIsCatCs+0x57>
mov    $0x1,%al
cmpl   $0xdc00,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1164 <xmlUCSIsCatCs+0x64>
cmpl   $0xdfff,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsCatCs>:
cmp    $0xd800,%edi
sete   %al
lea    -0xdb7f(%rdi),%ecx
cmp    $0x2,%ecx
setb   %cl
or     %al,%cl
lea    -0xdbff(%rdi),%eax
cmp    $0x2,%eax
setb   %al
cmp    $0xdfff,%edi
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @xmlUCSIsCatCs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 55296
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 56191
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 56192
br i1 %10, label %20, label %11
11: ; preds = %8, %5
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 56319
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 56320
br i1 %16, label %20, label %17
17: ; preds = %14, %11
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 57343
br label %20
20: ; preds = %17, %14, %8, %1
%21 = phi i1 [ true, %14 ], [ true, %8 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @xmlUCSIsCatCs(i32 %0) {
%2 = icmp eq i32 %0, 55296
%3 = add i32 %0, -56191
%4 = icmp ult i32 %3, 2
%5 = or i1 %2, %4
%6 = add i32 %0, -56319
%7 = icmp ult i32 %6, 2
%8 = or i1 %7, %5
%9 = icmp eq i32 %0, 57343
%10 = or i1 %9, %8
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ write(int, unsigned char *, int);
void sputc(unsigned char c, int f) { write(f, &c, 1); }


x86 assembly (clang, -O0):
<sputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sputc>:
push   %rax
mov    %esi,%eax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @sputc(i8 zeroext %0, i32 %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i32 @write(i32 %1, i8* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void ErrorPrump_IdDuplicated(int line, char *id) {
  printf("Error in line: %d \n => Identifier %s Duplicated!", line, id);
}


x86 assembly (clang, -O0):
<ErrorPrump_IdDuplicated>:
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):
<ErrorPrump_IdDuplicated>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Error in line: %d \0A => Identifier %s Duplicated!\00"
define void @ErrorPrump_IdDuplicated(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 ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Error in line: %d \0A => Identifier %s Duplicated!\00"
define void @ErrorPrump_IdDuplicated(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
/* Variables and functions */
int PATH_MAX;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  char buf[PATH_MAX];
  if (!getcwd(buf, PATH_MAX)) {
    perror("getcwd");
    exit(1);
  }
  puts(buf);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    0x2e67(%rip),%rax
mov    (%rax),%esi
call   1040 <getcwd@plt>
cmp    $0x0,%eax
jne    11af <main+0x6f>
lea    0xe60(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x28(%rbp),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rbx
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <getcwd@plt>
test   %eax,%eax
jne    1185 <main+0x45>
lea    0xe8a(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [7 x i8] c"getcwd\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* @PATH_MAX
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %6
%11 = alloca i8, i64 %9
store i64 %9, i64* %7
%12 = load i32, i32* @PATH_MAX
%13 = call i32 @getcwd(i8* %11, i32 %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %2
%16 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = call i32 @puts(i8* %11)
%20 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [7 x i8] c"getcwd\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @PATH_MAX
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @getcwd(i8* %5, i32 %3)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = call i32 @puts(i8* %5)
%13 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, int);
void logPktSend(int t, int currNote, int nxtNode, int srcAddr, int destAddr,
                int msgId, int pktId) {
  printf("%3d: node %d sends to %d pkt %d of msg %d (src=%d,dst=%d)\n", t,
         currNote, nxtNode, pktId, msgId, srcAddr, destAddr);
}


x86 assembly (clang, -O0):
<logPktSend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    0x10(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x10(%rbp),%r10d
mov    -0x14(%rbp),%eax
lea    0xeb2(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logPktSend>:
push   %rax
mov    %r8d,%eax
mov    %ecx,%r10d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    0x10(%rsp),%r8d
lea    0xed7(%rip),%rdi
push   %rax
push   %r10
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [59 x i8] c"%3d: node %d sends to %d pkt %d of msg %d (src=%d,dst=%d)\0A\00"
define void @logPktSend(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %14
%19 = load i32, i32* %13
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %19, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"%3d: node %d sends to %d pkt %d of msg %d (src=%d,dst=%d)\0A\00"
define void @logPktSend(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %6, i32 %5, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int __attribute__((fastcall)) test_cc(int base, int sp, int hp, int r1) {
  int sum = base + sp + hp + r1;
  printf("Base: %d\n", sum);
  return sum;
}


x86 assembly (clang, -O0):
<test_cc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cc>:
push   %rbx
lea    (%rdi,%rsi,1),%ebx
add    %edx,%ebx
add    %ecx,%ebx
lea    0xee1(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"Base: %d\0A\00"
define i32 @test_cc(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = add nsw i32 %5, %2
%7 = add nsw i32 %6, %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ val;
typedef int __u64;

/* Variables and functions */
__u64 ___swab64(__u64 val) {
  return ((__u64)((((__u64)(val) & (__u64)0x00000000000000ffULL) << 56) |
                  (((__u64)(val) & (__u64)0x000000000000ff00ULL) << 40) |
                  (((__u64)(val) & (__u64)0x0000000000ff0000ULL) << 24) |
                  (((__u64)(val) & (__u64)0x00000000ff000000ULL) << 8) |
                  (((__u64)(val) & (__u64)0x000000ff00000000ULL) >> 8) |
                  (((__u64)(val) & (__u64)0x0000ff0000000000ULL) >> 24) |
                  (((__u64)(val) & (__u64)0x00ff000000000000ULL) >> 40) |
                  (((__u64)(val) & (__u64)0xff00000000000000ULL) >> 56)));
}


x86 assembly (clang, -O0):
<___swab64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
and    $0xff00,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x0,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x0,%ecx
sar    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0x0,%edx
mov    $0x28,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%edx
and    $0x0,%edx
mov    $0x38,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @___swab64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 56
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 40
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = shl i32 %11, 24
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = shl i32 %15, 8
%17 = or i32 %13, %16
%18 = load i32, i32* %2
%19 = and i32 %18, 0
%20 = ashr i32 %19, 8
%21 = or i32 %17, %20
%22 = load i32, i32* %2
%23 = and i32 %22, 0
%24 = ashr i32 %23, 24
%25 = or i32 %21, %24
%26 = load i32, i32* %2
%27 = and i32 %26, 0
%28 = ashr i32 %27, 40
%29 = or i32 %25, %28
%30 = load i32, i32* %2
%31 = and i32 %30, 0
%32 = ashr i32 %31, 56
%33 = or i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @___swab64(i32 %0) {
ret i32 poison
}
void netcdf_DatatypeFreeTS() {}


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

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

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

LLVM IR (-O2):
define void @netcdf_DatatypeFreeTS() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void write_str(int fd, const char *p) {
  int i = 0;
  while (p[i] != '\x00')
    i++;
  (void)write(fd, p, i);
}


x86 assembly (clang, -O0):
<write_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1149 <write_str+0x39>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <write_str+0x16>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_str>:
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <write_str+0x10>
add    $0xffffffff,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @write_str(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
%11 = tail call i32 @write(i32 %0, i8* %1, i32 %10)
ret void
}
int fun1242() { return 1242; }


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

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

LLVM IR (-O0):
define i32 @fun1242() {
ret i32 1242
}

LLVM IR (-O2):
define i32 @fun1242() {
ret i32 1242
}
/* Variables and functions */
int /*<<< orphan*/ cp850_to_latin1(unsigned int);
int latin1_upcase(int /*<<< orphan*/);
unsigned hpfs_char_to_upper_linux(unsigned c) {
  return latin1_upcase(cp850_to_latin1(c));
}


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

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

LLVM IR (-O0):
define i32 @hpfs_char_to_upper_linux(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cp850_to_latin1(i32 %3)
%5 = call i32 @latin1_upcase(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @hpfs_char_to_upper_linux(i32 %0) {
%2 = tail call i32 @cp850_to_latin1(i32 %0)
%3 = tail call i32 @latin1_upcase(i32 %2)
ret i32 %3
}
/* Type definitions */
struct world {
  int dummy;
};

/* Variables and functions */
struct world *create_world();
int /*<<< orphan*/ destroy_world(struct world *);
int /*<<< orphan*/ printf(char *);
int test_gameobj() {
  struct world *w;
  printf("\n### GAMEOBJ LIFECYCLE TEST ###\n");
  printf("Creating world...\n");
  w = create_world();
  printf("Destroying world...\n");
  destroy_world(w);
  return 0;
}


x86 assembly (clang, -O0):
<test_gameobj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <printf@plt>
lea    0xed6(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <create_world@plt>
mov    %rax,-0x8(%rbp)
lea    0xed2(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <destroy_world@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_gameobj>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <puts@plt>
lea    0xedc(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1030 <create_world@plt>
mov    %rax,%rbx
lea    0xed8(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1040 <destroy_world@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.world = type { i32 }
@.str = [33 x i8] c"\0A### GAMEOBJ LIFECYCLE TEST ###\0A\00"
@.str.1 = [19 x i8] c"Creating world...\0A\00"
@.str.2 = [21 x i8] c"Destroying world...\0A\00"
define i32 @test_gameobj() {
%1 = alloca %struct.world*
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = call %struct.world* (...) @create_world()
store %struct.world* %4, %struct.world** %1
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%6 = load %struct.world*, %struct.world** %1
%7 = call i32 @destroy_world(%struct.world* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.world = type { i32 }
@str = [32 x i8] c"\0A### GAMEOBJ LIFECYCLE TEST ###\00"
@str.3 = [18 x i8] c"Creating world...\00"
@str.4 = [20 x i8] c"Destroying world...\00"
define i32 @test_gameobj() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.3, i64 0, i64 0))
%3 = tail call %struct.world* (...) @create_world()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @destroy_world(%struct.world* %3)
ret i32 0
}
int termp_skip_pre(struct termp *p, struct termpair *pair,
                   const struct roff_meta *meta, struct roff_node *n) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.termp = type opaque
%struct.termpair = type opaque
%struct.roff_meta = type opaque
%struct.roff_node = type opaque
define i32 @termp_skip_pre(%struct.termp* %0, %struct.termpair* %1, %struct.roff_meta* %2, %struct.roff_node* %3) {
%5 = alloca %struct.termp*
%6 = alloca %struct.termpair*
%7 = alloca %struct.roff_meta*
%8 = alloca %struct.roff_node*
store %struct.termp* %0, %struct.termp** %5
store %struct.termpair* %1, %struct.termpair** %6
store %struct.roff_meta* %2, %struct.roff_meta** %7
store %struct.roff_node* %3, %struct.roff_node** %8
ret i32 0
}

LLVM IR (-O2):
%struct.termp = type opaque
%struct.termpair = type opaque
%struct.roff_meta = type opaque
%struct.roff_node = type opaque
define i32 @termp_skip_pre(%struct.termp* nocapture readnone %0, %struct.termpair* nocapture readnone %1, %struct.roff_meta* nocapture readnone %2, %struct.roff_node* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int as_int32(unsigned int);
int as_uint32(int);
extern unsigned modulo(unsigned a, unsigned b) {
  if (!b)
    return a;
  return as_uint32(as_int32(a) % as_int32(b));
}


x86 assembly (clang, -O0):
<modulo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1143 <modulo+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <modulo+0x48>
mov    -0x8(%rbp),%edi
call   1030 <as_int32@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <as_int32@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,%edi
call   1040 <as_uint32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo>:
test   %esi,%esi
je     114b <modulo+0x2b>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <as_int32@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <as_int32@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <as_uint32@plt>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @modulo(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @as_int32(i32 %0)
%6 = tail call i32 @as_int32(i32 %1)
%7 = srem i32 %5, %6
%8 = tail call i32 @as_uint32(i32 %7)
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ %0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ init_serial();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test();
void cmain(unsigned long magic, unsigned long addr) {
  init_serial();
  printf("==START TEST==\n");
  test();
  printf("==END TEST==\n");
}


x86 assembly (clang, -O0):
<cmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init_serial@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <test@plt>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmain>:
push   %rax
xor    %eax,%eax
call   1040 <init_serial@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <test@plt>
lea    0xebd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"==START TEST==\0A\00"
@.str.1 = [14 x i8] c"==END TEST==\0A\00"
define void @cmain(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 (...) @init_serial()
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @test()
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"==START TEST==\00"
@str.2 = [13 x i8] c"==END TEST==\00"
define void @cmain(i64 %0, i64 %1) {
%3 = tail call i32 (...) @init_serial()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (...) @test()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0))
ret void
}
int fun1004() { return 1004; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x3ec,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x3ec,%eax
ret

LLVM IR (-O0):
define i32 @fun1004() {
ret i32 1004
}

LLVM IR (-O2):
define i32 @fun1004() {
ret i32 1004
}
/* Type definitions */
struct mdoc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mdoc *);
int /*<<< orphan*/ mdoc_free1(struct mdoc *);
void mdoc_free(struct mdoc *mdoc) {
  mdoc_free1(mdoc);
  free(mdoc);
}


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

x86 assembly (clang, -O2):
<mdoc_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mdoc_free1@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.mdoc = type { i32 }
define void @mdoc_free(%struct.mdoc* %0) {
%2 = tail call i32 @mdoc_free1(%struct.mdoc* %0)
%3 = tail call i32 @free(%struct.mdoc* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int v = 0;
  assert(v != 0);
  return v;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __emit_string_literal_range(char *, int, int, int);
void test_pr79210(void) {
  unsigned int lpfc_peer_port_login;
  __emit_string_literal_range("0423 lpfc_"
                              "peer_port_login"
                              " attribute cannot be set to %d, "
                              "allowed range is [0, 1]\n",
                              54, 53, 54);
}


x86 assembly (clang, -O0):
<test_pr79210>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x36,%ecx
mov    $0x35,%edx
mov    %ecx,%esi
call   1030 <__emit_string_literal_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pr79210>:
lea    0xee9(%rip),%rdi
mov    $0x36,%esi
mov    $0x35,%edx
mov    $0x36,%ecx
jmp    1030 <__emit_string_literal_range@plt>

LLVM IR (-O0):
@.str = [82 x i8] c"0423 lpfc_peer_port_login attribute cannot be set to %d, allowed range is [0, 1]\0A\00"
define void @test_pr79210() {
%1 = alloca i32
%2 = call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i32 54, i32 53, i32 54)
ret void
}

LLVM IR (-O2):
@.str = [82 x i8] c"0423 lpfc_peer_port_login attribute cannot be set to %d, allowed range is [0, 1]\0A\00"
define void @test_pr79210() {
%1 = tail call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i32 54, i32 53, i32 54)
ret void
}
void gtk_drag_set_icon_widget() {}


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

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

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

LLVM IR (-O2):
define void @gtk_drag_set_icon_widget() {
ret void
}
void RTVfsLockAcquireReadSlow(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsLockAcquireReadSlow() {
ret void
}
void gtk_tree_view_column_get_visible() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_get_visible() {
ret void
}