xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ EINVAL;
int atoi(char const *);
scalar_t__ errno;
int parse_int(const char *s_int) {
  int n_int;
  n_int = atoi(s_int);
  if (errno == EINVAL) {
    return -1;
  }
  return n_int;
}


x86 assembly (clang, -O0):
<parse_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%rax
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%rax
jne    114e <parse_int+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <parse_int+0x44>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_int>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%rax
mov    0x2eb7(%rip),%rcx
cmp    (%rcx),%rax
jne    112c <parse_int+0x1c>
mov    $0xffffffff,%eax
ret
jmp    1030 <atoi@plt>

LLVM IR (-O0):
@errno = global i64 0
@EINVAL = global i64 0
define i32 @parse_int(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @atoi(i8* %5)
store i32 %6, i32* %4
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINVAL
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@errno = global i64 0
@EINVAL = global i64 0
define i32 @parse_int(i8* nocapture %0) {
%2 = load i64, i64* @errno
%3 = load i64, i64* @EINVAL
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @atoi(i8* %0)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ -1, %1 ]
ret i32 %8
}
void tracepoint_update_probe_range(struct tracepoint *begin,
                                   struct tracepoint *end) {}


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

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

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

LLVM IR (-O2):
%struct.tracepoint = type opaque
define void @tracepoint_update_probe_range(%struct.tracepoint* nocapture %0, %struct.tracepoint* nocapture %1) {
ret void
}
int f_le_cr2(float a1) { return !(((100) <= (a1))); }


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

x86 assembly (clang, -O2):
<f_le_cr2>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
setb   %al
ret

LLVM IR (-O0):
define i32 @f_le_cr2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ole float 1.000000e+02, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f_le_cr2(float %0) {
%2 = fcmp ult float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_DAuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xDA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DAuint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xda,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DAuint64_midword_reg>:
test   $0xda0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DAuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 218
%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_DAuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 14286848
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ func2();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("I'm a program and i wanna know. %d\n", 46);
  printf("-=-=-=-=-=-=-=-=-=-=- -=-=-=-=-=-=-=-=-=-=- -=-=-=-=-=-=-=-=-=-=-\n");
  func2();
  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    0xec3(%rip),%rdi
mov    $0x2e,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <func2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x2e,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <func2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"I'm a program and i wanna know. %d\0A\00"
@.str.1 = [67 x i8] c"-=-=-=-=-=-=-=-=-=-=- -=-=-=-=-=-=-=-=-=-=- -=-=-=-=-=-=-=-=-=-=-\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 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 46)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @func2()
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"I'm a program and i wanna know. %d\0A\00"
@str = [66 x i8] c"-=-=-=-=-=-=-=-=-=-=- -=-=-=-=-=-=-=-=-=-=- -=-=-=-=-=-=-=-=-=-=-\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 46)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (...) @func2()
ret i32 0
}
/* Type definitions */
struct constructHeader {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SetConstructPPForm(void *, struct constructHeader *,
                                      char const *);
void EnvSetDefgenericPPForm(void *theEnv, void *theDefgeneric,
                            const char *thePPForm) {
  SetConstructPPForm(theEnv, (struct constructHeader *)theDefgeneric,
                     thePPForm);
}


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

x86 assembly (clang, -O2):
<EnvSetDefgenericPPForm>:
jmp    1030 <SetConstructPPForm@plt>

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

LLVM IR (-O2):
%struct.constructHeader = type { i32 }
define void @EnvSetDefgenericPPForm(i8* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %1 to %struct.constructHeader*
%5 = tail call i32 @SetConstructPPForm(i8* %0, %struct.constructHeader* %4, i8* %2)
ret void
}
unsigned int ScaleColor8to5(const unsigned char color) {
  return ((unsigned int)(((color) & ~0x07) >> 3));
}


x86 assembly (clang, -O0):
<ScaleColor8to5>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xfffffff8,%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScaleColor8to5>:
shr    $0x3,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @ScaleColor8to5(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -8
%6 = ashr i32 %5, 3
ret i32 %6
}

LLVM IR (-O2):
define i32 @ScaleColor8to5(i8 zeroext %0) {
%2 = lshr i8 %0, 3
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int factorial(int);
scalar_t__ malloc(int);
int /*<<< orphan*/ permute(unsigned int **, unsigned int *, unsigned int *, int,
                           int);
unsigned int **permutations(unsigned int *array, int s) {
  unsigned int **p =
      (unsigned int **)malloc(sizeof(unsigned int *) * factorial(s));
  unsigned int i = 0;
  permute(p, &i, array, -1, s);
  return p;
}


x86 assembly (clang, -O0):
<permutations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <factorial@plt>
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%r8d
lea    -0x1c(%rbp),%rsi
mov    $0xffffffff,%ecx
call   1040 <permute@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<permutations>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1030 <factorial@plt>
lea    0x0(,%rax,8),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
mov    $0xffffffff,%ecx
mov    %ebp,%r8d
call   1040 <permute@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32** @permutations(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32**
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @factorial(i32 %7)
%9 = sext i32 %8 to i64
%10 = mul i64 8, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i32**
store i32** %13, i32*** %5
store i32 0, i32* %6
%14 = load i32**, i32*** %5
%15 = load i32*, i32** %3
%16 = load i32, i32* %4
%17 = call i32 @permute(i32** %14, i32* %6, i32* %15, i32 -1, i32 %16)
%18 = load i32**, i32*** %5
ret i32** %18
}

LLVM IR (-O2):
define i32** @permutations(i32* %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @factorial(i32 %1)
%5 = shl i32 %4, 3
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i32**
%8 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%9 = call i32 @permute(i32** %7, i32* %3, i32* %0, i32 -1, i32 %1)
ret i32** %7
}
void gtk_text_iter_starts_sentence() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_starts_sentence() {
ret void
}
int test7(int x) { return x / 10 <= 2; }


x86 assembly (clang, -O0):
<test7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x2,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test7>:
xor    %eax,%eax
cmp    $0x1e,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @test7(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = icmp sle i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test7(i32 %0) {
%2 = icmp slt i32 %0, 30
%3 = zext i1 %2 to i32
ret i32 %3
}
int cg_kb_key() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cg_kb_key() {
ret i32 0
}
int f() {
  __label__ mylabel;
mylabel:
  goto mylabel;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <f+0x9>
jmp    1109 <f+0x9>

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

LLVM IR (-O0):
define i32 @f() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define i32 @f() {
br label %1
1: ; preds = %1, %0
br label %1
}
unsigned long lcg_rand(unsigned long *seed) {
  *seed = *seed * 2147001325 + 715136305;
  return 0x31415926 ^ ((*seed >> 16) + (*seed << 16));
}


x86 assembly (clang, -O0):
<lcg_rand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x7ff8a3ed,(%rax),%rcx
add    $0x2aa01d31,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shr    $0x10,%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
xor    $0x31415926,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcg_rand>:
imul   $0x7ff8a3ed,(%rdi),%rax
add    $0x2aa01d31,%rax
mov    %rax,(%rdi)
mov    %rax,%rcx
shr    $0x10,%rcx
shl    $0x10,%rax
add    %rcx,%rax
xor    $0x31415926,%rax
ret

LLVM IR (-O0):
define i64 @lcg_rand(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = mul i64 %4, 2147001325
%6 = add i64 %5, 715136305
%7 = load i64*, i64** %2
store i64 %6, i64* %7
%8 = load i64*, i64** %2
%9 = load i64, i64* %8
%10 = lshr i64 %9, 16
%11 = load i64*, i64** %2
%12 = load i64, i64* %11
%13 = shl i64 %12, 16
%14 = add i64 %10, %13
%15 = xor i64 826366246, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @lcg_rand(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = mul i64 %2, 2147001325
%4 = add i64 %3, 715136305
store i64 %4, i64* %0
%5 = lshr i64 %4, 16
%6 = shl i64 %4, 16
%7 = add i64 %5, %6
%8 = xor i64 %7, 826366246
ret i64 %8
}
void crash_me(int countdown) {
  if (countdown == 0) {
    *(int *)countdown = 'a';
  } else {
    crash_me(--countdown);
  }
}


x86 assembly (clang, -O0):
<crash_me>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1134 <crash_me+0x24>
movslq -0x4(%rbp),%rax
movl   $0x61,(%rax)
jmp    1142 <crash_me+0x32>
mov    -0x4(%rbp),%edi
add    $0xffffffff,%edi
mov    %edi,-0x4(%rbp)
call   1030 <crash_me@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash_me>:
add    $0xffffffff,%edi
jmp    1100 <crash_me>

LLVM IR (-O0):
define void @crash_me(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store i32 97, i32* %8
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %5
ret void
}

LLVM IR (-O2):
define void @crash_me(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = icmp ne i32 %3, 0
tail call void @llvm.assume(i1 %4)
%5 = add nsw i32 %3, -1
br label %2
}
void move_cursor(int row, int col) {}


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

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

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

LLVM IR (-O2):
define void @move_cursor(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mp2vseqx_get_vertical(const uint8_t *p_mp2vseqx) {
  return (p_mp2vseqx[6] & 0x60) >> 5;
}


x86 assembly (clang, -O0):
<mp2vseqx_get_vertical>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
and    $0x60,%eax
sar    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqx_get_vertical>:
mov    0x18(%rdi),%eax
shr    $0x5,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @mp2vseqx_get_vertical(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 6
%5 = load i32, i32* %4
%6 = and i32 %5, 96
%7 = ashr i32 %6, 5
ret i32 %7
}

LLVM IR (-O2):
define i32 @mp2vseqx_get_vertical(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
%4 = lshr i32 %3, 5
%5 = and i32 %4, 3
ret i32 %5
}
IR0A1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (*p0) = (*((short *)11111111)); }


x86 assembly (clang, -O0):
<IR0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0xa98ac7,%eax
mov    (%rax),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0A1>:
movzwl 0xa98ac7,%eax
mov    %ax,(%r8)
ret

LLVM IR (-O0):
define i32 @IR0A1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* inttoptr (i64 11111111 to i16*)
%17 = load i16*, i16** %12
store i16 %16, i16* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @IR0A1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture readnone %5) {
%7 = load i16, i16* inttoptr (i64 11111111 to i16*)
store i16 %7, i16* %4
ret i32 undef
}
/* Type definitions */
struct sonic_app {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sonic_app *);
int /*<<< orphan*/ sonic_free_app_in_lists(struct sonic_app *);
int /*<<< orphan*/ sonic_free_app_out_lists(struct sonic_app *);
void sonic_free_app(struct sonic_app *app) {
  ;
  sonic_free_app_in_lists(app);
  sonic_free_app_out_lists(app);
  free(app);
}


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

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

LLVM IR (-O0):
%struct.sonic_app = type { i32 }
define void @sonic_free_app(%struct.sonic_app* %0) {
%2 = alloca %struct.sonic_app*
store %struct.sonic_app* %0, %struct.sonic_app** %2
%3 = load %struct.sonic_app*, %struct.sonic_app** %2
%4 = call i32 @sonic_free_app_in_lists(%struct.sonic_app* %3)
%5 = load %struct.sonic_app*, %struct.sonic_app** %2
%6 = call i32 @sonic_free_app_out_lists(%struct.sonic_app* %5)
%7 = load %struct.sonic_app*, %struct.sonic_app** %2
%8 = call i32 @free(%struct.sonic_app* %7)
ret void
}

LLVM IR (-O2):
%struct.sonic_app = type { i32 }
define void @sonic_free_app(%struct.sonic_app* %0) {
%2 = tail call i32 @sonic_free_app_in_lists(%struct.sonic_app* %0)
%3 = tail call i32 @sonic_free_app_out_lists(%struct.sonic_app* %0)
%4 = tail call i32 @free(%struct.sonic_app* %0)
ret void
}
/* Variables and functions */
scalar_t__ argin();
int /*<<< orphan*/ rsearch();
scalar_t__ search();
int argset(void) {
  if (argin() == 0)
    return (0);
  if (search() == 0)
    rsearch();
  return (0);
}


x86 assembly (clang, -O0):
<argset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <argin@plt>
cmp    $0x0,%rax
jne    1155 <argset+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1174 <argset+0x44>
mov    $0x0,%al
call   1030 <search@plt>
cmp    $0x0,%rax
jne    116d <argset+0x3d>
mov    $0x0,%al
call   1040 <rsearch@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argset>:
push   %rax
xor    %eax,%eax
call   1050 <argin@plt>
test   %rax,%rax
je     1150 <argset+0x20>
xor    %eax,%eax
call   1030 <search@plt>
test   %rax,%rax
jne    1150 <argset+0x20>
xor    %eax,%eax
call   1040 <rsearch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @argset() {
%1 = alloca i32
%2 = call i64 (...) @argin()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %11
5: ; preds = %0
%6 = call i64 (...) @search()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 (...) @rsearch()
br label %10
10: ; preds = %8, %5
store i32 0, i32* %1
br label %11
11: ; preds = %10, %4
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @argset() {
%1 = tail call i64 (...) @argin()
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i64 (...) @search()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @rsearch()
br label %8
8: ; preds = %3, %6, %0
ret i32 0
}
/* Variables and functions */
char *countAndSay(int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, int, char *);
int main(void) {
  char *res = NULL;
  for (int i = 1; i < 30; i++) {
    res = countAndSay(i);
    printf("%d : %s\n", i, res);
    free(res);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x1e,-0x14(%rbp)
jge    118e <main+0x5e>
mov    -0x14(%rbp),%edi
call   1050 <countAndSay@plt>
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <main+0x1e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%ebx
lea    0xebf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1050 <countAndSay@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
add    $0x1,%ebx
cmp    $0x1e,%ebx
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d : %s\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %7, %2 ]
%4 = tail call i8* @countAndSay(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %4)
%6 = tail call i32 @free(i8* %4)
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 30
br i1 %8, label %1, label %2
}
double fastPow(double a, double b) {
  union {
    double d;
    int x[2];
  } u;
  u.d = a;
  u.x[1] = (int)(b * (u.x[1] - 1072632447) + 1072632447);
  u.x[0] = 0;
  return u.d;
}


x86 assembly (clang, -O0):
<fastPow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%eax
sub    $0x3fef127f,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecb(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastPow>:
movq   %xmm0,%rax
shr    $0x20,%rax
add    $0xc010ed81,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xedf(%rip),%xmm0
cvttsd2si %xmm0,%eax
shl    $0x20,%rax
movq   %rax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @fastPow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca %union.anon
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = bitcast %union.anon* %5 to double*
store double %6, double* %7
%8 = load double, double* %4
%9 = bitcast %union.anon* %5 to [2 x i32]*
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%11 = load i32, i32* %10
%12 = sub nsw i32 %11, 1072632447
%13 = sitofp i32 %12 to double
%14 = call double @llvm.fmuladd.f64(double %8, double %13, double 0x41CFF7893F800000)
%15 = fptosi double %14 to i32
%16 = bitcast %union.anon* %5 to [2 x i32]*
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 1
store i32 %15, i32* %17
%18 = bitcast %union.anon* %5 to [2 x i32]*
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %18, i64 0, i64 0
store i32 0, i32* %19
%20 = bitcast %union.anon* %5 to double*
%21 = load double, double* %20
ret double %21
}

LLVM IR (-O2):
define double @fastPow(double %0, double %1) {
%3 = bitcast double %0 to i64
%4 = lshr i64 %3, 32
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, -1072632447
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %1, double %7, double 0x41CFF7893F800000)
%9 = fptosi double %8 to i32
%10 = zext i32 %9 to i64
%11 = shl nuw i64 %10, 32
%12 = bitcast i64 %11 to double
ret double %12
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ place;
};
typedef TYPE_1__ XCirculateRequestEvent;

/* Variables and functions */
int get_XCirculateRequestEvent_place(void *_p) {
  return (int)((XCirculateRequestEvent *)_p)->place;
}


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

x86 assembly (clang, -O2):
<get_XCirculateRequestEvent_place>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XCirculateRequestEvent_place(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XCirculateRequestEvent_place(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int gcd(int a, int b) {
  int c;
  while (b != 0) {
    c = a % b;
    a = b;
    b = c;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
unsigned char s3c2440_read_data();
unsigned char read_data(void) {
  if (((*(volatile unsigned int *)0x560000B0) == 0x32410000) ||
      ((*(volatile unsigned int *)0x560000B0) == 0x32410002)) {
    return s3c2440_read_data();
  } else {
    return s3c2440_read_data();
  }
}


x86 assembly (clang, -O0):
<read_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x560000b0,%eax
mov    (%rax),%eax
cmp    $0x32410000,%eax
je     113c <read_data+0x2c>
mov    $0x560000b0,%eax
mov    (%rax),%eax
cmp    $0x32410002,%eax
jne    114b <read_data+0x3b>
mov    $0x0,%al
call   1030 <s3c2440_read_data@plt>
mov    %al,-0x1(%rbp)
jmp    1155 <read_data+0x45>
mov    $0x0,%al
call   1030 <s3c2440_read_data@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data>:
mov    0x560000b0,%eax
cmp    $0x32410000,%eax
je     1125 <read_data+0x15>
mov    0x560000b0,%eax
xor    %eax,%eax
jmp    1030 <s3c2440_read_data@plt>

LLVM IR (-O0):
define zeroext i8 @read_data() {
%1 = alloca i8
%2 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%3 = icmp eq i32 %2, 843120640
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%6 = icmp eq i32 %5, 843120642
br i1 %6, label %7, label %9
7: ; preds = %4, %0
%8 = call zeroext i8 (...) @s3c2440_read_data()
store i8 %8, i8* %1
br label %11
9: ; preds = %4
%10 = call zeroext i8 (...) @s3c2440_read_data()
store i8 %10, i8* %1
br label %11
11: ; preds = %9, %7
%12 = load i8, i8* %1
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @read_data() {
%1 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
%2 = icmp eq i32 %1, 843120640
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = load volatile i32, i32* inttoptr (i64 1442840752 to i32*)
br label %5
5: ; preds = %3, %0
%6 = tail call zeroext i8 (...) @s3c2440_read_data()
ret i8 %6
}
/* Type definitions */
typedef scalar_t__ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t const, char *, int);
int pthread_get_name(const pthread_t tid, char *buf, const size_t len) {
  (void)snprintf(buf, len, "%d", (int)tid);
  return 0;
}


x86 assembly (clang, -O0):
<pthread_get_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
lea    0xec7(%rip),%rdx
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_get_name>:
push   %rax
mov    %rdi,%rcx
lea    0xee5(%rip),%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <snprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @pthread_get_name(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i32
%11 = call i32 @snprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @pthread_get_name(i64 %0, i8* %1, i64 %2) {
%4 = trunc i64 %0 to i32
%5 = tail call i32 @snprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void SensorSetMirrorFlip_Test(unsigned char val) {}


x86 assembly (clang, -O0):
<SensorSetMirrorFlip_Test>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @SensorSetMirrorFlip_Test(i8 zeroext %0) {
ret void
}
/* Variables and functions */
void *freeipmi_memset(void *s, int c, size_t n) {
  while (0 <= --n)
    ((unsigned char *)s)[n] = (unsigned char)c;
  return (s);
}


x86 assembly (clang, -O0):
<freeipmi_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
ja     113b <freeipmi_memset+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    110f <freeipmi_memset+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeipmi_memset>:
lea    (%rdx,%rdi,1),%rax
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax,%rax,1)
mov    %sil,(%rax)
add    $0xffffffffffffffff,%rax
jmp    1110 <freeipmi_memset+0x10>

LLVM IR (-O0):
define i8* @freeipmi_memset(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
br label %7
7: ; preds = %11, %3
%8 = load i64, i64* %6
%9 = add i64 %8, -1
store i64 %9, i64* %6
%10 = icmp ule i64 0, %9
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32, i32* %5
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
%15 = load i64, i64* %6
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 %13, i8* %16
br label %7
17: ; preds = %7
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
define noalias i8* @freeipmi_memset(i8* nocapture writeonly %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
br label %5
5: ; preds = %5, %3
%6 = phi i64 [ %2, %3 ], [ %7, %5 ]
%7 = add i64 %6, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %4, i8* %8
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void syntax() {
  printf("Syntax: mkfs.fatx <device> \n");
  exit(1);
}


x86 assembly (clang, -O0):
<syntax>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<syntax>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Syntax: mkfs.fatx <device> \0A\00"
define void @syntax() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [28 x i8] c"Syntax: mkfs.fatx <device> \00"
define void @syntax() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int gcd(int no1, int no2) {
  if (no2 == 0)
    return no1;
  return gcd(no2, no1 % no2);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <gcd+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(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* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = call i32 @gcd(i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
int test_imm_1Aint8_reg(signed char val) {
  return ((val) & (0x1A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Aint8_reg(i8 signext %0) {
%2 = and i8 %0, 26
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
float wy2gau(uint64_t r) {
  const float _wynorm1 = 1.0f / (1ull << 20);
  return ((r & 0x1fffff) + ((r >> 21) & 0x1fffff) + (r >> 43)) * _wynorm1 -
         3.0f;
}


x86 assembly (clang, -O0):
<wy2gau>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  0xef1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1fffff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x15,%ecx
and    $0x1fffff,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%edx
mov    $0x2b,%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  0xebc(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xeb4(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @wy2gau(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
store float 0x3EB0000000000000, float* %3
%4 = load i32, i32* %2
%5 = and i32 %4, 2097151
%6 = load i32, i32* %2
%7 = ashr i32 %6, 21
%8 = and i32 %7, 2097151
%9 = add nsw i32 %5, %8
%10 = load i32, i32* %2
%11 = ashr i32 %10, 43
%12 = add nsw i32 %9, %11
%13 = sitofp i32 %12 to float
%14 = call float @llvm.fmuladd.f32(float %13, float 0x3EB0000000000000, float -3.000000e+00)
ret float %14
}

LLVM IR (-O2):
define float @wy2gau(i32 %0) {
ret float poison
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rdpmc(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                         unsigned int const);
__attribute__((__unused__, __always___)) __attribute__((__artificial__)) void
rdpmc_cycles(uint32_t *low, uint32_t *high) {
  const unsigned c = (1U << 30) + 1;
  rdpmc(low, high, c);
}


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

x86 assembly (clang, -O2):
<rdpmc_cycles>:
mov    $0x40000001,%edx
jmp    1030 <rdpmc@plt>

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

LLVM IR (-O2):
define void @rdpmc_cycles(i32* %0, i32* %1) {
%3 = tail call i32 @rdpmc(i32* %0, i32* %1, i32 1073741825)
ret void
}
/* Variables and functions */
scalar_t__ SYS_close;
int syscall(long, long);
int close(int fd) { return syscall((long)SYS_close, (long)fd); }


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%rdi
movslq -0x4(%rbp),%rsi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rax
movslq %edi,%rsi
mov    %rax,%rdi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_close = global i64 0
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i64, i64* @SYS_close
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i32 @syscall(i64 %3, i64 %5)
ret i32 %6
}

LLVM IR (-O2):
@SYS_close = global i64 0
define i32 @close(i32 %0) {
%2 = load i64, i64* @SYS_close
%3 = sext i32 %0 to i64
%4 = tail call i32 @syscall(i64 %2, i64 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_store_ps(float *, int /*<<< orphan*/);
void test_mm_store_ps(float *x, __m128 y) { _mm_store_ps(x, y); }


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

x86 assembly (clang, -O2):
<test_mm_store_ps>:
jmp    1030 <_mm_store_ps@plt>

LLVM IR (-O0):
define void @test_mm_store_ps(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 i32 @_mm_store_ps(float* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @test_mm_store_ps(float* %0, i32 %1) {
%3 = tail call i32 @_mm_store_ps(float* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writeCommand1parm(char *, unsigned int);
void forward(unsigned int speed) {
  if (speed <= 100) {
    writeCommand1parm("MF", speed);
  }
}


x86 assembly (clang, -O0):
<forward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
ja     1134 <forward+0x24>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <writeCommand1parm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forward>:
cmp    $0x64,%edi
ja     1123 <forward+0x13>
mov    %edi,%esi
lea    0xee2(%rip),%rdi
jmp    1030 <writeCommand1parm@plt>
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"MF\00"
define void @forward(i32 %0) {
%2 = icmp ult i32 %0, 101
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @writeCommand1parm(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_toss_toss(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_toss_toss>:
jmp    1030 <mock@plt>

LLVM IR (-O0):
define i8* @cf_s_toss_toss(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @mock(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @cf_s_toss_toss(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void dummy_lua() {}


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

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

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

LLVM IR (-O2):
define void @dummy_lua() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void DisplayView_printAdminUpdateSubjectSubMenu() {
  printf("GRADING BOOK MENU - ADMIN\n");
  printf("Update Subject\n");
  printf("  1) Update Subject Criteria\n");
  printf("  2) Update Subject Grade Range\n");
  printf("  3) Exit\n");
  return;
}


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

x86 assembly (clang, -O2):
<DisplayView_printAdminUpdateSubjectSubMenu>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"GRADING BOOK MENU - ADMIN\0A\00"
@.str.1 = [16 x i8] c"Update Subject\0A\00"
@.str.2 = [30 x i8] c" 1) Update Subject Criteria\0A\00"
@.str.3 = [33 x i8] c" 2) Update Subject Grade Range\0A\00"
@.str.4 = [11 x i8] c" 3) Exit\0A\00"
define void @DisplayView_printAdminUpdateSubjectSubMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"GRADING BOOK MENU - ADMIN\00"
@str.5 = [15 x i8] c"Update Subject\00"
@str.6 = [29 x i8] c" 1) Update Subject Criteria\00"
@str.7 = [32 x i8] c" 2) Update Subject Grade Range\00"
@str.8 = [10 x i8] c" 3) Exit\00"
define void @DisplayView_printAdminUpdateSubjectSubMenu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0))
ret void
}
void *test_pointer_add(void *a, void *b) { return (long)a + (long)b; }


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

x86 assembly (clang, -O2):
<test_pointer_add>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i8* @test_pointer_add(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = add nsw i64 %6, %8
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @test_pointer_add(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = add nsw i64 %4, %3
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}