xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ debugPrint(char *);
int /*<<< orphan*/ next_glPopClientAttrib();
int /*<<< orphan*/ printGLError();
void glPopClientAttrib() {
  next_glPopClientAttrib();
  printGLError();
  debugPrint("glPopClientAttrib()\n");
}


x86 assembly (clang, -O0):
<glPopClientAttrib>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <next_glPopClientAttrib@plt>
mov    $0x0,%al
call   1030 <printGLError@plt>
lea    0xeb7(%rip),%rdi
call   1050 <debugPrint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glPopClientAttrib>:
push   %rax
xor    %eax,%eax
call   1040 <next_glPopClientAttrib@plt>
xor    %eax,%eax
call   1030 <printGLError@plt>
lea    0xeba(%rip),%rdi
pop    %rax
jmp    1050 <debugPrint@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"glPopClientAttrib()\0A\00"
define void @glPopClientAttrib() {
%1 = call i32 (...) @next_glPopClientAttrib()
%2 = call i32 (...) @printGLError()
%3 = call i32 @debugPrint(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"glPopClientAttrib()\0A\00"
define void @glPopClientAttrib() {
%1 = tail call i32 (...) @next_glPopClientAttrib()
%2 = tail call i32 (...) @printGLError()
%3 = tail call i32 @debugPrint(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
int xmlUCSIsDingbats(int code) {
  return (((code >= 0x2700) && (code <= 0x27BF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsDingbats>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x2700,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsDingbats+0x26>
cmpl   $0x27bf,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsDingbats>:
add    $0xffffd900,%edi
xor    %eax,%eax
cmp    $0xc0,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsDingbats(i32 %0) {
%2 = add i32 %0, -9984
%3 = icmp ult i32 %2, 192
%4 = zext i1 %3 to i32
ret i32 %4
}
void INT_Excep_SCIFA11_TXIF11(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @autonomous0() {
ret void
}
/* Variables and functions */
void *mpc55xx_cache_aligned_start(const void *s) {
  return ((uintptr_t)s & ((uintptr_t)0x1f))
             ? (((uintptr_t)s & ~((uintptr_t)0x1f)) + 32)
             : s;
}


x86 assembly (clang, -O0):
<mpc55xx_cache_aligned_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1f,%rax
cmp    $0x0,%rax
je     112f <mpc55xx_cache_aligned_start+0x2f>
mov    -0x8(%rbp),%rax
and    $0xffffffffffffffe0,%rax
add    $0x20,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <mpc55xx_cache_aligned_start+0x37>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpc55xx_cache_aligned_start>:
lea    0x20(%rdi),%rax
and    $0xffffffffffffffe0,%rax
test   $0x1f,%dil
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i8* @mpc55xx_cache_aligned_start(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, 31
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = ptrtoint i8* %8 to i64
%10 = and i64 %9, -32
%11 = add i64 %10, 32
%12 = inttoptr i64 %11 to i8*
br label %15
13: ; preds = %1
%14 = load i8*, i8** %2
br label %15
15: ; preds = %13, %7
%16 = phi i8* [ %12, %7 ], [ %14, %13 ]
ret i8* %16
}

LLVM IR (-O2):
define i8* @mpc55xx_cache_aligned_start(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 31
%4 = icmp eq i64 %3, 0
%5 = add i64 %2, 32
%6 = and i64 %5, -32
%7 = inttoptr i64 %6 to i8*
%8 = select i1 %4, i8* %0, i8* %7
ret i8* %8
}
unsigned short cylsec_to_cyl(unsigned short cylsec) {
  return ((cylsec & 0xC0) << 2) | ((cylsec & 0xFF00) >> 8);
}


x86 assembly (clang, -O0):
<cylsec_to_cyl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xc0,%eax
shl    $0x2,%eax
movzwl -0x2(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cylsec_to_cyl>:
mov    %edi,%eax
and    $0xc0,%eax
shr    $0x8,%edi
lea    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define zeroext i16 @cylsec_to_cyl(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 192
%6 = shl i32 %5, 2
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = and i32 %8, 65280
%10 = ashr i32 %9, 8
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @cylsec_to_cyl(i16 zeroext %0) {
%2 = shl i16 %0, 2
%3 = and i16 %2, 768
%4 = lshr i16 %0, 8
%5 = or i16 %3, %4
ret i16 %5
}
int getAndIncEventId(void) {
  static int counter = 0;
  counter++;
  return counter;
}


x86 assembly (clang, -O0):
<getAndIncEventId>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
mov    0x2f0b(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAndIncEventId>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f15(%rip)
ret

LLVM IR (-O0):
@getAndIncEventId.counter = internal global i32 0
define i32 @getAndIncEventId() {
%1 = load i32, i32* @getAndIncEventId.counter
%2 = add nsw i32 %1, 1
store i32 %2, i32* @getAndIncEventId.counter
%3 = load i32, i32* @getAndIncEventId.counter
ret i32 %3
}

LLVM IR (-O2):
@getAndIncEventId.counter = internal unnamed_addr global i32 0
define i32 @getAndIncEventId() {
%1 = load i32, i32* @getAndIncEventId.counter
%2 = add nsw i32 %1, 1
store i32 %2, i32* @getAndIncEventId.counter
ret i32 %2
}
int pci_proc_attach_device(struct pci_dev *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_proc_attach_device(%struct.pci_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int toascii(char);
int getsn3(char *str) {
  int i;
  int sum;
  sum = 0;
  for (i = 12; i < 17; i++) {
    sum = sum + toascii(str[i]);
  }
  return sum;
}


x86 assembly (clang, -O0):
<getsn3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0xc,-0xc(%rbp)
cmpl   $0x11,-0xc(%rbp)
jge    1163 <getsn3+0x53>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toascii@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <getsn3+0x1a>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsn3>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
movsbl 0xc(%rdi),%edi
call   1030 <toascii@plt>
mov    %eax,%r14d
movsbl 0xd(%r15),%edi
call   1030 <toascii@plt>
mov    %eax,%ebp
add    %r14d,%ebp
movsbl 0xe(%r15),%edi
call   1030 <toascii@plt>
mov    %eax,%ebx
add    %ebp,%ebx
movsbl 0xf(%r15),%edi
call   1030 <toascii@plt>
mov    %eax,%ebp
add    %ebx,%ebp
movsbl 0x10(%r15),%edi
call   1030 <toascii@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getsn3(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = load i8, i8* %2
%4 = tail call i32 @toascii(i8 signext %3)
%5 = getelementptr inbounds i8, i8* %0, i64 13
%6 = load i8, i8* %5
%7 = tail call i32 @toascii(i8 signext %6)
%8 = add nsw i32 %7, %4
%9 = getelementptr inbounds i8, i8* %0, i64 14
%10 = load i8, i8* %9
%11 = tail call i32 @toascii(i8 signext %10)
%12 = add nsw i32 %11, %8
%13 = getelementptr inbounds i8, i8* %0, i64 15
%14 = load i8, i8* %13
%15 = tail call i32 @toascii(i8 signext %14)
%16 = add nsw i32 %15, %12
%17 = getelementptr inbounds i8, i8* %0, i64 16
%18 = load i8, i8* %17
%19 = tail call i32 @toascii(i8 signext %18)
%20 = add nsw i32 %19, %16
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void shell_help() {
  printf("Ulix Usermode Shell 0.10. Commands: %s\n",
         "help, fork, ls, head, sh, loop, test, brk, cd, ln, pwd, read, "
         "scroll, exit, ?");
  printf("Press [Shift+Esc] to launch kernel mode shell (reboot to get back "
         "here)\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Ulix Usermode Shell 0.10. Commands: %s\0A\00"
@.str.1 = [78 x i8] c"help, fork, ls, head, sh, loop, test, brk, cd, ln, pwd, read, scroll, exit, ?\00"
@.str.2 = [73 x i8] c"Press [Shift+Esc] to launch kernel mode shell (reboot to get back here)\0A\00"
define void @shell_help() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Ulix Usermode Shell 0.10. Commands: %s\0A\00"
@.str.1 = [78 x i8] c"help, fork, ls, head, sh, loop, test, brk, cd, ln, pwd, read, scroll, exit, ?\00"
@str = [72 x i8] c"Press [Shift+Esc] to launch kernel mode shell (reboot to get back here)\00"
define void @shell_help() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t r = 0;
  for (; *s++ != 0; r++) {
  }
  return r;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <strlen+0x41>
jmp    1130 <strlen+0x30>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int height;
};
struct TYPE_4__ {
  TYPE_1__ xgraphicsexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xgraphicsexpose_height(void *_p, int _v) {
  ((XEvent *)_p)->xgraphicsexpose.height = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xgraphicsexpose_height>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xgraphicsexpose_height(i8* %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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xgraphicsexpose_height(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  while ((c = getchar()) != EOF)
    if (c == ' ')
      putchar('\n');
    else
      putchar(c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     116e <main+0x4e>
cmpl   $0x20,-0x8(%rbp)
jne    1161 <main+0x41>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1169 <main+0x49>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb7(%rip),%rbx
cmp    (%rbx),%eax
je     1158 <main+0x38>
mov    $0xa,%ebp
nopw   0x0(%rax,%rax,1)
cmp    $0x20,%eax
cmove  %ebp,%eax
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %15, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 32
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @putchar(i32 10)
br label %15
12: ; preds = %7
%13 = load i32, i32* %2
%14 = call i32 @putchar(i32 %13)
br label %15
15: ; preds = %12, %10
br label %3
16: ; preds = %3
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %12, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %9, %4 ], [ %1, %0 ]
%6 = icmp eq i32 %5, 32
%7 = select i1 %6, i32 10, i32 %5
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %4
12: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int iscontinue() {
  char c;
  printf("is continue ?\n");
  scanf(" %c", &c);
  return ((c == 'Y' || c == 'y') ? 1 : 0);
}


x86 assembly (clang, -O0):
<iscontinue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x59,%ecx
mov    %al,-0x2(%rbp)
je     1163 <iscontinue+0x43>
movsbl -0x1(%rbp),%eax
cmp    $0x79,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscontinue>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x7(%rsp),%cl
and    $0xdf,%cl
xor    %eax,%eax
cmp    $0x59,%cl
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"is continue ?\0A\00"
@.str.1 = [4 x i8] c" %c\00"
define i32 @iscontinue() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 89
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 121
br label %11
11: ; preds = %7, %0
%12 = phi i1 [ true, %0 ], [ %10, %7 ]
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
ret i32 %14
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c" %c\00"
@str = [14 x i8] c"is continue ?\00"
define i32 @iscontinue() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = and i8 %4, -33
%6 = icmp eq i8 %5, 89
%7 = zext i1 %6 to i32
ret i32 %7
}
rect_(x1, y1, x2, y2) float *x1, *y1, *x2, *y2;
{ rect(*x1, *y1, *x2, *y2); }


x86 assembly (clang, -O0):
<rect_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm3
cvtss2sd %xmm3,%xmm3
mov    $0x4,%al
call   1030 <rect@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rect_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
movss  (%rdx),%xmm2
cvtss2sd %xmm2,%xmm2
movss  (%rcx),%xmm3
cvtss2sd %xmm3,%xmm3
mov    $0x4,%al
jmp    1030 <rect@plt>

LLVM IR (-O0):
define i32 @rect_(float* %0, float* %1, float* %2, float* %3) {
%5 = alloca i32
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
store float* %0, float** %6
store float* %1, float** %7
store float* %2, float** %8
store float* %3, float** %9
%10 = load float*, float** %6
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = load float*, float** %7
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = load float*, float** %8
%17 = load float, float* %16
%18 = fpext float %17 to double
%19 = load float*, float** %9
%20 = load float, float* %19
%21 = fpext float %20 to double
%22 = call i32 (double, double, double, double, ...) bitcast (i32 (...)* @rect to i32 (double, double, double, double, ...)*)(double %12, double %15, double %18, double %21)
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @rect_(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3) {
%5 = load float, float* %0
%6 = fpext float %5 to double
%7 = load float, float* %1
%8 = fpext float %7 to double
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = tail call i32 (double, double, double, double, ...) bitcast (i32 (...)* @rect to i32 (double, double, double, double, ...)*)(double %6, double %8, double %10, double %12)
ret i32 undef
}
call(foo, a) int (**foo)();
{
  (foo)[1] = call;
  foo[a](1);
}


x86 assembly (clang, -O0):
<call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ed6(%rip),%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    $0x1,%edi
mov    $0x0,%al
call   *(%rcx,%rdx,8)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call>:
mov    0x2ee9(%rip),%rax
mov    %rax,0x8(%rdi)
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
mov    $0x1,%edi
xor    %eax,%eax
jmp    *%rcx

LLVM IR (-O0):
define i32 @call(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 = getelementptr inbounds i32 (...)*, i32 (...)** %6, i64 1
store i32 (...)* bitcast (i32 (i32 (...)**, i32)* @call to i32 (...)*), i32 (...)** %7
%8 = load i32 (...)**, i32 (...)*** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32 (...)*, i32 (...)** %8, i64 %10
%12 = load i32 (...)*, i32 (...)** %11
%13 = bitcast i32 (...)* %12 to i32 (i32, ...)*
%14 = call i32 (i32, ...) %13(i32 1)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @call(i32 (...)** nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32 (...)*, i32 (...)** %0, i64 1
store i32 (...)* bitcast (i32 (i32 (...)**, i32)* @call to i32 (...)*), i32 (...)** %3
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32 (...)*, i32 (...)** %0, i64 %4
%6 = bitcast i32 (...)** %5 to i32 (i32, ...)**
%7 = load i32 (i32, ...)*, i32 (i32, ...)** %6
%8 = tail call i32 (i32, ...) %7(i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ close_log();
int /*<<< orphan*/ info_log(char *, char const *);
int /*<<< orphan*/ init_log();
int /*<<< orphan*/ read_user_data();
void acid_reload(const char *reason) {
  close_log();
  init_log();
  info_log("Reload: %s\n", reason);
  read_user_data();
}


x86 assembly (clang, -O0):
<acid_reload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <close_log@plt>
mov    $0x0,%al
call   1060 <init_log@plt>
mov    -0x8(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1050 <info_log@plt>
mov    $0x0,%al
call   1030 <read_user_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acid_reload>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <close_log@plt>
xor    %eax,%eax
call   1060 <init_log@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
call   1050 <info_log@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <read_user_data@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Reload: %s\0A\00"
define void @acid_reload(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @close_log()
%4 = call i32 (...) @init_log()
%5 = load i8*, i8** %2
%6 = call i32 @info_log(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (...) @read_user_data()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Reload: %s\0A\00"
define void @acid_reload(i8* %0) {
%2 = tail call i32 (...) @close_log()
%3 = tail call i32 (...) @init_log()
%4 = tail call i32 @info_log(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 (...) @read_user_data()
ret void
}
long double momentum_massVelocity(long double M, long double V) {
  return M * V;
}


x86 assembly (clang, -O0):
<momentum_massVelocity>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fmulp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<momentum_massVelocity>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fmulp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @momentum_massVelocity(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fmul x86_fp80 %5, %6
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @momentum_massVelocity(x86_fp80 %0, x86_fp80 %1) {
%3 = fmul x86_fp80 %0, %1
ret x86_fp80 %3
}
/* Variables and functions */
int bma250_read_reg_byte(int);
int /*<<< orphan*/ bma250_write_reg_byte(int, int);
int bma250_power_up(void) {
  bma250_write_reg_byte(0x17,
                        ((bma250_read_reg_byte(0x17) & ~0x10) | ((1) << 4)));
  bma250_write_reg_byte(0x11,
                        ((bma250_read_reg_byte(0x11) & ~0xc0) | ((0) << 6)));
  return (0);
}


x86 assembly (clang, -O0):
<bma250_power_up>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
call   1040 <bma250_read_reg_byte@plt>
mov    %eax,%esi
and    $0xffffffef,%esi
or     $0x10,%esi
mov    $0x17,%edi
call   1030 <bma250_write_reg_byte@plt>
mov    $0x11,%edi
call   1040 <bma250_read_reg_byte@plt>
mov    %eax,%esi
and    $0xffffff3f,%esi
or     $0x0,%esi
mov    $0x11,%edi
call   1030 <bma250_write_reg_byte@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bma250_power_up>:
push   %rax
mov    $0x17,%edi
call   1040 <bma250_read_reg_byte@plt>
or     $0x10,%eax
mov    $0x17,%edi
mov    %eax,%esi
call   1030 <bma250_write_reg_byte@plt>
mov    $0x11,%edi
call   1040 <bma250_read_reg_byte@plt>
and    $0xffffff3f,%eax
mov    $0x11,%edi
mov    %eax,%esi
call   1030 <bma250_write_reg_byte@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bma250_power_up() {
%1 = call i32 @bma250_read_reg_byte(i32 23)
%2 = and i32 %1, -17
%3 = or i32 %2, 16
%4 = call i32 @bma250_write_reg_byte(i32 23, i32 %3)
%5 = call i32 @bma250_read_reg_byte(i32 17)
%6 = and i32 %5, -193
%7 = or i32 %6, 0
%8 = call i32 @bma250_write_reg_byte(i32 17, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @bma250_power_up() {
%1 = tail call i32 @bma250_read_reg_byte(i32 23)
%2 = or i32 %1, 16
%3 = tail call i32 @bma250_write_reg_byte(i32 23, i32 %2)
%4 = tail call i32 @bma250_read_reg_byte(i32 17)
%5 = and i32 %4, -193
%6 = tail call i32 @bma250_write_reg_byte(i32 17, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ decode_id(unsigned char *, unsigned char *, unsigned int *,
                             unsigned long long *);
unsigned char get_table_type(unsigned char id[5]) {
  unsigned char table_type;
  unsigned int table_i;
  unsigned long long row_i;
  decode_id(id, &table_type, &table_i, &row_i);
  return table_type;
}


x86 assembly (clang, -O0):
<get_table_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1030 <decode_id@plt>
movzbl -0x9(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_table_type>:
sub    $0x18,%rsp
lea    0xb(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1030 <decode_id@plt>
mov    0xb(%rsp),%al
add    $0x18,%rsp
ret

LLVM IR (-O0):
define zeroext i8 @get_table_type(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @decode_id(i8* %6, i8* %3, i32* %4, i64* %5)
%8 = load i8, i8* %3
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @get_table_type(i8* %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i64
%5 = bitcast i32* %3 to i8*
%6 = bitcast i64* %4 to i8*
%7 = call i32 @decode_id(i8* %0, i8* %2, i32* %3, i64* %4)
%8 = load i8, i8* %2
ret i8 %8
}
/* Variables and functions */
int f318(int *);
int f319(int *p) { return f318(p); }


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

x86 assembly (clang, -O2):
<f319>:
jmp    1030 <f318@plt>

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

LLVM IR (-O2):
define i32 @f319(i32* %0) {
%2 = tail call i32 @f318(i32* %0)
ret i32 %2
}
char *__attribute__((__unused__)) tilt_slashes(char *s) {
  char *p;
  for (p = s; *p; p++)
    if (*p == '/')
      *p = '\\';
  return s;
}


x86 assembly (clang, -O0):
<tilt_slashes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <tilt_slashes+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1134 <tilt_slashes+0x34>
mov    -0x10(%rbp),%rax
movb   $0x5c,(%rax)
jmp    1139 <tilt_slashes+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <tilt_slashes+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tilt_slashes>:
mov    %rdi,%rax
mov    %rdi,%rcx
jmp    1117 <tilt_slashes+0x17>
nopl   0x0(%rax,%rax,1)
movb   $0x5c,(%rcx)
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x2f,%dl
je     1110 <tilt_slashes+0x10>
test   %dl,%dl
jne    1113 <tilt_slashes+0x13>
ret

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

LLVM IR (-O2):
define i8* @tilt_slashes(i8* returned %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 47, label %5
]
5: ; preds = %2
store i8 92, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret i8* %0
}
int incr(int arg) { return arg + 1; }


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

x86 assembly (clang, -O2):
<incr>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @incr(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int elog_smbios_write_type15(unsigned long *current, int handle) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @elog_smbios_write_type15(i64* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int read_value(const char *path) {
  int value = -1;
  FILE *file = fopen(path, "r");
  if (file != NULL) {
    fscanf(file, "%d", &value);
    fclose(file);
  }
  return value;
}


x86 assembly (clang, -O0):
<read_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117f <read_value+0x4f>
mov    -0x18(%rbp),%rdi
lea    0xe95(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_value>:
push   %rbx
sub    $0x10,%rsp
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1173 <read_value+0x43>
mov    %rax,%rbx
lea    0xeaa(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0xc(%rsp),%eax
jmp    1178 <read_value+0x48>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @read_value(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
store i32 -1, i32* %3
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32*, i32** %4
%11 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%12 = load i32*, i32** %4
%13 = call i32 @fclose(i32* %12)
br label %14
14: ; preds = %9, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @read_value(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 -1, i32* %2
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 @fclose(i32* %4)
%9 = load i32, i32* %2
br label %10
10: ; preds = %6, %1
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}
void g_value_set_char() {}


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

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

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

LLVM IR (-O2):
define void @g_value_set_char() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
void printCharacters(const char *sPtr) {
  for (; *sPtr != '\0'; sPtr++) {
    printf("%c", *sPtr);
  }
}


x86 assembly (clang, -O0):
<printCharacters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <printCharacters+0x40>
mov    -0x8(%rbp),%rax
lea    0xec9(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <printCharacters+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCharacters>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <printCharacters+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <printCharacters+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printCharacters(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
struct sysinfo {
  int freeswap;
  int mem_unit;
};

/* Variables and functions */
int /*<<< orphan*/ sysinfo(struct sysinfo *);
long unsigned freeswap(void) {
  struct sysinfo si;
  sysinfo(&si);
  return ((si.freeswap / 1024) * si.mem_unit);
}


x86 assembly (clang, -O0):
<freeswap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <sysinfo@plt>
mov    -0x8(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
imul   -0x4(%rbp),%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeswap>:
push   %rax
mov    %rsp,%rdi
call   1030 <sysinfo@plt>
mov    (%rsp),%eax
lea    0x3ff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0xa,%ecx
movslq 0x4(%rsp),%rdx
movslq %ecx,%rax
imul   %rdx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sysinfo = type { i32, i32 }
define i64 @freeswap() {
%1 = alloca %struct.sysinfo
%2 = call i32 @sysinfo(%struct.sysinfo* %1)
%3 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sdiv i32 %4, 1024
%6 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = mul nsw i32 %5, %7
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
%struct.sysinfo = type { i32, i32 }
define i64 @freeswap() {
%1 = alloca %struct.sysinfo
%2 = bitcast %struct.sysinfo* %1 to i8*
%3 = call i32 @sysinfo(%struct.sysinfo* %1)
%4 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1024
%7 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %6, %8
%10 = sext i32 %9 to i64
ret i64 %10
}
int _default_storage_synch() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_default_storage_synch() {
ret i32 0
}
__typeof__(printf(1, "")) test_printf_240(void) { return printf(1, ""); }


x86 assembly (clang, -O0):
<test_printf_240>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_printf_240>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_printf_240() {
%1 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_printf_240() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void *strdup(char const *);
void *__xstrdup(const char *s, char *at) {
  void *ptr;
  ptr = strdup(s);
  if (!ptr) {
    fprintf(stderr, "%s: out of memory", at);
    abort();
  }
  return ptr;
}


x86 assembly (clang, -O0):
<__xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1178 <__xstrdup+0x48>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__xstrdup>:
push   %rbx
mov    %rsi,%rbx
call   1050 <strdup@plt>
test   %rax,%rax
je     1140 <__xstrdup+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"%s: out of memory\00"
define i8* @__xstrdup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"%s: out of memory\00"
define noalias i8* @__xstrdup(i8* nocapture %0, i8* %1) {
%3 = tail call i8* @strdup(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void element_linebreak_output(FILE *output_file) {
  fprintf(output_file, "<tr>\n");
}


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

x86 assembly (clang, -O2):
<element_linebreak_output>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"<tr>\0A\00"
define void @element_linebreak_output(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"<tr>\0A\00"
define void @element_linebreak_output(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5, i64 1, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t endian(uint32_t v) {
  unsigned char *aux, *o;
  uint32_t out;
  aux = (unsigned char *)&v;
  o = (unsigned char *)&out;
  o[3] = aux[0];
  o[2] = aux[1];
  o[1] = aux[2];
  o[0] = aux[3];
  return (out);
}


x86 assembly (clang, -O0):
<endian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @endian(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_write_dobldobl_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(341, a, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<solcon_write_dobldobl_solutions>:
mov    $0x155,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @solcon_write_dobldobl_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 341, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
void *calloc(int, unsigned long);
void *vzalloc(unsigned long size) { return calloc(1, size); }


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

x86 assembly (clang, -O2):
<vzalloc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define i8* @vzalloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t swap_endian_16(uint16_t i) {
  return ((i & 0xff) << 8) | ((i & 0xff00) >> 8);
}


x86 assembly (clang, -O0):
<swap_endian_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_endian_16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @swap_endian_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @swap_endian_16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}