xunge/DecIR huggingface dataset:
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, short, short);
void RNDResponseSink_RenderingControl_GetVolumeDBRange(
    struct UPnPService *Service, int ErrorCode, void *User, short MinValue,
    short MaxValue) {
  printf("RND Invoke Response: "
         "RenderingControl/GetVolumeDBRange[ErrorCode:%d](%d,%d)\r\n",
         ErrorCode, MinValue, MaxValue);
}


x86 assembly (clang, -O0):
<RNDResponseSink_RenderingControl_GetVolumeDBRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8w,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %cx,-0x1a(%rbp)
mov    %ax,-0x1c(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x1a(%rbp),%ax
lea    0xec3(%rip),%rdi
movswl %ax,%edx
movswl -0x1c(%rbp),%ecx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNDResponseSink_RenderingControl_GetVolumeDBRange>:
lea    0xee9(%rip),%rdi
mov    %ecx,%edx
mov    %r8d,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: RenderingControl/GetVolumeDBRange[ErrorCode:%d](%d,%d)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_GetVolumeDBRange(%struct.UPnPService* %0, i32 %1, i8* %2, i16 signext %3, i16 signext %4) {
%6 = alloca %struct.UPnPService*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i16
%10 = alloca i16
store %struct.UPnPService* %0, %struct.UPnPService** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i16 %3, i16* %9
store i16 %4, i16* %10
%11 = load i32, i32* %7
%12 = load i16, i16* %9
%13 = load i16, i16* %10
%14 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %11, i16 signext %12, i16 signext %13)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: RenderingControl/GetVolumeDBRange[ErrorCode:%d](%d,%d)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_GetVolumeDBRange(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i16 signext %3, i16 signext %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %1, i16 signext %3, i16 signext %4)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t isWhite(char ch) {
  switch (ch) {
  case ' ':
  case '\t':
  case '\r':
  case '\n':
    return (!(0));
  default:
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<isWhite>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1144 <isWhite+0x44>
jmp    1122 <isWhite+0x22>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     1144 <isWhite+0x44>
jmp    1133 <isWhite+0x33>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    1150 <isWhite+0x50>
jmp    1144 <isWhite+0x44>
movl   $0x1,-0x4(%rbp)
jmp    115c <isWhite+0x5c>
jmp    1155 <isWhite+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isWhite>:
cmp    $0x20,%edi
ja     111d <isWhite+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    111d <isWhite+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isWhite(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 32, label %6
i32 9, label %6
i32 13, label %6
i32 10, label %6
]
6: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %9
7: ; preds = %1
br label %8
8: ; preds = %7
store i32 0, i32* %2
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @isWhite(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 32, label %4
i32 9, label %4
i32 13, label %4
i32 10, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
void RTMemLockedFree(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemLockedFree() {
ret void
}
void f160(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
a:
  ({
    ({ 0; });
    ({ 0; });
    goto a;
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f160>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
jmp    1119 <f160+0x19>

x86 assembly (clang, -O2):
<f160>:
jmp    1100 <f160>

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

LLVM IR (-O2):
define void @f160() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void OS_InterruptServiceRoutine(unsigned int status) {
  (void)status;
  putchar('I');
}


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

x86 assembly (clang, -O2):
<OS_InterruptServiceRoutine>:
mov    $0x49,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @OS_InterruptServiceRoutine(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @putchar(i8 signext 73)
ret void
}

LLVM IR (-O2):
define void @OS_InterruptServiceRoutine(i32 %0) {
%2 = tail call i32 @putchar(i8 signext 73)
ret void
}
/* Variables and functions */
char *skip_initial_comment(char *, int);
int strcmp(char *, char *);
int compare_buf(char *buf1, int len1, char *buf2, int len2) {
  char *b1 = skip_initial_comment(buf1, len1);
  char *b2 = skip_initial_comment(buf2, len2);
  return strcmp(b1, b2);
}


x86 assembly (clang, -O0):
<compare_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <skip_initial_comment@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <skip_initial_comment@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <strcmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_buf>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
call   1030 <skip_initial_comment@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <skip_initial_comment@plt>
mov    %rbp,%rdi
mov    %rax,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare_buf(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i8* @skip_initial_comment(i8* %11, i32 %12)
store i8* %13, i8** %9
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i8* @skip_initial_comment(i8* %14, i32 %15)
store i8* %16, i8** %10
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = call i32 @strcmp(i8* %17, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @compare_buf(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i8* @skip_initial_comment(i8* %0, i32 %1)
%6 = tail call i8* @skip_initial_comment(i8* %2, i32 %3)
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef int __u_char;

/* Variables and functions */
int /*<<< orphan*/ _IO(int, int /*<<< orphan*/);
int ioctl(int, int /*<<< orphan*/, int);
int cbm_talk(int f, __u_char dev, __u_char secadr) {
  return ioctl(f, _IO(0xcb, 0), (dev << 8) | secadr);
}


x86 assembly (clang, -O0):
<cbm_talk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0xcb,%edi
xor    %esi,%esi
call   1030 <_IO@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
shl    $0x8,%edx
or     -0xc(%rbp),%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbm_talk>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0xcb,%edi
xor    %esi,%esi
call   1030 <_IO@plt>
shl    $0x8,%ebp
or     %ebp,%ebx
mov    %r14d,%edi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbm_talk(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @_IO(i32 203, i32 0)
%9 = load i32, i32* %5
%10 = shl i32 %9, 8
%11 = load i32, i32* %6
%12 = or i32 %10, %11
%13 = call i32 @ioctl(i32 %7, i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @cbm_talk(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_IO(i32 203, i32 0)
%5 = shl i32 %1, 8
%6 = or i32 %5, %2
%7 = tail call i32 @ioctl(i32 %0, i32 %4, i32 %6)
ret i32 %7
}
char *DiagCommandString(char *pcBuf, unsigned long ulLen) { return (0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @DiagCommandString(i8* nocapture readnone %0, i64 %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ disp_int(int /*<<< orphan*/);
int /*<<< orphan*/ disp_str(char *);
int /*<<< orphan*/ get_ticks();
int /*<<< orphan*/ milli_delay(int);
void TestA() {
  int i = 0;
  while (1) {
    disp_str("A");
    disp_int(get_ticks());
    disp_str(".");
    milli_delay(1000);
  }
}


x86 assembly (clang, -O0):
<TestA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <disp_str@plt>
mov    $0x0,%al
call   1040 <get_ticks@plt>
mov    %eax,%edi
call   1060 <disp_int@plt>
lea    0xe92(%rip),%rdi
call   1030 <disp_str@plt>
mov    $0x3e8,%edi
call   1050 <milli_delay@plt>
jmp    114f <TestA+0xf>

x86 assembly (clang, -O2):
<TestA>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%r14
lea    0xeb0(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <disp_str@plt>
xor    %eax,%eax
call   1040 <get_ticks@plt>
mov    %eax,%edi
call   1060 <disp_int@plt>
mov    %rbx,%rdi
call   1030 <disp_str@plt>
mov    $0x3e8,%edi
call   1050 <milli_delay@plt>
jmp    1160 <TestA+0x20>

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
@.str.1 = [2 x i8] c".\00"
define void @TestA() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @get_ticks()
%5 = call i32 @disp_int(i32 %4)
%6 = call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @milli_delay(i32 1000)
br label %2
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
@.str.1 = [2 x i8] c".\00"
define void @TestA() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @get_ticks()
%4 = tail call i32 @disp_int(i32 %3)
%5 = tail call i32 @disp_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @milli_delay(i32 1000)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ StreamStop(int, int /*<<< orphan*/);
int /*<<< orphan*/ flushStream(int);
int doFlush(int socketFDA) {
  StreamStop(socketFDA, 0);
  flushStream(socketFDA);
  return 0;
}


x86 assembly (clang, -O0):
<doFlush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <StreamStop@plt>
mov    -0x4(%rbp),%edi
call   1040 <flushStream@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doFlush>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1030 <StreamStop@plt>
mov    %ebx,%edi
call   1040 <flushStream@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @doFlush(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @StreamStop(i32 %3, i32 0)
%5 = load i32, i32* %2
%6 = call i32 @flushStream(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @doFlush(i32 %0) {
%2 = tail call i32 @StreamStop(i32 %0, i32 0)
%3 = tail call i32 @flushStream(i32 %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int span_dummy_mod(void *user_data, int16_t amp[], int len) { return len; }


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

x86 assembly (clang, -O2):
<span_dummy_mod>:
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @span_dummy_mod(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @span_dummy_mod(i8* nocapture readnone %0, i32* nocapture readnone %1, i32 returned %2) {
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x58() {
  Assert_real((isxdigit(88) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              445, ("isxdigit should be 0 for X"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x58>:
push   %rax
mov    $0x58,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1bd,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for X\00"
define void @t_isxdigit_0x58() {
%1 = call i64 @isxdigit(i32 88)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for X\00"
define void @t_isxdigit_0x58() {
%1 = tail call i64 @isxdigit(i32 88)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int standardize_cell(double **, double **, int *, int const, int /*<<< orphan*/,
                     double const, double const);
int spgat_refine_cell(double lattice[3][3], double position[][3], int types[],
                      const int num_atom, const double symprec,
                      const double angle_tolerance) {
  return standardize_cell(lattice, position, types, num_atom, 0, symprec,
                          angle_tolerance);
}


x86 assembly (clang, -O0):
<spgat_refine_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
xor    %r8d,%r8d
call   1030 <standardize_cell@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spgat_refine_cell>:
xor    %r8d,%r8d
jmp    1030 <standardize_cell@plt>

LLVM IR (-O0):
define i32 @spgat_refine_cell([3 x double]* %0, [3 x double]* %1, i32* %2, i32 %3, double %4, double %5) {
%7 = alloca [3 x double]*
%8 = alloca [3 x double]*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca double
%12 = alloca double
store [3 x double]* %0, [3 x double]** %7
store [3 x double]* %1, [3 x double]** %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store double %4, double* %11
store double %5, double* %12
%13 = load [3 x double]*, [3 x double]** %7
%14 = bitcast [3 x double]* %13 to double**
%15 = load [3 x double]*, [3 x double]** %8
%16 = bitcast [3 x double]* %15 to double**
%17 = load i32*, i32** %9
%18 = load i32, i32* %10
%19 = load double, double* %11
%20 = load double, double* %12
%21 = call i32 @standardize_cell(double** %14, double** %16, i32* %17, i32 %18, i32 0, double %19, double %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @spgat_refine_cell([3 x double]* %0, [3 x double]* %1, i32* %2, i32 %3, double %4, double %5) {
%7 = bitcast [3 x double]* %0 to double**
%8 = bitcast [3 x double]* %1 to double**
%9 = tail call i32 @standardize_cell(double** %7, double** %8, i32* %2, i32 %3, i32 0, double %4, double %5)
ret i32 %9
}
/* Variables and functions */
int partition(int *, int, int);
void tail_recursive_quicksort(int A[], int p, int r) {
  int q = 0;
  while (p < r) {
    q = partition(A, p, r);
    tail_recursive_quicksort(A, p, q - 1);
    p = q + 1;
  }
}


x86 assembly (clang, -O0):
<tail_recursive_quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1177 <tail_recursive_quicksort+0x57>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <tail_recursive_quicksort@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <tail_recursive_quicksort+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tail_recursive_quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <tail_recursive_quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <tail_recursive_quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <tail_recursive_quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @tail_recursive_quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @tail_recursive_quicksort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
char getb(char *a, int index) {
  int k = index / 8;
  int R = 7 - index % 8;
  return (a[k] >> R & 1);
}


x86 assembly (clang, -O0):
<getb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    $0x7,%eax
sub    %edx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x14(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getb>:
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%esi
sar    $0x3,%eax
cltq
movsbl (%rdi,%rax,1),%eax
mov    $0x7,%cl
sub    %sil,%cl
shr    %cl,%eax
and    $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @getb(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 i32, i32* %4
%8 = sdiv i32 %7, 8
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = srem i32 %9, 8
%11 = sub nsw i32 7, %10
store i32 %11, i32* %6
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i32, i32* %6
%19 = ashr i32 %17, %18
%20 = and i32 %19, 1
%21 = trunc i32 %20 to i8
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @getb(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = srem i32 %1, 8
%5 = sub nsw i32 7, %4
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = lshr i32 %9, %5
%11 = trunc i32 %10 to i8
%12 = and i8 %11, 1
ret i8 %12
}
int levelmatch(struct initrec *p, int level) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.initrec = type opaque
define i32 @levelmatch(%struct.initrec* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _mc_free(void *ptr, const char *name, int line) {
  ;
  ;
  free(ptr);
}


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

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

LLVM IR (-O0):
define void @_mc_free(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @_mc_free(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int auditwarnlog(char **);
int audit_warn_allsoft(void) {
  char *args[2];
  args[0] = "allsoft";
  args[1] = NULL;
  return (auditwarnlog(args));
}


x86 assembly (clang, -O0):
<audit_warn_allsoft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <auditwarnlog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audit_warn_allsoft>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rax
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rdi
call   1030 <auditwarnlog@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"allsoft\00"
define i32 @audit_warn_allsoft() {
%1 = alloca [2 x i8*]
%2 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%5 = call i32 @auditwarnlog(i8** %4)
ret i32 %5
}

LLVM IR (-O2):
@.str = [8 x i8] c"allsoft\00"
define i32 @audit_warn_allsoft() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %4
%5 = call i32 @auditwarnlog(i8** %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pointersFunction();
int /*<<< orphan*/ printLimits();
int /*<<< orphan*/ printPointersToFunction();
int /*<<< orphan*/ printSizeOfTypes();
int main(int argc, char *argv[]) {
  printSizeOfTypes();
  printLimits();
  pointersFunction();
  printPointersToFunction();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <printSizeOfTypes@plt>
xor    %eax,%eax
call   1030 <printLimits@plt>
xor    %eax,%eax
call   1050 <pointersFunction@plt>
xor    %eax,%eax
call   1040 <printPointersToFunction@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @printSizeOfTypes()
%7 = call i32 (...) @printLimits()
%8 = call i32 (...) @pointersFunction()
%9 = call i32 (...) @printPointersToFunction()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @printSizeOfTypes()
%4 = tail call i32 (...) @printLimits()
%5 = tail call i32 (...) @pointersFunction()
%6 = tail call i32 (...) @printPointersToFunction()
ret i32 0
}
/* Variables and functions */
unsigned int w_tolower(char const);
unsigned int w_str_hash_case(const void *data) {
  const char *s = (const char *)data;
  unsigned int h = 0;
  while (*s) {
    h = (h << 3) + w_tolower(*s);
    s++;
  }
  return h;
}


x86 assembly (clang, -O0):
<w_str_hash_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <w_str_hash_case+0x58>
mov    -0x14(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <w_tolower@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <w_str_hash_case+0x1b>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_str_hash_case>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1149 <w_str_hash_case+0x39>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <w_tolower@plt>
lea    (%rax,%r14,8),%r14d
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <w_str_hash_case+0x20>
jmp    114c <w_str_hash_case+0x3c>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @w_str_hash_case(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 3
%9 = tail call i32 @w_tolower(i8 signext %5)
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
int myrint(double val) {
  if (val >= 0)
    return (int)(val + 0.5);
  else
    return (int)(val - 0.5);
}


x86 assembly (clang, -O0):
<myrint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1134 <myrint+0x34>
movsd  0xedd(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    114c <myrint+0x4c>
movsd  -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrint>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setb   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @myrint(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fadd double %7, 5.000000e-01
%9 = fptosi double %8 to i32
store i32 %9, i32* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fsub double %11, 5.000000e-01
%13 = fptosi double %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @myrint(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int count_lines(FILE *fp) {
  int ch;
  int lines = 0;
  while (EOF != (ch = getc(fp))) {
    if (ch == '\n') {
      lines++;
    }
  }
  rewind(fp);
  return lines;
}


x86 assembly (clang, -O0):
<count_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
mov    %ecx,-0xc(%rbp)
cmp    %ecx,%eax
je     1170 <count_lines+0x50>
cmpl   $0xa,-0xc(%rbp)
jne    116b <count_lines+0x4b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <count_lines+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_lines>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r12
mov    0x2eb6(%rip),%r14
mov    (%r14),%r15d
call   1040 <getc@plt>
xor    %ebp,%ebp
cmp    %eax,%r15d
je     1169 <count_lines+0x49>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebp
mov    (%r14),%ebx
mov    %r12,%rdi
call   1040 <getc@plt>
cmp    %eax,%ebx
jne    1150 <count_lines+0x30>
mov    %r12,%rdi
call   1030 <rewind@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @count_lines(i32* nocapture %0) {
%2 = load i32, i32* @EOF
%3 = tail call i32 @getc(i32* %0)
%4 = icmp eq i32 %2, %3
br i1 %4, label %14, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %12, %5 ], [ %3, %1 ]
%7 = phi i32 [ %10, %5 ], [ 0, %1 ]
%8 = icmp eq i32 %6, 10
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %7, %9
%11 = load i32, i32* @EOF
%12 = tail call i32 @getc(i32* %0)
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %5
14: ; preds = %5, %1
%15 = phi i32 [ 0, %1 ], [ %10, %5 ]
%16 = tail call i32 @rewind(i32* %0)
ret i32 %15
}
long double sqrtl(long double x) {
  __asm__("fsqrt" : "+t"(x));
  return x;
}


x86 assembly (clang, -O0):
<sqrtl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fsqrt
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrtl>:
fldt   0x8(%rsp)
fsqrt
ret

LLVM IR (-O0):
define x86_fp80 @sqrtl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 asm "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %3)
store x86_fp80 %4, x86_fp80* %2
%5 = load x86_fp80, x86_fp80* %2
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @sqrtl(x86_fp80 %0) {
%2 = tail call x86_fp80 asm "fsqrt", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
ret x86_fp80 %2
}
const char *GeoIP_lib_version(void) { return "1.4.8"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"1.4.8\00"
define i8* @GeoIP_lib_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct pane {
  int dummy;
};

/* Variables and functions */
int atoi(char *);
char *pane_attr_get(struct pane *, char *);
int get_scale(struct pane *p) {
  char *sc = pane_attr_get(p, "scale");
  int scale;
  if (!sc)
    return 1000;
  scale = atoi(sc);
  if (scale > 3)
    return scale;
  return 1000;
}


x86 assembly (clang, -O0):
<get_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <pane_attr_get@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <get_scale+0x37>
movl   $0x3e8,-0x4(%rbp)
jmp    117f <get_scale+0x5f>
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jle    1178 <get_scale+0x58>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <get_scale+0x5f>
movl   $0x3e8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_scale>:
push   %rax
lea    0xed8(%rip),%rsi
call   1030 <pane_attr_get@plt>
test   %rax,%rax
je     1149 <get_scale+0x29>
mov    %rax,%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
cmp    $0x4,%eax
mov    $0x3e8,%eax
cmovge %ecx,%eax
pop    %rcx
ret
mov    $0x3e8,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pane = type { i32 }
@.str = [6 x i8] c"scale\00"
define i32 @get_scale(%struct.pane* %0) {
%2 = alloca i32
%3 = alloca %struct.pane*
%4 = alloca i8*
%5 = alloca i32
store %struct.pane* %0, %struct.pane** %3
%6 = load %struct.pane*, %struct.pane** %3
%7 = call i8* @pane_attr_get(%struct.pane* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i32 1000, i32* %2
br label %19
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = icmp sgt i32 %14, 3
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = load i32, i32* %5
store i32 %17, i32* %2
br label %19
18: ; preds = %11
store i32 1000, i32* %2
br label %19
19: ; preds = %18, %16, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.pane = type { i32 }
@.str = [6 x i8] c"scale\00"
define i32 @get_scale(%struct.pane* %0) {
%2 = tail call i8* @pane_attr_get(%struct.pane* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @atoi(i8* %2)
%6 = icmp sgt i32 %5, 3
%7 = select i1 %6, i32 %5, i32 1000
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1000, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("echo 'dude its running'");
  system("sleep 2");
  system("echo 'dude it stopped'");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"echo 'dude its running'\00"
@.str.1 = [8 x i8] c"sleep 2\00"
@.str.2 = [23 x i8] c"echo 'dude it stopped'\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"echo 'dude its running'\00"
@.str.1 = [8 x i8] c"sleep 2\00"
@.str.2 = [23 x i8] c"echo 'dude it stopped'\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(int *, size_t, int, int /*<<< orphan*/ *);
size_t Mem_FreadInt(int *integer, FILE *fp) {
  size_t nbytes;
  nbytes = fread(integer, (size_t)1, sizeof(*integer), fp);
  return nbytes;
}


x86 assembly (clang, -O0):
<Mem_FreadInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mem_FreadInt>:
mov    %rsi,%rcx
mov    $0x1,%esi
mov    $0x4,%edx
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i64 @Mem_FreadInt(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fread(i32* %0, i64 1, i32 4, i32* %1)
ret i64 %3
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double real_get_seconds() {
  struct timeval tv;
  double total;
  gettimeofday(&tv, NULL);
  total = (double)tv.tv_sec;
  total += ((double)tv.tv_usec) / (double)1000000.0;
  return total;
}


x86 assembly (clang, -O0):
<real_get_seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_get_seconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @real_get_seconds() {
%1 = alloca %struct.timeval
%2 = alloca double
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
store double %6, double* %2
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = load double, double* %2
%12 = fadd double %11, %10
store double %12, double* %2
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @real_get_seconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
char *sep_path(char *stream, char *path_buf) {
  if (*stream == ' ')
    stream++;
  while (*stream != ' ') {
    *path_buf = *stream;
    stream++;
    path_buf++;
  }
  *path_buf = '\0';
  return stream;
}


x86 assembly (clang, -O0):
<sep_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1128 <sep_path+0x28>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112d <sep_path+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1166 <sep_path+0x66>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112d <sep_path+0x2d>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sep_path>:
xor    %ecx,%ecx
cmpb   $0x20,(%rdi)
sete   %cl
lea    (%rdi,%rcx,1),%rax
mov    (%rdi,%rcx,1),%cl
cmp    $0x20,%cl
je     1133 <sep_path+0x33>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %cl,(%rsi)
add    $0x1,%rsi
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    $0x20,%cl
jne    1120 <sep_path+0x20>
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define i8* @sep_path(i8* %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 32
%5 = zext i1 %4 to i64
%6 = getelementptr i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 32
br i1 %8, label %17, label %9
9: ; preds = %2, %9
%10 = phi i8 [ %15, %9 ], [ %7, %2 ]
%11 = phi i8* [ %14, %9 ], [ %1, %2 ]
%12 = phi i8* [ %13, %9 ], [ %6, %2 ]
store i8 %10, i8* %11
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = getelementptr inbounds i8, i8* %11, i64 1
%15 = load i8, i8* %13
%16 = icmp eq i8 %15, 32
br i1 %16, label %17, label %9
17: ; preds = %9, %2
%18 = phi i8* [ %6, %2 ], [ %13, %9 ]
%19 = phi i8* [ %1, %2 ], [ %14, %9 ]
store i8 0, i8* %19
ret i8* %18
}
/* Type definitions */
struct lu_phy_attr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_log_tape_alert(struct lu_phy_attr *);
int /*<<< orphan*/ add_log_temperature_page(struct lu_phy_attr *);
void init_smc_log_pages(struct lu_phy_attr *lu) {
  add_log_temperature_page(lu);
  add_log_tape_alert(lu);
}


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

x86 assembly (clang, -O2):
<init_smc_log_pages>:
push   %rbx
mov    %rdi,%rbx
call   1040 <add_log_temperature_page@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <add_log_tape_alert@plt>

LLVM IR (-O0):
%struct.lu_phy_attr = type { i32 }
define void @init_smc_log_pages(%struct.lu_phy_attr* %0) {
%2 = alloca %struct.lu_phy_attr*
store %struct.lu_phy_attr* %0, %struct.lu_phy_attr** %2
%3 = load %struct.lu_phy_attr*, %struct.lu_phy_attr** %2
%4 = call i32 @add_log_temperature_page(%struct.lu_phy_attr* %3)
%5 = load %struct.lu_phy_attr*, %struct.lu_phy_attr** %2
%6 = call i32 @add_log_tape_alert(%struct.lu_phy_attr* %5)
ret void
}

LLVM IR (-O2):
%struct.lu_phy_attr = type { i32 }
define void @init_smc_log_pages(%struct.lu_phy_attr* %0) {
%2 = tail call i32 @add_log_temperature_page(%struct.lu_phy_attr* %0)
%3 = tail call i32 @add_log_tape_alert(%struct.lu_phy_attr* %0)
ret void
}
/* Variables and functions */
double pow(double, double);
double area_square(double side) { return pow(side, 2.0); }


x86 assembly (clang, -O0):
<area_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<area_square>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @area_square(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 2.000000e+00)
ret double %4
}

LLVM IR (-O2):
define double @area_square(double %0) {
%2 = fmul double %0, %0
ret double %2
}