xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fread(int *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void test_fread() {
  int n = 0;
  fread(&n, sizeof(int), 1, stdin);
  assert(n == 0);
}


x86 assembly (clang, -O0):
<test_fread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%ecx
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fread>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%ecx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
xor    %edi,%edi
cmpl   $0x0,0x4(%rsp)
sete   %dil
call   1040 <assert@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@stdin = global i32 0
define void @test_fread() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = load i32, i32* @stdin
%4 = call i32 @fread(i32* %1, i32 4, i32 1, i32 %3)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_set1_pi32(int);
__m64 test_mm_set1_pi32(int a) { return _mm_set1_pi32(a); }


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

x86 assembly (clang, -O2):
<test_mm_set1_pi32>:
jmp    1030 <_mm_set1_pi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_set1_pi32(i32 %0) {
%2 = tail call i32 @_mm_set1_pi32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rightrotate(char *, int);
int main() {
  char a[] = "Hello world";
  int m = 3;
  rightrotate(a, 3);
  printf("%s\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1040 <rightrotate@plt>
lea    -0x10(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6f77206f6c6c6548,%rax
20 77 6f
mov    %rax,(%rsp)
movl   $0x646c72,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <rightrotate@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [12 x i8] c"Hello world\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [12 x i8]* %2 to i8*
store i32 3, i32* %3
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%6 = call i32 @rightrotate(i8* %5, i32 3)
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [12 x i8] c"Hello world\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @rightrotate(i8* %2, i32 3)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Init();
void _M2_FIO_init(__attribute__((unused)) int argc,
                  __attribute__((unused)) char *argv[]) {
  Init();
}


x86 assembly (clang, -O0):
<_M2_FIO_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Init@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_M2_FIO_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @Init()
ret void
}

LLVM IR (-O2):
define void @_M2_FIO_init(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Init()
ret void
}
unsigned int f74(unsigned int x, long int y) {
  return (x << y) + (x >> (8 * sizeof(unsigned int) - y));
}


x86 assembly (clang, -O0):
<f74>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f74>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f74(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i64, i64* %4
%11 = sub i64 32, %10
%12 = trunc i64 %11 to i32
%13 = lshr i32 %9, %12
%14 = add i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f74(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %0, %3
%5 = sub i32 32, %3
%6 = lshr i32 %0, %5
%7 = add i32 %6, %4
ret i32 %7
}
/* Variables and functions */
void printchar(char **str, int c) {
  extern void putc(char c);
  if (str) {
    **str = c;
    ++(*str);
  } else
    (void)putc(c);
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <printchar+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1156 <printchar+0x46>
mov    -0xc(%rbp),%eax
movsbl %al,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     1120 <printchar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
movsbl %sil,%edi
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @printchar(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 = icmp ne i8** %5, null
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
store i8 %9, i8* %11
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %12
br label %18
15: ; preds = %2
%16 = load i32, i32* %4
%17 = trunc i32 %16 to i8
br label %18
18: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
%4 = trunc i32 %1 to i8
br i1 %3, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %0
store i8 %4, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %10
9: ; preds = %2
tail call void @putc(i8 signext %4)
br label %10
10: ; preds = %9, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_cont(char *);
void print_cpu_stall_info_end(void) { pr_cont("} "); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"} \00"
define void @print_cpu_stall_info_end() {
%1 = tail call i32 @pr_cont(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int setsockopt(int, int, int, void const *, int /*<<< orphan*/);
__attribute__((weak)) int __real_setsockopt(int fd, int level, int optname,
                                            const void *optval,
                                            socklen_t optlen) {
  return setsockopt(fd, level, optname, optval, optlen);
}


x86 assembly (clang, -O0):
<__real_setsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <setsockopt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__real_setsockopt>:
jmp    1030 <setsockopt@plt>

LLVM IR (-O0):
define weak i32 @__real_setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = call i32 @setsockopt(i32 %11, i32 %12, i32 %13, i8* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define weak i32 @__real_setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4)
ret i32 %6
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int getopt_internal(int, char *const *, char const *, struct option const *,
                    int *, int);
int getopt_long(int nargc, char *const *nargv, const char *options,
                const struct option *long_options, int *idx) {
  return (getopt_internal(nargc, nargv, options, long_options, idx, 0x01));
}


x86 assembly (clang, -O0):
<getopt_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x1,%r9d
call   1030 <getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long>:
mov    $0x1,%r9d
jmp    1030 <getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @getopt_internal(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 1)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ send_duration(char *);
void inqTextDur() { send_duration("Text.dur"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"Text.dur\00"
define void @inqTextDur() {
%1 = call i32 @send_duration(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Text.dur\00"
define void @inqTextDur() {
%1 = tail call i32 @send_duration(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
void print(char *s) {
  printf("Testing %s ... ", s);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Testing %s ... \00"
@stdout = global i32 0
define void @print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Testing %s ... \00"
@stdout = global i32 0
define void @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
char *getenv(char *);
const char *XcursorLibraryPath(void) {
  static const char *path;
  if (!path) {
    path = getenv("XCURSOR_PATH");
    if (!path)
      path = "~/.local/share/icons:~/.icons:/usr/share/icons:/usr/share/"
             "pixmaps:~/.cursors:/usr/share/cursors/xorg-x11:"
             "/usr/X11R6/lib/X11/icons";
  }
  return path;
}


x86 assembly (clang, -O0):
<XcursorLibraryPath>:
push   %rbp
mov    %rsp,%rbp
cmpq   $0x0,0x2f14(%rip)
jne    1156 <XcursorLibraryPath+0x46>
lea    0xed7(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,0x2efb(%rip)
cmpq   $0x0,0x2ef3(%rip)
jne    1151 <XcursorLibraryPath+0x41>
lea    0xec3(%rip),%rax
mov    %rax,0x2edf(%rip)
jmp    1156 <XcursorLibraryPath+0x46>
mov    0x2ed3(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<XcursorLibraryPath>:
push   %rax
mov    0x2f18(%rip),%rax
test   %rax,%rax
je     111f <XcursorLibraryPath+0xf>
pop    %rcx
ret
lea    0xeda(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rcx
test   %rax,%rax
lea    0xed5(%rip),%rax
cmovne %rcx,%rax
mov    %rax,0x2eed(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@XcursorLibraryPath.path = internal global i8* null
@.str = [13 x i8] c"XCURSOR_PATH\00"
@.str.1 = [130 x i8] c"~/.local/share/icons:~/.icons:/usr/share/icons:/usr/share/pixmaps:~/.cursors:/usr/share/cursors/xorg-x11:/usr/X11R6/lib/X11/icons\00"
define i8* @XcursorLibraryPath() {
%1 = load i8*, i8** @XcursorLibraryPath.path
%2 = icmp ne i8* %1, null
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** @XcursorLibraryPath.path
%5 = load i8*, i8** @XcursorLibraryPath.path
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %3
store i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str.1, i64 0, i64 0), i8** @XcursorLibraryPath.path
br label %8
8: ; preds = %7, %3
br label %9
9: ; preds = %8, %0
%10 = load i8*, i8** @XcursorLibraryPath.path
ret i8* %10
}

LLVM IR (-O2):
@XcursorLibraryPath.path = internal unnamed_addr global i8* null
@.str = [13 x i8] c"XCURSOR_PATH\00"
@.str.1 = [130 x i8] c"~/.local/share/icons:~/.icons:/usr/share/icons:/usr/share/pixmaps:~/.cursors:/usr/share/cursors/xorg-x11:/usr/X11R6/lib/X11/icons\00"
define i8* @XcursorLibraryPath() {
%1 = load i8*, i8** @XcursorLibraryPath.path
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
%6 = select i1 %5, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str.1, i64 0, i64 0), i8* %4
store i8* %6, i8** @XcursorLibraryPath.path
br label %7
7: ; preds = %3, %0
%8 = phi i8* [ %6, %3 ], [ %1, %0 ]
ret i8* %8
}
/* Type definitions */
typedef unsigned int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t pcg_output_xsh_rs_32_16(uint32_t state) {
  return (uint16_t)(((state >> 11u) ^ state) >> ((state >> 30u) + 11u));
}


x86 assembly (clang, -O0):
<pcg_output_xsh_rs_32_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xb,%eax
xor    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1e,%ecx
add    $0xb,%ecx
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcg_output_xsh_rs_32_16>:
mov    %edi,%eax
shr    $0xb,%eax
xor    %edi,%eax
shr    $0x1e,%edi
lea    0xb(%rdi),%ecx
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @pcg_output_xsh_rs_32_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 11
%5 = load i32, i32* %2
%6 = xor i32 %4, %5
%7 = load i32, i32* %2
%8 = lshr i32 %7, 30
%9 = add i32 %8, 11
%10 = lshr i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @pcg_output_xsh_rs_32_16(i32 %0) {
%2 = lshr i32 %0, 11
%3 = xor i32 %2, %0
%4 = lshr i32 %0, 30
%5 = add nuw nsw i32 %4, 11
%6 = lshr i32 %3, %5
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ c;

/* Variables and functions */
double pow(double, double);
double(libclut_model_standard_to_linear1)(double c) {
  return (((double)(c) <= 0.04045) ? ((double)(c) / 12.92)
                                   : pow(((double)(c) + 0.055) / 1.055, 2.4));
}


x86 assembly (clang, -O0):
<libclut_model_standard_to_linear1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     114b <libclut_model_standard_to_linear1+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1176 <libclut_model_standard_to_linear1+0x66>
movsd  0xec5(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe9c(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libclut_model_standard_to_linear1>:
movsd  0xee8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    113b <libclut_model_standard_to_linear1+0x2b>
addsd  0xeea(%rip),%xmm0
divsd  0xeea(%rip),%xmm0
movsd  0xeea(%rip),%xmm1
jmp    1030 <pow@plt>
divsd  0xec5(%rip),%xmm0
ret

LLVM IR (-O0):
define double @libclut_model_standard_to_linear1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double %3, 4.045000e-02
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fdiv double %6, 1.292000e+01
br label %13
8: ; preds = %1
%9 = load double, double* %2
%10 = fadd double %9, 5.500000e-02
%11 = fdiv double %10, 1.055000e+00
%12 = call double @pow(double %11, double 2.400000e+00)
br label %13
13: ; preds = %8, %5
%14 = phi double [ %7, %5 ], [ %12, %8 ]
ret double %14
}

LLVM IR (-O2):
define double @libclut_model_standard_to_linear1(double %0) {
%2 = fcmp ugt double %0, 4.045000e-02
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = fdiv double %0, 1.292000e+01
br label %9
5: ; preds = %1
%6 = fadd double %0, 5.500000e-02
%7 = fdiv double %6, 1.055000e+00
%8 = tail call double @pow(double %7, double 2.400000e+00)
br label %9
9: ; preds = %5, %3
%10 = phi double [ %4, %3 ], [ %8, %5 ]
ret double %10
}
/* Type definitions */
struct list_d {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct list_d *);
int /*<<< orphan*/ list_d_clear(struct list_d *);
void list_d_free(struct list_d *target) {
  list_d_clear(target);
  free(target);
}


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

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

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

LLVM IR (-O2):
%struct.list_d = type { i32 }
define void @list_d_free(%struct.list_d* %0) {
%2 = tail call i32 @list_d_clear(%struct.list_d* %0)
%3 = tail call i32 @free(%struct.list_d* %0)
ret void
}
char *guess_content_type(struct FileInfo *info) { return "text/html"; }


x86 assembly (clang, -O0):
<guess_content_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.FileInfo = type opaque
@.str = [10 x i8] c"text/html\00"
define i8* @guess_content_type(%struct.FileInfo* %0) {
%2 = alloca %struct.FileInfo*
store %struct.FileInfo* %0, %struct.FileInfo** %2
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.FileInfo = type opaque
@.str = [10 x i8] c"text/html\00"
define i8* @guess_content_type(%struct.FileInfo* nocapture readnone %0) {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
void UARTFIFOLevelSet(unsigned long ulBase, unsigned long ulTxLevel,
                      unsigned long ulRxLevel) {
  ;

  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000034))) = ulTxLevel | ulRxLevel;
}


x86 assembly (clang, -O0):
<UARTFIFOLevelSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
or     -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x34(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFOLevelSet>:
or     %rdx,%rsi
mov    %rsi,0x34(%rdi)
ret

LLVM IR (-O0):
define void @UARTFIFOLevelSet(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = load i64, i64* %6
%9 = or i64 %7, %8
%10 = load i64, i64* %4
%11 = add i64 %10, 52
%12 = inttoptr i64 %11 to i64*
store volatile i64 %9, i64* %12
ret void
}

LLVM IR (-O2):
define void @UARTFIFOLevelSet(i64 %0, i64 %1, i64 %2) {
%4 = or i64 %2, %1
%5 = add i64 %0, 52
%6 = inttoptr i64 %5 to i64*
store volatile i64 %4, i64* %6
ret void
}
void foo(void) {
  volatile int a = 5;
  (void)a;
}


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

x86 assembly (clang, -O2):
<foo>:
movl   $0x5,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
store volatile i32 5, i32* %1
%2 = load volatile i32, i32* %1
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 5, i32* %1
%3 = load volatile i32, i32* %1
ret void
}
/* Type definitions */
struct hsearch_data {
  int dummy;
};

/* Variables and functions */
char *search_store(struct hsearch_data *, char *);
char *check_data_dir(struct hsearch_data *store) {
  char *datadir = search_store(store, "Datadir");
  if (!datadir) {
    datadir = "/var/lib/ainod";
  }
  return datadir;
}


x86 assembly (clang, -O0):
<check_data_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <search_store@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <check_data_dir+0x36>
lea    0xec6(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_data_dir>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <search_store@plt>
test   %rax,%rax
lea    0xee1(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.hsearch_data = type { i32 }
@.str = [8 x i8] c"Datadir\00"
@.str.1 = [15 x i8] c"/var/lib/ainod\00"
define i8* @check_data_dir(%struct.hsearch_data* %0) {
%2 = alloca %struct.hsearch_data*
%3 = alloca i8*
store %struct.hsearch_data* %0, %struct.hsearch_data** %2
%4 = load %struct.hsearch_data*, %struct.hsearch_data** %2
%5 = call i8* @search_store(%struct.hsearch_data* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %9
9: ; preds = %8, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
%struct.hsearch_data = type { i32 }
@.str = [8 x i8] c"Datadir\00"
@.str.1 = [15 x i8] c"/var/lib/ainod\00"
define i8* @check_data_dir(%struct.hsearch_data* %0) {
%2 = tail call i8* @search_store(%struct.hsearch_data* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %2
ret i8* %4
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
uint32_t bitScan_fun_int32_t(int32_t x) {
  uint32_t r = 0;
  int32_t s = (x & 0x80000000);
  if (x == 0)
    return 31;
  while ((int32_t)((x <<= 1) & 0x80000000) == s)
    ++r;
  return r;
}


x86 assembly (clang, -O0):
<bitScan_fun_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80000000,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112f <bitScan_fun_int32_t+0x2f>
movl   $0x1f,-0x4(%rbp)
jmp    115f <bitScan_fun_int32_t+0x5f>
jmp    1134 <bitScan_fun_int32_t+0x34>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
and    $0x80000000,%eax
cmp    -0x10(%rbp),%eax
jne    1159 <bitScan_fun_int32_t+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <bitScan_fun_int32_t+0x34>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitScan_fun_int32_t>:
test   %edi,%edi
je     111c <bitScan_fun_int32_t+0x1c>
mov    $0xffffffff,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    %ecx,%ecx
add    $0x1,%eax
mov    %ecx,%edx
xor    %edi,%edx
jns    1110 <bitScan_fun_int32_t+0x10>
ret
mov    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @bitScan_fun_int32_t(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = shl i32 %4, 1
%7 = xor i32 %6, %0
%8 = icmp sgt i32 %7, -1
%9 = add nuw nsw i32 %5, 1
br i1 %8, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 31, %1 ], [ %5, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ lzwcompstream();
int /*<<< orphan*/ readpbmhead();
int /*<<< orphan*/ writegifhead();
int /*<<< orphan*/ writegiftail();
int main(int argc, char *argv[]) {
  readpbmhead();
  writegifhead();
  lzwcompstream();
  writegiftail();
  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   1050 <readpbmhead@plt>
mov    $0x0,%al
call   1030 <writegifhead@plt>
mov    $0x0,%al
call   1060 <lzwcompstream@plt>
mov    $0x0,%al
call   1040 <writegiftail@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <readpbmhead@plt>
xor    %eax,%eax
call   1030 <writegifhead@plt>
xor    %eax,%eax
call   1060 <lzwcompstream@plt>
xor    %eax,%eax
call   1040 <writegiftail@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 (...) @readpbmhead()
%7 = call i32 (...) @writegifhead()
%8 = call i32 (...) @lzwcompstream()
%9 = call i32 (...) @writegiftail()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @readpbmhead()
%4 = tail call i32 (...) @writegifhead()
%5 = tail call i32 (...) @lzwcompstream()
%6 = tail call i32 (...) @writegiftail()
ret i32 0
}
void f_acc_kernels(void) {
#pragma acc kernels
  {
    int i;
#pragma omp atomic write
    i = 0;
  }
}


x86 assembly (clang, -O0):
<f_acc_kernels>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_file_selection_get_selections() {
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  int c = getchar();
  if (c > 'A')
    putchar('X');
  else
    putchar('Y');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jle    1152 <main+0x32>
mov    $0x58,%edi
call   1030 <putchar@plt>
jmp    115c <main+0x3c>
mov    $0x59,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %edi,%edi
cmp    $0x42,%eax
setge  %dil
xor    $0x59,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getchar()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 65
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @putchar(i8 signext 88)
br label %10
8: ; preds = %0
%9 = call i32 @putchar(i8 signext 89)
br label %10
10: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = icmp sgt i32 %1, 65
%3 = select i1 %2, i8 88, i8 89
%4 = tail call i32 @putchar(i8 signext %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("This is test #3.\n");
  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)
lea    0xed3(%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 = [18 x i8] c"This is test.\0A\00"
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 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"This is test.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void pti_finalize(void) {}


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

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

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

LLVM IR (-O2):
define void @pti_finalize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testEndian();
int main() {
  testEndian();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <testEndian@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testEndian()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testEndian()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr, "Use as: %s [-h] [-n]\n",
          progname != NULL ? progname : "exec-sh-test");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <usage+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1150 <usage+0x40>
lea    0xecf(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1150 <usage+0x40>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rdx
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
test   %rdi,%rdi
lea    0xef3(%rip),%rdx
cmovne %rdi,%rdx
lea    0xed2(%rip),%rsi
mov    %eax,%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Use as: %s [-h] [-n]\0A\00"
@.str.1 = [13 x i8] c"exec-sh-test\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i8*, i8** %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi i8* [ %7, %6 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %8 ]
%11 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Use as: %s [-h] [-n]\0A\00"
@.str.1 = [13 x i8] c"exec-sh-test\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %0
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
int f_ble_rr1(float a1, float a2) { return (__builtin_islessequal(a1, a2)); }


x86 assembly (clang, -O0):
<f_ble_rr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ble_rr1>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @f_ble_rr1(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 ole float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f_ble_rr1(float %0, float %1) {
%3 = fcmp ole float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t crypt_backend_flags(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @crypt_backend_flags() {
ret i32 0
}
int tolower(c)
int c;
{ return (__sbtolower(c)); }


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

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

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @__sbtolower to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @__sbtolower to i32 (i32, ...)*)(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ print_help();
int /*<<< orphan*/ stderr;
void check_argument(char *checker) {
  if (*checker != '\0') {
    fprintf(stderr, "%s\n", "ERROR bad arguments! Check your arguments again!");
    print_help();
  }
}


x86 assembly (clang, -O0):
<check_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115f <check_argument+0x3f>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
lea    0xeb1(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <print_help@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_argument>:
push   %rax
cmpb   $0x0,(%rdi)
je     114a <check_argument+0x2a>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
lea    0xec7(%rip),%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <print_help@plt>
pop    %rax
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [49 x i8] c"ERROR bad arguments! Check your arguments again!\00"
define void @check_argument(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (...) @print_help()
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [49 x i8] c"ERROR bad arguments! Check your arguments again!\00"
define void @check_argument(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (...) @print_help()
br label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_nullify_stdfds() {
  printf("NOT IMPLEMENTED:"
         "pa_nullify_stdfds"
         "\n");
}


x86 assembly (clang, -O0):
<pa_nullify_stdfds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_nullify_stdfds\0A\00"
define i32 @pa_nullify_stdfds() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_nullify_stdfds\00"
define i32 @pa_nullify_stdfds() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int __wrap_getpid(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @__wrap_getpid() {
ret i32 1
}

LLVM IR (-O2):
define i32 @__wrap_getpid() {
ret i32 1
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
bool file_exists_p(const char *filename) {
  struct stat buf;
  int err = stat(filename, &buf);
  return err == 0;
}


x86 assembly (clang, -O0):
<file_exists_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists_p>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists_p(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists_p(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void gtk_im_context_simple_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_im_context_simple_get_type() {
ret void
}
/* Variables and functions */
int __isign(int, int);
int intr_wrap_469(int p1, int p2) { return __isign(p1, p2); }


x86 assembly (clang, -O0):
<intr_wrap_469>:
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 <__isign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_469>:
jmp    1030 <__isign@plt>

LLVM IR (-O0):
define i32 @intr_wrap_469(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 @__isign(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @intr_wrap_469(i32 %0, i32 %1) {
%3 = tail call i32 @__isign(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int color_eqn(int, int, int, int, int, int);
int b_cyg_yeg_yemg(int entrycyg, int entrycymg, int entryyeg, int entryyemg) {
  return color_eqn(87, entrycyg, 86, entryyemg, -144, entryyeg);
}


x86 assembly (clang, -O0):
<b_cyg_yeg_yemg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%r9d
mov    $0x57,%edi
mov    $0x56,%edx
mov    $0xffffff70,%r8d
call   1030 <color_eqn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_cyg_yeg_yemg>:
mov    %edx,%r9d
mov    %edi,%esi
mov    $0x57,%edi
mov    $0x56,%edx
mov    $0xffffff70,%r8d
jmp    1030 <color_eqn@plt>

LLVM IR (-O0):
define i32 @b_cyg_yeg_yemg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = call i32 @color_eqn(i32 87, i32 %9, i32 86, i32 %10, i32 -144, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @b_cyg_yeg_yemg(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @color_eqn(i32 87, i32 %0, i32 86, i32 %3, i32 -144, i32 %2)
ret i32 %5
}
/* Type definitions */
struct cpufreq_affected_cpus {
  int dummy;
};

/* Variables and functions */
struct cpufreq_affected_cpus *proc_get_related_cpus(unsigned int);
struct cpufreq_affected_cpus *sysfs_get_related_cpus(unsigned int);
struct cpufreq_affected_cpus *cpufreq_get_related_cpus(unsigned int cpu) {
  struct cpufreq_affected_cpus *ret;
  ret = sysfs_get_related_cpus(cpu);
  if (!ret)
    ret = proc_get_related_cpus(cpu);
  return (ret);
}


x86 assembly (clang, -O0):
<cpufreq_get_related_cpus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <sysfs_get_related_cpus@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <cpufreq_get_related_cpus+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <proc_get_related_cpus@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpufreq_get_related_cpus>:
push   %rbx
mov    %edi,%ebx
call   1040 <sysfs_get_related_cpus@plt>
test   %rax,%rax
je     112f <cpufreq_get_related_cpus+0xf>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <proc_get_related_cpus@plt>

LLVM IR (-O0):
%struct.cpufreq_affected_cpus = type { i32 }
define %struct.cpufreq_affected_cpus* @cpufreq_get_related_cpus(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.cpufreq_affected_cpus*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.cpufreq_affected_cpus* @sysfs_get_related_cpus(i32 %4)
store %struct.cpufreq_affected_cpus* %5, %struct.cpufreq_affected_cpus** %3
%6 = load %struct.cpufreq_affected_cpus*, %struct.cpufreq_affected_cpus** %3
%7 = icmp ne %struct.cpufreq_affected_cpus* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call %struct.cpufreq_affected_cpus* @proc_get_related_cpus(i32 %9)
store %struct.cpufreq_affected_cpus* %10, %struct.cpufreq_affected_cpus** %3
br label %11
11: ; preds = %8, %1
%12 = load %struct.cpufreq_affected_cpus*, %struct.cpufreq_affected_cpus** %3
ret %struct.cpufreq_affected_cpus* %12
}

LLVM IR (-O2):
%struct.cpufreq_affected_cpus = type { i32 }
define %struct.cpufreq_affected_cpus* @cpufreq_get_related_cpus(i32 %0) {
%2 = tail call %struct.cpufreq_affected_cpus* @sysfs_get_related_cpus(i32 %0)
%3 = icmp eq %struct.cpufreq_affected_cpus* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call %struct.cpufreq_affected_cpus* @proc_get_related_cpus(i32 %0)
br label %6
6: ; preds = %4, %1
%7 = phi %struct.cpufreq_affected_cpus* [ %2, %1 ], [ %5, %4 ]
ret %struct.cpufreq_affected_cpus* %7
}
void XReadBitmapFile() {}


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

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

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

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