xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dump(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ radix_sort(int *, int, int);
void radix_sort_test() {
  int a[10] = {123, 12341, 1232134, 124, 236, 128, 1112313129, 98, 9, 8989};
  printf("\r\n radix sort test.....");
  radix_sort(a, 10, 10);
  dump(a, 10);
  return;
}


x86 assembly (clang, -O0):
<radix_sort_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%edx
mov    %edx,%esi
call   1040 <radix_sort@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <dump@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix_sort_test>:
push   %rbx
sub    $0x30,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0xa,%edx
call   1040 <radix_sort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <dump@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.radix_sort_test.a = [10 x i32] [i32 123, i32 12341, i32 1232134, i32 124, i32 236, i32 128, i32 1112313129, i32 98, i32 9, i32 8989]
@.str = [24 x i8] c"\0D\0A radix sort test.....\00"
define void @radix_sort_test() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @radix_sort(i32* %4, i32 10, i32 10)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = call i32 @dump(i32* %6, i32 10)
ret void
}

LLVM IR (-O2):
@__const.radix_sort_test.a = [10 x i32] [i32 123, i32 12341, i32 1232134, i32 124, i32 236, i32 128, i32 1112313129, i32 98, i32 9, i32 8989]
@.str = [24 x i8] c"\0D\0A radix sort test.....\00"
define void @radix_sort_test() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%5 = call i32 @radix_sort(i32* %4, i32 10, i32 10)
%6 = call i32 @dump(i32* %4, i32 10)
ret void
}
_Bool ARM_InterruptsEnabled(void) { return !(ARM_ReadCPSR() & (1 << (7))); }


x86 assembly (clang, -O0):
<ARM_InterruptsEnabled>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ARM_ReadCPSR@plt>
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ARM_InterruptsEnabled>:
push   %rax
xor    %eax,%eax
call   1030 <ARM_ReadCPSR@plt>
test   $0x80,%al
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i1 @ARM_InterruptsEnabled() {
%1 = call i32 (...) @ARM_ReadCPSR()
%2 = and i32 %1, 128
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
ret i1 %4
}

LLVM IR (-O2):
define zeroext i1 @ARM_InterruptsEnabled() {
%1 = tail call i32 (...) @ARM_ReadCPSR()
%2 = and i32 %1, 128
%3 = icmp eq i32 %2, 0
ret i1 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
void sigHandler(int sig) {
  FILE *lIn;
  if ((lIn = popen("pactl unload-module module-sine", "r"))) {
    pclose(lIn);
  }
}


x86 assembly (clang, -O0):
<sigHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1040 <popen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1155 <sigHandler+0x35>
mov    -0x10(%rbp),%rdi
call   1030 <pclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigHandler>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef1(%rip),%rsi
call   1040 <popen@plt>
test   %rax,%rax
je     1142 <sigHandler+0x22>
mov    %rax,%rdi
pop    %rax
jmp    1030 <pclose@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"pactl unload-module module-sine\00"
@.str.1 = [2 x i8] c"r\00"
define void @sigHandler(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32* @popen(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32*, i32** %3
%8 = call i32 @pclose(i32* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"pactl unload-module module-sine\00"
@.str.1 = [2 x i8] c"r\00"
define void @sigHandler(i32 %0) {
%2 = tail call i32* @popen(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @pclose(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ stbi__addsizes_valid(int, int);
scalar_t__ stbi__mul2sizes_valid(int, int);
int stbi__mad2sizes_valid(int a, int b, int add) {
  return stbi__mul2sizes_valid(a, b) && stbi__addsizes_valid(a * b, add);
}


x86 assembly (clang, -O0):
<stbi__mad2sizes_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <stbi__mul2sizes_valid@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xd(%rbp)
je     1167 <stbi__mad2sizes_valid+0x47>
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <stbi__addsizes_valid@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi__mad2sizes_valid>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <stbi__mul2sizes_valid@plt>
test   %rax,%rax
je     114f <stbi__mad2sizes_valid+0x2f>
imul   %ebx,%ebp
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <stbi__addsizes_valid@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1151 <stbi__mad2sizes_valid+0x31>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @stbi__mad2sizes_valid(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i64 @stbi__mul2sizes_valid(i32 %7, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %6
%16 = call i64 @stbi__addsizes_valid(i32 %14, i32 %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %11, %3
%19 = phi i1 [ false, %3 ], [ %17, %11 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @stbi__mad2sizes_valid(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @stbi__mul2sizes_valid(i32 %0, i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = mul nsw i32 %1, %0
%8 = tail call i64 @stbi__addsizes_valid(i32 %7, i32 %2)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %3
%12 = phi i32 [ 0, %3 ], [ %10, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ pause();
void Pause(void) {
  (void)pause();
  return;
}


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

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

LLVM IR (-O0):
define void @Pause() {
%1 = call i32 (...) @pause()
ret void
}

LLVM IR (-O2):
define void @Pause() {
%1 = tail call i32 (...) @pause()
ret void
}
extern unsigned long be32dec(const void *buf) {
  const unsigned char *p = (const unsigned char *)buf;
  return ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
}


x86 assembly (clang, -O0):
<be32dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<be32dec>:
movzbl (%rdi),%eax
shl    $0x18,%eax
movzbl 0x1(%rdi),%ecx
shl    $0x10,%rcx
cltq
or     %rcx,%rax
movzbl 0x2(%rdi),%ecx
shl    $0x8,%rcx
or     %rax,%rcx
movzbl 0x3(%rdi),%eax
or     %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @be32dec(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
%19 = sext i32 %18 to i64
ret i64 %19
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glutSwapBuffers();
void DrawGLScene() {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glLoadIdentity();
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<DrawGLScene>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
mov    $0x0,%al
call   1040 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawGLScene>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutSwapBuffers@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @DrawGLScene() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 (...) @glLoadIdentity()
%6 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @DrawGLScene() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 (...) @glLoadIdentity()
%6 = tail call i32 (...) @glutSwapBuffers()
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int set_state_to_silent(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(39, a, b, c);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @set_state_to_silent() {
%1 = tail call i32 @_ada_use_c2phc(i32 39, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ CloseAllVaultsDialog();
void MenuCloseAllVaults(const char *key) { CloseAllVaultsDialog(); }


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

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

LLVM IR (-O0):
define void @MenuCloseAllVaults(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @CloseAllVaultsDialog()
ret void
}

LLVM IR (-O2):
define void @MenuCloseAllVaults(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @CloseAllVaultsDialog()
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
main1() {
  int c, nl;
  nl = 0;
  while ((c = getchar()) != EOF)
    if (c == '\n') {
      ++nl;
    }
  printf("%d\n", nl);
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1160 <main1+0x40>
cmpl   $0xa,-0x8(%rbp)
jne    115b <main1+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <main1+0xf>
mov    -0xc(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main1>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb4(%rip),%r14
cmp    (%r14),%eax
je     1156 <main1+0x36>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main1+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main1() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ FLEXIO2_DriverIRQHandler();
__attribute__((weak)) void FLEXIO2_IRQHandler(void) {
  FLEXIO2_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @FLEXIO2_IRQHandler() {
%1 = tail call i32 (...) @FLEXIO2_DriverIRQHandler()
ret void
}
char *langRomTypeHbiV1Digitiz() { return "Sony HBI-V1 Digitizer"; }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Sony HBI-V1 Digitizer\00"
define i8* @langRomTypeHbiV1Digitiz() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [22 x i8] c"Sony HBI-V1 Digitizer\00"
define i8* @langRomTypeHbiV1Digitiz() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ final_sys_mock();
int /*<<< orphan*/ init_sys_mock();
void clear_sys_mock(void) {
  final_sys_mock();
  init_sys_mock();
}


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

x86 assembly (clang, -O2):
<clear_sys_mock>:
push   %rax
xor    %eax,%eax
call   1040 <final_sys_mock@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <init_sys_mock@plt>

LLVM IR (-O0):
define void @clear_sys_mock() {
%1 = call i32 (...) @final_sys_mock()
%2 = call i32 (...) @init_sys_mock()
ret void
}

LLVM IR (-O2):
define void @clear_sys_mock() {
%1 = tail call i32 (...) @final_sys_mock()
%2 = tail call i32 (...) @init_sys_mock()
ret void
}
/* Variables and functions */
double do_pow(double, int);
double myPow(double x, int n) {
  int t;
  double res;
  t = n;
  if (t < 0)
    t = -t;
  res = do_pow(x, t);
  if (n < 0)
    return (1.0 / res);
  return (res);
}


x86 assembly (clang, -O0):
<myPow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1138 <myPow+0x28>
xor    %eax,%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%edi
call   1030 <do_pow@plt>
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    116b <myPow+0x5b>
movsd  0xea4(%rip),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1175 <myPow+0x65>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myPow>:
push   %rbx
mov    %edi,%ebx
neg    %edi
cmovs  %ebx,%edi
call   1030 <do_pow@plt>
test   %ebx,%ebx
jns    1131 <myPow+0x21>
movsd  0xed7(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rbx
ret

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

LLVM IR (-O2):
define double @myPow(double %0, i32 %1) {
%3 = icmp slt i32 %1, 0
%4 = sub nsw i32 0, %1
%5 = select i1 %3, i32 %4, i32 %1
%6 = tail call double @do_pow(double %0, i32 %5)
%7 = fdiv double 1.000000e+00, %6
%8 = select i1 %3, double %7, double %6
ret double %8
}
int C_getid() {
  static int id = 0;
  return ++id;
}


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

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

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

LLVM IR (-O2):
@C_getid.id = internal unnamed_addr global i32 0
define i32 @C_getid() {
%1 = load i32, i32* @C_getid.id
%2 = add nsw i32 %1, 1
store i32 %2, i32* @C_getid.id
ret i32 %2
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_pecho_wchar(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_pecho_wchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_pecho_wchar+0x2a>
jmp    1170 <cmd_pecho_wchar+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_pecho_wchar>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_pecho_wchar+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_pecho_wchar(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 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_pecho_wchar(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
void stringConstant() {}


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

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

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

LLVM IR (-O2):
define void @stringConstant() {
ret void
}
int test_imm_53uint8_reg(unsigned char val) {
  return ((val) & (-0x53 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_53uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffad,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_53uint8_reg>:
test   $0xad,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_53uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -83
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_53uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -83
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void tgi_done(void) {}


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

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

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

LLVM IR (-O2):
define void @tgi_done() {
ret void
}
/* Variables and functions */
unsigned long ipow(int, int);
void writebit(unsigned long bitholder, unsigned char *byte, int bitposition) {
  if (bitholder & ipow(2, bitposition))
    *byte |= 1;
  else
    *byte &= 0xFE;
}


x86 assembly (clang, -O0):
<writebit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x2,%edi
call   1030 <ipow@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
and    %rcx,%rax
cmp    $0x0,%rax
je     115d <writebit+0x4d>
mov    -0x10(%rbp),%rax
movzbl (%rax),%ecx
or     $0x1,%ecx
mov    %cl,(%rax)
jmp    116c <writebit+0x5c>
mov    -0x10(%rbp),%rax
movzbl (%rax),%ecx
and    $0xfe,%ecx
mov    %cl,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writebit>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x2,%edi
mov    %edx,%esi
call   1030 <ipow@plt>
test   %r14,%rax
setne  %al
mov    (%rbx),%cl
and    $0xfe,%cl
or     %al,%cl
mov    %cl,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @writebit(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i32, i32* %6
%9 = call i64 @ipow(i32 2, i32 %8)
%10 = and i64 %7, %9
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = or i32 %15, 1
%17 = trunc i32 %16 to i8
store i8 %17, i8* %13
br label %24
18: ; preds = %3
%19 = load i8*, i8** %5
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = and i32 %21, 254
%23 = trunc i32 %22 to i8
store i8 %23, i8* %19
br label %24
24: ; preds = %18, %12
ret void
}

LLVM IR (-O2):
define void @writebit(i64 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @ipow(i32 2, i32 %2)
%5 = and i64 %4, %0
%6 = icmp ne i64 %5, 0
%7 = load i8, i8* %1
%8 = and i8 %7, -2
%9 = zext i1 %6 to i8
%10 = or i8 %8, %9
store i8 %10, i8* %1
ret void
}
/* Variables and functions */
size_t entry_room(size_t namelen, size_t valuelen) {
  return 32 + namelen + valuelen;
}


x86 assembly (clang, -O0):
<entry_room>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<entry_room>:
lea    (%rdi,%rsi,1),%rax
add    $0x20,%rax
ret

LLVM IR (-O0):
define i64 @entry_room(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 32, %5
%7 = load i64, i64* %4
%8 = add i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @entry_room(i64 %0, i64 %1) {
%3 = add i64 %0, 32
%4 = add i64 %3, %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello!\n");
  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 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"Hello!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"Hello!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
struct Cyc_Absyn_Exp *Cyc_Absyn_prim1_exp(unsigned int, struct Cyc_Absyn_Exp *,
                                          unsigned int);
struct Cyc_Absyn_Exp *Cyc_Absyn_tagof_exp(struct Cyc_Absyn_Exp *e,
                                          unsigned loc) {
  struct Cyc_Absyn_Exp *_T0;
  _T0 = Cyc_Absyn_prim1_exp(19U, e, loc);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_Absyn_tagof_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x13,%edi
call   1030 <Cyc_Absyn_prim1_exp@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Absyn_tagof_exp>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x13,%edi
jmp    1030 <Cyc_Absyn_prim1_exp@plt>

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_tagof_exp(%struct.Cyc_Absyn_Exp* %0, i32 %1) {
%3 = alloca %struct.Cyc_Absyn_Exp*
%4 = alloca i32
%5 = alloca %struct.Cyc_Absyn_Exp*
store %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp** %3
store i32 %1, i32* %4
%6 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %3
%7 = load i32, i32* %4
%8 = call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_prim1_exp(i32 19, %struct.Cyc_Absyn_Exp* %6, i32 %7)
store %struct.Cyc_Absyn_Exp* %8, %struct.Cyc_Absyn_Exp** %5
%9 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %5
ret %struct.Cyc_Absyn_Exp* %9
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_tagof_exp(%struct.Cyc_Absyn_Exp* %0, i32 %1) {
%3 = tail call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_prim1_exp(i32 19, %struct.Cyc_Absyn_Exp* %0, i32 %1)
ret %struct.Cyc_Absyn_Exp* %3
}
/* Variables and functions */
int f(int);
int test(int a, int b) {
  int res;
  if (a == 2) {
    int r = f(b);
    res = r + b;
    a += 2;
  } else {
    int r = f(a);
    res = r + a;
    b += 1;
  }
  return res;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    114a <test+0x3a>
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <test+0x57>
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %esi,%ebx
cmp    $0x2,%edi
cmovne %edi,%ebx
mov    %ebx,%edi
call   1030 <f@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 2
%4 = select i1 %3, i32 %1, i32 %0
%5 = tail call i32 @f(i32 %4)
%6 = add nsw i32 %5, %4
ret i32 %6
}
float mx_add(float a, float b) { return a + b; }


x86 assembly (clang, -O0):
<mx_add>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mx_add>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @mx_add(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 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @mx_add(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void count_down_from_n(int n) {
  for (int i = n; i > 0; i--) {
    printf(">> %d\n", i);
  }
}


x86 assembly (clang, -O0):
<count_down_from_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1148 <count_down_from_n+0x38>
mov    -0x8(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <count_down_from_n+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_down_from_n>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1144 <count_down_from_n+0x34>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <count_down_from_n+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c">> %d\0A\00"
define void @count_down_from_n(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %3
}
int i915_debugfs_register(struct drm_i915_private *dev_priv) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.drm_i915_private = type opaque
define i32 @i915_debugfs_register(%struct.drm_i915_private* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *dlopen(const char *pathname, int mode) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @dlopen(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
double ppl_DensityAlt(double PAlt, double Temp) {
  double ISA = 15 - (1.98 * (PAlt / 1000));
  return PAlt + (120 * (Temp - ISA));
}


x86 assembly (clang, -O0):
<ppl_DensityAlt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xee1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xedd(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xead(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppl_DensityAlt>:
movapd %xmm0,%xmm2
divsd  0xef4(%rip),%xmm2
mulsd  0xef4(%rip),%xmm2
addsd  0xef4(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  0xef0(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ppl_DensityAlt(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fdiv double %6, 1.000000e+03
%8 = call double @llvm.fmuladd.f64(double -1.980000e+00, double %7, double 1.500000e+01)
store double %8, double* %5
%9 = load double, double* %3
%10 = load double, double* %4
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = call double @llvm.fmuladd.f64(double 1.200000e+02, double %12, double %9)
ret double %13
}

LLVM IR (-O2):
define double @ppl_DensityAlt(double %0, double %1) {
%3 = fdiv double %0, 1.000000e+03
%4 = tail call double @llvm.fmuladd.f64(double %3, double -1.980000e+00, double 1.500000e+01)
%5 = fsub double %1, %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double 1.200000e+02, double %0)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *inc_x(void *x_void_ptr) {
  int *x_ptr = (int *)x_void_ptr;
  while (++(*x_ptr) < 100)
    ;
  printf("x increment finished\n");
  return NULL;
}


x86 assembly (clang, -O0):
<inc_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
cmp    $0x64,%eax
jge    113d <inc_x+0x2d>
jmp    1124 <inc_x+0x14>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_x>:
push   %rax
mov    (%rdi),%eax
cmp    $0x64,%eax
mov    $0x63,%ecx
cmovge %eax,%ecx
add    $0x1,%ecx
mov    %ecx,(%rdi)
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"x increment finished\0A\00"
define i8* @inc_x(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
br label %6
6: ; preds = %11, %1
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
store i32 %9, i32* %7
%10 = icmp slt i32 %9, 100
br i1 %10, label %11, label %12
11: ; preds = %6
br label %6
12: ; preds = %6
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [21 x i8] c"x increment finished\00"
define noalias i8* @inc_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = call i32 @llvm.smax.i32(i32 %3, i32 99)
%5 = add nuw i32 %4, 1
store i32 %5, i32* %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i8* null
}
int test_imm_BBint8_mem(signed char *val) {
  return ((*val) & (-0xBB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BBint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff45,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BBint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff45,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BBint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -187
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_BBint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -187
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int arr[], int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%-4d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%-4d \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int progExists(char *path, char *name) {
  char relPath[255];
  sprintf(relPath, "../%s%s", path, name);
  return 0 == access(relPath, F_OK);
}


x86 assembly (clang, -O0):
<progExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progExists>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"../%s%s\00"
@F_OK = global i32 0
define i32 @progExists(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [255 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = load i32, i32* @F_OK
%12 = call i64 @access(i8* %10, i32 %11)
%13 = icmp eq i64 0, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@.str = [8 x i8] c"../%s%s\00"
@F_OK = global i32 0
define i32 @progExists(i8* %0, i8* %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = load i32, i32* @F_OK
%7 = call i64 @access(i8* %4, i32 %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
void fn() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_ffs(FILE *f, int nbytes) {
  int i;
  for (i = 0; i < nbytes; ++i)
    fprintf(f, "ff");
}


x86 assembly (clang, -O0):
<print_ffs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <print_ffs+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_ffs+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ffs>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <print_ffs+0x3a>
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xedb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r14,%rcx
call   1030 <fwrite@plt>
add    $0xffffffff,%ebx
jne    1130 <print_ffs+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"ff\00"
define void @print_ffs(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}