xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "Usage:\n"
          "\t%s send 'msg text'\n"
          "\t%s recv\n",
          "msg_do", "msg_do");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xefa(%rip),%rcx
mov    %rcx,%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xefe(%rip),%rcx
mov    %rcx,%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage:\0A\09%s send 'msg text'\0A\09%s recv\0A\00"
@.str.1 = [7 x i8] c"msg_do\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage:\0A\09%s send 'msg text'\0A\09%s recv\0A\00"
@.str.1 = [7 x i8] c"msg_do\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
extern __attribute__((__always___)) __attribute__((__gnu___)) char *
strrchr_foo(const char *__s, int __c) {
  return __builtin_strrchr(__s, __c);
}


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

x86 assembly (clang, -O2):
<strrchr_foo>:
jmp    1030 <strrchr@plt>

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

LLVM IR (-O2):
define i8* @strrchr_foo(i8* %0, i32 %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_and_ps(int /*<<< orphan*/ const,
                              int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_castsi128_ps(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set1_epi32(int);
__attribute__((always_)) __m128 mm_abs_ps(const __m128 xmm0) {
  const __m128 mask = _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF));
  return _mm_and_ps(xmm0, mask);
}


x86 assembly (clang, -O0):
<mm_abs_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x7fffffff,%edi
call   1040 <_mm_set1_epi32@plt>
mov    %eax,%edi
call   1030 <_mm_castsi128_ps@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <_mm_and_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_abs_ps>:
push   %rbx
mov    %edi,%ebx
mov    $0x7fffffff,%edi
call   1040 <_mm_set1_epi32@plt>
mov    %eax,%edi
call   1030 <_mm_castsi128_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1050 <_mm_and_ps@plt>

LLVM IR (-O0):
define i32 @mm_abs_ps(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @_mm_set1_epi32(i32 2147483647)
%5 = call i32 @_mm_castsi128_ps(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @_mm_and_ps(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @mm_abs_ps(i32 %0) {
%2 = tail call i32 @_mm_set1_epi32(i32 2147483647)
%3 = tail call i32 @_mm_castsi128_ps(i32 %2)
%4 = tail call i32 @_mm_and_ps(i32 %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_7bit();
int /*<<< orphan*/ test_8bit();
int /*<<< orphan*/ test_ucs2();
void test_packing() {
  test_ucs2();
  test_8bit();
  test_7bit();
}


x86 assembly (clang, -O0):
<test_packing>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_ucs2@plt>
mov    $0x0,%al
call   1040 <test_8bit@plt>
mov    $0x0,%al
call   1050 <test_7bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_packing>:
push   %rax
xor    %eax,%eax
call   1030 <test_ucs2@plt>
xor    %eax,%eax
call   1040 <test_8bit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_7bit@plt>

LLVM IR (-O0):
define void @test_packing() {
%1 = call i32 (...) @test_ucs2()
%2 = call i32 (...) @test_8bit()
%3 = call i32 (...) @test_7bit()
ret void
}

LLVM IR (-O2):
define void @test_packing() {
%1 = tail call i32 (...) @test_ucs2()
%2 = tail call i32 (...) @test_8bit()
%3 = tail call i32 (...) @test_7bit()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t SDLGui_UnInit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SDLGui_UnInit() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M43_f(char *s) {
  debug("M43_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M43_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M43_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M43_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M43_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M43_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M43_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ runAllTests_eet();
int main(void) {
  runAllTests_eet();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runAllTests_eet()
ret i32 0
}
void outbyte(unsigned char c) { *(unsigned char *)0xFF00 = c; }


x86 assembly (clang, -O0):
<outbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0xff00,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outbyte>:
mov    %dil,0xff00
ret

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

LLVM IR (-O2):
define void @outbyte(i8 zeroext %0) {
store i8 %0, i8* inttoptr (i64 65280 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sio_mask(int, int, int, int);
int board_ibm_x3455(void) {
  sio_mask(0xcd6, 0x45, 0x20, 0x20);
  return 0;
}


x86 assembly (clang, -O0):
<board_ibm_x3455>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcd6,%edi
mov    $0x45,%esi
mov    $0x20,%ecx
mov    %ecx,%edx
call   1030 <sio_mask@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_ibm_x3455>:
push   %rax
mov    $0xcd6,%edi
mov    $0x45,%esi
mov    $0x20,%edx
mov    $0x20,%ecx
call   1030 <sio_mask@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @board_ibm_x3455() {
%1 = call i32 @sio_mask(i32 3286, i32 69, i32 32, i32 32)
ret i32 0
}

LLVM IR (-O2):
define i32 @board_ibm_x3455() {
%1 = tail call i32 @sio_mask(i32 3286, i32 69, i32 32, i32 32)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ KeyExpansionStdcall(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ *);
void Spartan_keyExpansion(uint8_t *k, uint8_t *w, uint8_t *sb) {
  KeyExpansionStdcall(k, w, sb);
}


x86 assembly (clang, -O0):
<Spartan_keyExpansion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <KeyExpansionStdcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Spartan_keyExpansion>:
jmp    1030 <KeyExpansionStdcall@plt>

LLVM IR (-O0):
define void @Spartan_keyExpansion(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 = load i32*, i32** %6
%10 = call i32 @KeyExpansionStdcall(i32* %7, i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @Spartan_keyExpansion(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @KeyExpansionStdcall(i32* %0, i32* %1, i32* %2)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
int FileExists(char *pathname) {
  struct stat buf;
  if (stat(pathname, &buf) < 0)
    return (0);
  return (S_ISREG(buf.st_mode));
}


x86 assembly (clang, -O0):
<FileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    114f <FileExists+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <FileExists+0x3a>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileExists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     1138 <FileExists+0x18>
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @FileExists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISREG(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @FileExists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISREG(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ target();
void a() { target(); }


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

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

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

LLVM IR (-O2):
define void @a() {
%1 = tail call i32 (...) @target()
ret void
}
int highest_of(int arg1, int arg2) {
  if (arg1 >= arg2)
    return arg1;
  else
    return arg2;
}


x86 assembly (clang, -O0):
<highest_of>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1121 <highest_of+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <highest_of+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<highest_of>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @highest_of(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int comp(const void *a, const void *b) {
  if (*(const int *)a < *(const int *)b)
    return -1;
  if (*(const int *)a == *(const int *)b)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <comp+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <comp+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1148 <comp+0x48>
movl   $0x0,-0x4(%rbp)
jmp    114f <comp+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
unsigned int f34(unsigned int x, unsigned long int y) {
  return (x >> y) | (x << ((-y) & (8 * 4 - 1)));
}


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

x86 assembly (clang, -O2):
<f34>:
mov    %rsi,%rcx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f34(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 = lshr i32 %5, %7
%9 = load i32, i32* %3
%10 = load i64, i64* %4
%11 = sub i64 0, %10
%12 = and i64 %11, 31
%13 = trunc i64 %12 to i32
%14 = shl i32 %9, %13
%15 = or i32 %8, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f34(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = lshr i32 %0, %3
%5 = sub i32 0, %3
%6 = and i32 %5, 31
%7 = shl i32 %0, %6
%8 = or i32 %7, %4
ret i32 %8
}
__typeof__(isdigit((void *)1)) test_isdigit_27(void) {
  return isdigit((void *)1);
}


x86 assembly (clang, -O0):
<test_isdigit_27>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
mov    %eax,%edi
call   1030 <isdigit@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_isdigit_27() {
%1 = call i32 @isdigit(i32 ptrtoint (i8* inttoptr (i64 1 to i8*) to i32))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_isdigit_27() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int bitcount(unsigned int);
int /*<<< orphan*/ printBits(int, unsigned int *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  unsigned int x;
  x = 175;
  printf("x            : ");
  printBits(sizeof(x), &x);
  printf("count of 1's : %d\n", bitcount(x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xaf,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x4,%edi
lea    -0x8(%rbp),%rsi
call   1030 <printBits@plt>
mov    -0x8(%rbp),%edi
call   1050 <bitcount@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xaf,0x4(%rsp)
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    $0x4,%edi
call   1030 <printBits@plt>
mov    0x4(%rsp),%edi
call   1050 <bitcount@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"x : \00"
@.str.1 = [19 x i8] c"count of 1's : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 175, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printBits(i32 4, i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @bitcount(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"x : \00"
@.str.1 = [19 x i8] c"count of 1's : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 175, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printBits(i32 4, i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @bitcount(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
int is_alpha(char c) {
  if (c >= 'a' && c <= 'z')
    return 1;
  if (c >= 'A' && c <= 'Z')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <is_alpha+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <is_alpha+0x30>
movl   $0x1,-0x4(%rbp)
jmp    115d <is_alpha+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <is_alpha+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1156 <is_alpha+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <is_alpha+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alpha(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %22
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %22
21: ; preds = %16, %12
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20, %11
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @is_alpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
__attribute__((no)) int *Ident(void *x) { return x; }


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

x86 assembly (clang, -O2):
<Ident>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32* @Ident(i8* readnone %0) {
%2 = bitcast i8* %0 to i32*
ret i32* %2
}
unsigned int bits_is_odd_uint(unsigned int val) { return ((val)&1); }


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

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

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

LLVM IR (-O2):
define i32 @bits_is_odd_uint(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_uid;
};
struct passwd {
  char *pw_name;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
char *get_username(struct stat file_stat) {
  struct passwd *passwd;
  if ((passwd = getpwuid(file_stat.st_uid)) == NULL) {
    perror("getpwuid");
    exit(EXIT_FAILURE);
  }
  return passwd->pw_name;
}


x86 assembly (clang, -O0):
<get_username>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    116b <get_username+0x3b>
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_username>:
push   %rax
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1140 <get_username+0x10>
mov    (%rax),%rax
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.passwd = type { i8* }
@.str = [9 x i8] c"getpwuid\00"
@EXIT_FAILURE = global i32 0
define i8* @get_username(i32 %0) {
%2 = alloca %struct.stat
%3 = alloca %struct.passwd*
%4 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
store i32 %0, i32* %4
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call %struct.passwd* @getpwuid(i32 %6)
store %struct.passwd* %7, %struct.passwd** %3
%8 = icmp eq %struct.passwd* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load %struct.passwd*, %struct.passwd** %3
%15 = getelementptr inbounds %struct.passwd, %struct.passwd* %14, i32 0, i32 0
%16 = load i8*, i8** %15
ret i8* %16
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [9 x i8] c"getpwuid\00"
@EXIT_FAILURE = global i32 0
define i8* @get_username(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
%9 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%10 = load i8*, i8** %9
ret i8* %10
}
/* Variables and functions */
scalar_t__ _get_sysfs_numeric(char *, char *, unsigned char *);
unsigned char get_sysfs_chex(char *sysfs_attr) {
  unsigned char number;
  if (_get_sysfs_numeric(sysfs_attr, "%hhx", &number) == 0)
    return number;
  else
    return ((unsigned char)-1);
}


x86 assembly (clang, -O0):
<get_sysfs_chex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x11(%rbp),%rdx
call   1030 <_get_sysfs_numeric@plt>
cmp    $0x0,%rax
jne    1145 <get_sysfs_chex+0x35>
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1149 <get_sysfs_chex+0x39>
movb   $0xff,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sysfs_chex>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x7(%rsp),%rdx
call   1030 <_get_sysfs_numeric@plt>
neg    %rax
sbb    %eax,%eax
or     0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%hhx\00"
define zeroext i8 @get_sysfs_chex(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @_get_sysfs_numeric(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8, i8* %4
store i8 %9, i8* %2
br label %11
10: ; preds = %1
store i8 -1, i8* %2
br label %11
11: ; preds = %10, %8
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"%hhx\00"
define zeroext i8 @get_sysfs_chex(i8* %0) {
%2 = alloca i8
%3 = call i64 @_get_sysfs_numeric(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = icmp eq i64 %3, 0
%5 = load i8, i8* %2
%6 = select i1 %4, i8 %5, i8 -1
ret i8 %6
}
int test_imm_35int8_mem(signed char *val) {
  return ((*val) & (0x35 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_35int8_mem>:
testb  $0x35,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_35int8_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, 53
%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_35int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 53
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printd(int);
int /*<<< orphan*/ putchar(char);
scalar_t__ scanf(char *, int *);
int main(void) {
  int number;
  while (scanf("%d", &number)) {
    printd(number);
    putchar('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x0,%rax
je     1170 <main+0x40>
mov    -0x8(%rbp),%edi
call   1040 <printd@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
test   %rax,%rax
je     1183 <main+0x53>
lea    0xeaf(%rip),%r14
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    0x4(%rsp),%edi
call   1040 <printd@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printd(i32 %7)
%9 = call i32 @putchar(i8 signext 10)
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %0, %5
%6 = load i32, i32* %1
%7 = call i32 @printd(i32 %6)
%8 = call i32 @putchar(i8 signext 10)
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %5
11: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
float frexpf(float, int *);
float octave_frexpf_wrapper(float x, int *expptr) { return frexpf(x, expptr); }


x86 assembly (clang, -O0):
<octave_frexpf_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <frexpf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_frexpf_wrapper>:
jmp    1030 <frexpf@plt>

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

LLVM IR (-O2):
define float @octave_frexpf_wrapper(float %0, i32* nocapture %1) {
%3 = tail call float @frexpf(float %0, i32* %1)
ret float %3
}
int test_imm_BDint64_highword_reg(long long val) {
  return ((val >> 32) & (0xBD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BDint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xbd,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BDint64_highword_reg>:
movabs $0xbd00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BDint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 189
%6 = icmp ne i64 %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_BDint64_highword_reg(i64 %0) {
%2 = and i64 %0, 811748818944
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct factory {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void factory_do_it(struct factory *factory) { printf("factory::do_it()\n"); }


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

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

LLVM IR (-O0):
%struct.factory = type { i32 }
@.str = [18 x i8] c"factory::do_it()\0A\00"
define void @factory_do_it(%struct.factory* %0) {
%2 = alloca %struct.factory*
store %struct.factory* %0, %struct.factory** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.factory = type { i32 }
@str = [17 x i8] c"factory::do_it()\00"
define void @factory_do_it(%struct.factory* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
extern char shmem_char_g(char *addr, int pe) { return *addr; }


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

x86 assembly (clang, -O2):
<shmem_char_g>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define signext i8 @shmem_char_g(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
ret i8 %3
}
/* Variables and functions */
int __send_to_ppe(int, int, char const **);
int puts(char const *s) {
  ;
  return __send_to_ppe(0x2100, 25, &s);
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2100,%edi
mov    $0x19,%esi
lea    -0x8(%rbp),%rdx
call   1030 <__send_to_ppe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdx
mov    $0x2100,%edi
mov    $0x19,%esi
call   1030 <__send_to_ppe@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @__send_to_ppe(i32 8448, i32 25, i8** %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @__send_to_ppe(i32 8448, i32 25, i8** %2)
ret i32 %3
}
int foo25() { return 25; }


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

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

LLVM IR (-O0):
define i32 @foo25() {
ret i32 25
}

LLVM IR (-O2):
define i32 @foo25() {
ret i32 25
}
/* Type definitions */
struct of_platform_driver {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ of_unregister_driver(struct of_platform_driver *);
void of_unregister_platform_driver(struct of_platform_driver *drv) {
  of_unregister_driver(drv);
}


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

x86 assembly (clang, -O2):
<of_unregister_platform_driver>:
jmp    1030 <of_unregister_driver@plt>

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

LLVM IR (-O2):
%struct.of_platform_driver = type { i32 }
define void @of_unregister_platform_driver(%struct.of_platform_driver* %0) {
%2 = tail call i32 @of_unregister_driver(%struct.of_platform_driver* %0)
ret void
}
/* Variables and functions */
size_t randi(int /*<<< orphan*/, int);
void *sample(void **array, int array_length) {
  return array[randi(0, array_length)];
}


x86 assembly (clang, -O0):
<sample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
xor    %edi,%edi
call   1030 <randi@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    (%rax,%rcx,8),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <randi@plt>
mov    (%rbx,%rax,8),%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @sample(i8** nocapture %0, i32 %1) {
%3 = tail call i64 @randi(i32 0, i32 %1)
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
ret i8* %5
}
/* Variables and functions */
char *strrchr(char *, char);
char *my_basename(char *path) {
  char *p;
  p = strrchr(path, '/');
  if (!p)
    p = path;
  else
    p++;
  return p;
}


x86 assembly (clang, -O0):
<my_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <my_basename+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <my_basename+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @my_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
store i8* %9, i8** %3
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %13
13: ; preds = %10, %8
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @my_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
int ph_unknown_deinit(void *handler) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ph_unknown_deinit(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[] = "Hello world.\n";
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0x12(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0xa2e646c726f77,%rax
mov    %rax,0xe(%rsp)
movabs $0x6f77206f6c6c6548,%rax
20 77 6f
mov    %rax,0x8(%rsp)
lea    0xed5(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.str = [14 x i8] c"Hello world.\0A\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
void afree(void *ptr) {
  char *q;
  uint32_t *h;
  if (ptr == NULL)
    return;
  h = (uint32_t *)(ptr - 4);
  q = ((void *)h) - *h;
  free(q);
}


x86 assembly (clang, -O0):
<afree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <afree+0x1c>
jmp    1158 <afree+0x48>
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<afree>:
test   %rdi,%rdi
je     1125 <afree+0x15>
movslq -0x4(%rdi),%rax
add    $0xfffffffffffffffc,%rdi
sub    %rax,%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @afree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = getelementptr i8, i8* %0, i64 -4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = sub nsw i64 0, %7
%9 = getelementptr i8, i8* %4, i64 %8
%10 = tail call i32 @free(i8* %9)
br label %11
11: ; preds = %1, %3
ret void
}
void fct(int test) {}


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

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

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

LLVM IR (-O2):
define void @fct(i32 %0) {
ret void
}
/* Variables and functions */
double exp(double);
double log(double);
double pot(double x, double y) { return exp(y * log(x)); }


x86 assembly (clang, -O0):
<pot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pot>:
push   %rax
movsd  %xmm1,(%rsp)
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @pot(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = call double @log(double %6)
%8 = fmul double %5, %7
%9 = call double @exp(double %8)
ret double %9
}

LLVM IR (-O2):
define double @pot(double %0, double %1) {
%3 = tail call double @log(double %0)
%4 = fmul double %3, %1
%5 = tail call double @exp(double %4)
ret double %5
}
/* Variables and functions */
size_t get_data_tag_in_NestedParty(size_t __tag) {
  (void)__tag;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @get_data_tag_in_NestedParty(i64 %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x58() {
  Assert_real((isodigit(88) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              445, ("isodigit should be 0 for X"));
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @PRCMRTCInUseSet() {
%1 = tail call i32 (...) @RTCUseSet()
ret void
}
/* Type definitions */
struct shmid_ds {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int shmctl(int, int /*<<< orphan*/, struct shmid_ds *);
int elishm(int id) { return (shmctl(id, IPC_RMID, (struct shmid_ds *)0)); }


x86 assembly (clang, -O0):
<elishm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <shmctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elishm>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <shmctl@plt>

LLVM IR (-O0):
%struct.shmid_ds = type { i32 }
@IPC_RMID = global i32 0
define i32 @elishm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @shmctl(i32 %3, i32 %4, %struct.shmid_ds* null)
ret i32 %5
}

LLVM IR (-O2):
%struct.shmid_ds = type { i32 }
@IPC_RMID = global i32 0
define i32 @elishm(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @shmctl(i32 %0, i32 %2, %struct.shmid_ds* null)
ret i32 %3
}
int __test() {
  int f = L'0';
  return f;
}


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

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

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

LLVM IR (-O2):
define i32 @__test() {
ret i32 48
}