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

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


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

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

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

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [70 x i8] c"RND Invoke Response: RenderingControl/GetVolumeDB[ErrorCode:%d](%d)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_GetVolumeDB(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i16 signext %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 %1, i16 signext %3)
ret void
}
/* Variables and functions */
int ap_get_single_string_command(int, int, char *, int);
int ap_get_genre(int session, char *str) {
  return (ap_get_single_string_command(session, 0xcc12, str, 256));
}


x86 assembly (clang, -O0):
<ap_get_genre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0xcc12,%esi
mov    $0x100,%ecx
call   1030 <ap_get_single_string_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_get_genre>:
mov    %rsi,%rdx
mov    $0xcc12,%esi
mov    $0x100,%ecx
jmp    1030 <ap_get_single_string_command@plt>

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

LLVM IR (-O2):
define i32 @ap_get_genre(i32 %0, i8* %1) {
%3 = tail call i32 @ap_get_single_string_command(i32 %0, i32 52242, i8* %1, i32 256)
ret i32 %3
}
/* Variables and functions */
char *getAuthor();
char *getPub();
char *getPubCity();
char *getPubYear();
char *getTitle();
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, char *);
void bookCitation() {
  printf("%s. \"%s\". %s: %s. %s.\n", getAuthor(), getTitle(), getPubCity(),
         getPub(), getPubYear());
}


x86 assembly (clang, -O0):
<bookCitation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1060 <getAuthor@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1050 <getTitle@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1080 <getPubCity@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getPub@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <getPubYear@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    %rax,%r9
lea    0xe4b(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bookCitation>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <getAuthor@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1050 <getTitle@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1080 <getPubCity@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1030 <getPub@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1070 <getPubYear@plt>
lea    0xe62(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
mov    %rax,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%s. \22%s\22. %s: %s. %s.\0A\00"
define void @bookCitation() {
%1 = call i8* (...) @getAuthor()
%2 = call i8* (...) @getTitle()
%3 = call i8* (...) @getPubCity()
%4 = call i8* (...) @getPub()
%5 = call i8* (...) @getPubYear()
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3, i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s. \22%s\22. %s: %s. %s.\0A\00"
define void @bookCitation() {
%1 = tail call i8* (...) @getAuthor()
%2 = tail call i8* (...) @getTitle()
%3 = tail call i8* (...) @getPubCity()
%4 = tail call i8* (...) @getPub()
%5 = tail call i8* (...) @getPubYear()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3, i8* %4, i8* %5)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int32_t Triangle(uint32_t phase) {
  if (phase & 0x80000000) {
    return (~(*(int32_t *)&(phase)) - 0x40000000) >> 1;
  } else {
    return ((*(int32_t *)&(phase)) - 0x40000000) >> 1;
  }
}


x86 assembly (clang, -O0):
<Triangle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     112e <Triangle+0x2e>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
sub    $0x40000000,%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113c <Triangle+0x3c>
mov    -0x8(%rbp),%eax
sub    $0x40000000,%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Triangle>:
mov    $0xbfffffff,%ecx
sub    %edi,%ecx
lea    -0x40000000(%rdi),%eax
test   %edi,%edi
cmovs  %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @Triangle(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, -2147483648
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = xor i32 %8, -1
%10 = sub nsw i32 %9, 1073741824
%11 = ashr i32 %10, 1
store i32 %11, i32* %2
br label %16
12: ; preds = %1
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 1073741824
%15 = ashr i32 %14, 1
store i32 %15, i32* %2
br label %16
16: ; preds = %12, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @Triangle(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = sub i32 -1073741825, %0
%4 = add nsw i32 %0, -1073741824
%5 = select i1 %2, i32 %4, i32 %3
%6 = ashr i32 %5, 1
ret i32 %6
}
float kmMin(float lhs, float rhs) { return (lhs < rhs) ? lhs : rhs; }


x86 assembly (clang, -O0):
<kmMin>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <kmMin+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <kmMin+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmMin>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @kmMin(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @kmMin(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void DoFoo2(void) { printf("Foo2\n"); }


x86 assembly (clang, -O0):
<DoFoo2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoFoo2>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Foo2\0A\00"
define void @DoFoo2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"Foo2\00"
define void @DoFoo2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
void USB_SuspendDevice(struct ehci_device *fd) { return; }


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

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

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

LLVM IR (-O2):
%struct.ehci_device = type opaque
define void @USB_SuspendDevice(%struct.ehci_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x39() {
  Assert_real((isprint(57)),
              "/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_isprint.c",
              290, ("isprint should be 1 for 9"));
}


x86 assembly (clang, -O0):
<t_isprint_0x39>:
push   %rbp
mov    %rsp,%rbp
mov    $0x39,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x122,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x39>:
push   %rax
mov    $0x39,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x122,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for 9\00"
define void @t_isprint_0x39() {
%1 = call i32 @isprint(i32 57)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 290, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for 9\00"
define void @t_isprint_0x39() {
%1 = tail call i32 @isprint(i32 57)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 290, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popcharacterarray(char *x, int n) { popNarray(x, (unsigned int)n); }


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

x86 assembly (clang, -O2):
<popcharacterarray>:
jmp    1030 <popNarray@plt>

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

LLVM IR (-O2):
define void @popcharacterarray(i8* %0, i32 %1) {
%3 = tail call i32 @popNarray(i8* %0, i32 %1)
ret void
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ zero_user(struct page *, unsigned int, unsigned int);
__attribute__((always_)) void memclear_highpage_flush(struct page *page,
                                                      unsigned int offset,
                                                      unsigned int size) {
  zero_user(page, offset, size);
}


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

x86 assembly (clang, -O2):
<memclear_highpage_flush>:
jmp    1030 <zero_user@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define void @memclear_highpage_flush(%struct.page* %0, i32 %1, i32 %2) {
%4 = alloca %struct.page*
%5 = alloca i32
%6 = alloca i32
store %struct.page* %0, %struct.page** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.page*, %struct.page** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @zero_user(%struct.page* %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.page = type { i32 }
define void @memclear_highpage_flush(%struct.page* %0, i32 %1, i32 %2) {
%4 = tail call i32 @zero_user(%struct.page* %0, i32 %1, i32 %2)
ret void
}
unsigned long long
nlm_crypto_form_rsa_ecc_fmn_entry1(unsigned int dstclobber,
                                   unsigned int l3alloc, unsigned int fbvc,
                                   unsigned long long dstaddr) {
  return ((unsigned long long)(dstclobber) << (62)) |
         ((unsigned long long)(l3alloc) << (61)) |
         ((unsigned long long)(fbvc) << (40)) |
         ((unsigned long long)(dstaddr) << (0));
}


x86 assembly (clang, -O0):
<nlm_crypto_form_rsa_ecc_fmn_entry1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3e,%rax
mov    -0x8(%rbp),%ecx
shl    $0x3d,%rcx
or     %rcx,%rax
mov    -0xc(%rbp),%ecx
shl    $0x28,%rcx
or     %rcx,%rax
mov    -0x18(%rbp),%rcx
shl    $0x0,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlm_crypto_form_rsa_ecc_fmn_entry1>:
mov    %edx,%eax
shl    $0x3e,%rdi
shl    $0x3d,%rsi
or     %rdi,%rsi
shl    $0x28,%rax
or     %rcx,%rax
or     %rsi,%rax
ret

LLVM IR (-O0):
define i64 @nlm_crypto_form_rsa_ecc_fmn_entry1(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = shl i64 %10, 62
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
%14 = shl i64 %13, 61
%15 = or i64 %11, %14
%16 = load i32, i32* %7
%17 = zext i32 %16 to i64
%18 = shl i64 %17, 40
%19 = or i64 %15, %18
%20 = load i64, i64* %8
%21 = shl i64 %20, 0
%22 = or i64 %19, %21
ret i64 %22
}

LLVM IR (-O2):
define i64 @nlm_crypto_form_rsa_ecc_fmn_entry1(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = zext i32 %0 to i64
%6 = shl i64 %5, 62
%7 = zext i32 %1 to i64
%8 = shl i64 %7, 61
%9 = or i64 %8, %6
%10 = zext i32 %2 to i64
%11 = shl i64 %10, 40
%12 = or i64 %9, %3
%13 = or i64 %12, %11
ret i64 %13
}
void quat_imul(float a[4], const float b[4]) { quat_mul(a, b, a); }


x86 assembly (clang, -O0):
<quat_imul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1030 <quat_mul@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_imul>:
mov    %rdi,%rdx
xor    %eax,%eax
jmp    1030 <quat_mul@plt>

LLVM IR (-O0):
define void @quat_imul(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = load float*, float** %3
%8 = call i32 (float*, float*, float*, ...) bitcast (i32 (...)* @quat_mul to i32 (float*, float*, float*, ...)*)(float* %5, float* %6, float* %7)
ret void
}

LLVM IR (-O2):
define void @quat_imul(float* %0, float* %1) {
%3 = tail call i32 (float*, float*, float*, ...) bitcast (i32 (...)* @quat_mul to i32 (float*, float*, float*, ...)*)(float* %0, float* %1, float* %0)
ret void
}
/* Variables and functions */
scalar_t__ islower(unsigned char);
unsigned char toupper(unsigned char c) {
  if (islower(c))
    c -= 'a' - 'A';
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
movzbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @toupper(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @islower(i8 zeroext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = sub nsw i32 %8, 32
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
br label %11
11: ; preds = %6, %1
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @toupper(i8 zeroext %0) {
%2 = tail call i64 @islower(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
int wakeup_source_gpio_add_irq(unsigned int irq) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wakeup_source_gpio_add_irq(i32 %0) {
ret i32 0
}
void asn1_get_field_ptr(void) {}


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

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

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

LLVM IR (-O2):
define void @asn1_get_field_ptr() {
ret void
}
/* Variables and functions */
int sort_get_smallest(int *, int, int);
int /*<<< orphan*/ sort_swap(int *, int, int);
void sort_selection(int list[], int lo, int hi) {
  int s, j;
  for (j = lo; j < hi; j++) {
    s = sort_get_smallest(list, j, hi);
    sort_swap(list, j, s);
  }
}


x86 assembly (clang, -O0):
<sort_selection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1173 <sort_selection+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <sort_get_smallest@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <sort_swap@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1138 <sort_selection+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_selection>:
push   %rbp
push   %r14
push   %rbx
cmp    %edx,%esi
jge    1151 <sort_selection+0x31>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <sort_get_smallest@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1030 <sort_swap@plt>
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1130 <sort_selection+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @sort_selection(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 @sort_get_smallest(i32* %0, i32 %6, i32 %2)
%8 = tail call i32 @sort_swap(i32* %0, i32 %6, i32 %7)
%9 = add i32 %6, 1
%10 = icmp eq i32 %9, %2
br i1 %10, label %11, label %5
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ rotate(char *, int);
void main() {
  char str[] = "Linkerist";
  rotate(str, 3);
  puts(str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xa(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xa(%rbp),%rdi
mov    $0x3,%esi
call   1040 <rotate@plt>
lea    -0xa(%rbp),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x736972656b6e694c,%rax
72 69 73
mov    %rax,(%rsp)
movw   $0x74,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <rotate@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [10 x i8] c"Linkerist\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = bitcast [10 x i8]* %1 to i8*
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @rotate(i8* %3, i32 3)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%6 = call i32 @puts(i8* %5)
ret void
}

LLVM IR (-O2):
@__const.main.str = [10 x i8] c"Linkerist\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @rotate(i8* %2, i32 3)
%4 = call i32 @puts(i8* %2)
ret void
}
/* Variables and functions */
double _castu64_f64(unsigned long long);
double test_castu64_f64(unsigned long long __A) { return _castu64_f64(__A); }


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

x86 assembly (clang, -O2):
<test_castu64_f64>:
jmp    1030 <_castu64_f64@plt>

LLVM IR (-O0):
define double @test_castu64_f64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call double @_castu64_f64(i64 %3)
ret double %4
}

LLVM IR (-O2):
define double @test_castu64_f64(i64 %0) {
%2 = tail call double @_castu64_f64(i64 %0)
ret double %2
}
int execute_pciconfig_read() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_pciconfig_read() {
ret i32 0
}
int main(int argc, char *argv[]) {
  char *a = "xx";
  char b;
  int i;
  for (i = 0; i < 1024 * 1024; i++) {
    b = a[i];
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xee7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x100000,-0x20(%rbp)
jge    114d <main+0x4d>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1124 <main+0x24>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int break_here() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @break_here() {
ret i32 0
}
/* Type definitions */
struct flock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
int flock_cp(struct flock *dst, struct flock *src) {
  memcpy((void *)dst, (void *)src, sizeof(struct flock));
}


x86 assembly (clang, -O0):
<flock_cp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flock_cp>:
mov    $0x4,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
%struct.flock = type { i32 }
define i32 @flock_cp(%struct.flock* %0, %struct.flock* %1) {
%3 = alloca i32
%4 = alloca %struct.flock*
%5 = alloca %struct.flock*
store %struct.flock* %0, %struct.flock** %4
store %struct.flock* %1, %struct.flock** %5
%6 = load %struct.flock*, %struct.flock** %4
%7 = bitcast %struct.flock* %6 to i8*
%8 = load %struct.flock*, %struct.flock** %5
%9 = bitcast %struct.flock* %8 to i8*
%10 = call i32 @memcpy(i8* %7, i8* %9, i32 4)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
%struct.flock = type { i32 }
define i32 @flock_cp(%struct.flock* %0, %struct.flock* %1) {
%3 = bitcast %struct.flock* %0 to i8*
%4 = bitcast %struct.flock* %1 to i8*
%5 = tail call i32 @memcpy(i8* %3, i8* %4, i32 4)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, int);
void dcopy_seq(int n, double *x, double *y) {
  memcpy(y, x, sizeof(double) * n);
}


x86 assembly (clang, -O0):
<dcopy_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcopy_seq>:
mov    %rdx,%rax
lea    0x0(,%rdi,8),%edx
mov    %rax,%rdi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @dcopy_seq(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %6
%8 = load double*, double** %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = mul i64 8, %10
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(double* %7, double* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @dcopy_seq(i32 %0, double* %1, double* %2) {
%4 = shl i32 %0, 3
%5 = tail call i32 @memcpy(double* %2, double* %1, i32 %4)
ret void
}
int zip(int env[]) {
  int state = 0;
  for (int z = 0; z != 9; z++) {
    state += env[z];
    state *= 3;
  }
  return state;
}


x86 assembly (clang, -O0):
<zip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
je     1146 <zip+0x46>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x3,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <zip+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zip>:
mov    (%rdi),%eax
lea    (%rax,%rax,2),%eax
add    0x4(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    0x8(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    0xc(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    0x10(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    0x14(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    0x18(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    0x1c(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    0x20(%rdi),%eax
lea    (%rax,%rax,2),%eax
ret

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

LLVM IR (-O2):
define i32 @zip(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 3
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %3
%7 = mul nsw i32 %6, 3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = add nsw i32 %9, %7
%11 = mul nsw i32 %10, 3
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = add nsw i32 %13, %11
%15 = mul nsw i32 %14, 3
%16 = getelementptr inbounds i32, i32* %0, i64 4
%17 = load i32, i32* %16
%18 = add nsw i32 %17, %15
%19 = mul nsw i32 %18, 3
%20 = getelementptr inbounds i32, i32* %0, i64 5
%21 = load i32, i32* %20
%22 = add nsw i32 %21, %19
%23 = mul nsw i32 %22, 3
%24 = getelementptr inbounds i32, i32* %0, i64 6
%25 = load i32, i32* %24
%26 = add nsw i32 %25, %23
%27 = mul nsw i32 %26, 3
%28 = getelementptr inbounds i32, i32* %0, i64 7
%29 = load i32, i32* %28
%30 = add nsw i32 %29, %27
%31 = mul nsw i32 %30, 3
%32 = getelementptr inbounds i32, i32* %0, i64 8
%33 = load i32, i32* %32
%34 = add nsw i32 %33, %31
%35 = mul nsw i32 %34, 3
ret i32 %35
}
/* Variables and functions */
int sqlite3_config(int, int);
int goSqlite3Config(int op, int mode) { return sqlite3_config(op, mode); }


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

x86 assembly (clang, -O2):
<goSqlite3Config>:
jmp    1030 <sqlite3_config@plt>

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

LLVM IR (-O2):
define i32 @goSqlite3Config(i32 %0, i32 %1) {
%3 = tail call i32 @sqlite3_config(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
unsigned long local_read_meminfo(char *);
unsigned long get_hugepage_mbytes() {
  unsigned long pagesize = local_read_meminfo("Hugepagesize: %lu kB");
  return pagesize / 1024;
}


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

x86 assembly (clang, -O2):
<get_hugepage_mbytes>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <local_read_meminfo@plt>
shr    $0xa,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Hugepagesize: %lu kB\00"
define i64 @get_hugepage_mbytes() {
%1 = alloca i64
%2 = call i64 @local_read_meminfo(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = udiv i64 %3, 1024
ret i64 %4
}

LLVM IR (-O2):
@.str = [21 x i8] c"Hugepagesize: %lu kB\00"
define i64 @get_hugepage_mbytes() {
%1 = tail call i64 @local_read_meminfo(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = lshr i64 %1, 10
ret i64 %2
}
/* Type definitions */
struct Memory {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memory_clear(struct Memory *);
void memory_init(struct Memory *mem) { memory_clear(mem); }


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

x86 assembly (clang, -O2):
<memory_init>:
jmp    1030 <memory_clear@plt>

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

LLVM IR (-O2):
%struct.Memory = type { i32 }
define void @memory_init(%struct.Memory* %0) {
%2 = tail call i32 @memory_clear(%struct.Memory* %0)
ret void
}
char a2() { return 'a'; }


x86 assembly (clang, -O0):
<a2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a2>:
mov    $0x61,%al
ret

LLVM IR (-O0):
define signext i8 @a2() {
ret i8 97
}

LLVM IR (-O2):
define signext i8 @a2() {
ret i8 97
}
/* Variables and functions */
int mt_get_mti();
int get_mti() { return mt_get_mti(); }


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

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

LLVM IR (-O0):
define i32 @get_mti() {
%1 = call i32 (...) @mt_get_mti()
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_mti() {
%1 = tail call i32 (...) @mt_get_mti()
ret i32 %1
}
int metropolis() {}


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

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

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

LLVM IR (-O2):
define i32 @metropolis() {
ret i32 undef
}
void console_out(unsigned char c) {
  asm("mov %0, %%al" : : "a"(c));
  asm("mov $0x3f8, %dx");
  asm("out %al, %dx");
}


x86 assembly (clang, -O0):
<console_out>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,%al
mov    $0x3f8,%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_out>:
mov    %edi,%eax
mov    %al,%al
mov    $0x3f8,%dx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @console_out(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret void
}

LLVM IR (-O2):
define void @console_out(i8 zeroext %0) {
tail call void asm sideeffect "mov $0, %al", "{ax},~{dirflag},~{fpsr},~{flags}"(i8 %0)
tail call void asm sideeffect "mov $$0x3f8, %dx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "out %al, %dx", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
bool timer_expired(uint16_t current, uint16_t future) {
  return (uint16_t)(current - future) < 0x8000;
}


x86 assembly (clang, -O0):
<timer_expired>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x8000,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_expired>:
sub    %esi,%edi
xor    %eax,%eax
cmp    $0x8000,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @timer_expired(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
%8 = icmp slt i32 %7, 32768
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @timer_expired(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = icmp slt i32 %3, 32768
%5 = zext i1 %4 to i32
ret i32 %5
}
double gammd_air(double x, double p) { return 17.03; }


x86 assembly (clang, -O0):
<gammd_air>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gammd_air>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @gammd_air(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 1.703000e+01
}

LLVM IR (-O2):
define double @gammd_air(double %0, double %1) {
ret double 1.703000e+01
}
void nmra_to_lenz(unsigned int nmra, unsigned char sub, unsigned int *lenz) {
  if (nmra == 0)
    *lenz = 0;
  else {
    *lenz = (nmra - 1) << 2;
    *lenz += sub + 1;
  }
}


x86 assembly (clang, -O0):
<nmra_to_lenz>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112a <nmra_to_lenz+0x2a>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    1148 <nmra_to_lenz+0x48>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x2,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movzbl -0x5(%rbp),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmra_to_lenz>:
test   %edi,%edi
lea    -0x3(%rsi,%rdi,4),%eax
cmove  %edi,%eax
mov    %eax,(%rdx)
ret

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

LLVM IR (-O2):
define void @nmra_to_lenz(i32 %0, i8 zeroext %1, i32* nocapture writeonly %2) {
%4 = icmp eq i32 %0, 0
%5 = shl i32 %0, 2
%6 = zext i8 %1 to i32
%7 = add i32 %5, -3
%8 = add i32 %7, %6
%9 = select i1 %4, i32 0, i32 %8
store i32 %9, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  }
  fprintf(stream, "Usage: %s [-n NUM] <file>\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [27 x i8] c"Usage: %s [-n NUM] <file>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [27 x i8] c"Usage: %s [-n NUM] <file>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ errExit(char *);
void checkForOpenErrors(int fd) {
  if (fd == -1)
    errExit("Open");
}


x86 assembly (clang, -O0):
<checkForOpenErrors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1131 <checkForOpenErrors+0x21>
lea    0xed4(%rip),%rdi
call   1030 <errExit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkForOpenErrors>:
cmp    $0xffffffff,%edi
je     1116 <checkForOpenErrors+0x6>
ret
lea    0xee3(%rip),%rdi
jmp    1030 <errExit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"Open\00"
define void @checkForOpenErrors(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @errExit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"Open\00"
define void @checkForOpenErrors(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @errExit(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TestGetLocalNets();
int main(int argc, char *argv[]) {
  TestGetLocalNets();
  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   1030 <TestGetLocalNets@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <TestGetLocalNets@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 (...) @TestGetLocalNets()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @TestGetLocalNets()
ret i32 0
}
int ctoi(char ch) { return ch - '0'; }


x86 assembly (clang, -O0):
<ctoi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ctoi(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @ctoi(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ msgqueue_sendstring(char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void DrawTo(int x, int y) {
  static char buffer[56];
  sprintf(buffer, "2 %d %d", x, y);
  msgqueue_sendstring(buffer);
  return;
}


x86 assembly (clang, -O0):
<DrawTo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0x2f05(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ef2(%rip),%rdi
call   1030 <msgqueue_sendstring@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawTo>:
push   %rbx
mov    %esi,%ecx
mov    %edi,%edx
lea    0x2f14(%rip),%rbx
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <msgqueue_sendstring@plt>

LLVM IR (-O0):
@DrawTo.buffer = internal global [56 x i8] zeroinitializer
@.str = [8 x i8] c"2 %d %d\00"
define void @DrawTo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @sprintf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @DrawTo.buffer, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 @msgqueue_sendstring(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @DrawTo.buffer, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@DrawTo.buffer = internal global [56 x i8] zeroinitializer
@.str = [8 x i8] c"2 %d %d\00"
define void @DrawTo(i32 %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @DrawTo.buffer, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 @msgqueue_sendstring(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @DrawTo.buffer, i64 0, i64 0))
ret void
}
float fz_abs(float f) { return (f < 0 ? -f : f); }


x86 assembly (clang, -O0):
<fz_abs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <fz_abs+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <fz_abs+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_abs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fz_abs(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
br label %10
8: ; preds = %1
%9 = load float, float* %2
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
ret float %11
}

LLVM IR (-O2):
define float @fz_abs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
void preempt_dec(void) { asm volatile("lock decl %%gs:0x18" : :); }


x86 assembly (clang, -O0):
<preempt_dec>:
push   %rbp
mov    %rsp,%rbp
lock decl %gs:0x18
pop    %rbp
ret

x86 assembly (clang, -O2):
<preempt_dec>:
lock decl %gs:0x18
ret

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

LLVM IR (-O2):
define void @preempt_dec() {
tail call void asm sideeffect "lock decl %gs:0x18", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned long net_dnsresolve(const char *name) { return 0; }


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

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

LLVM IR (-O0):
define i64 @net_dnsresolve(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i64 0
}

LLVM IR (-O2):
define i64 @net_dnsresolve(i8* nocapture readnone %0) {
ret i64 0
}