xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ radio_test_ook();
int main(int argc, char **argv) { radio_test_ook(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @radio_test_ook()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ next(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ wait(int *);
int main(void) {
  int k, n;
  int st, s;
  scanf("%d%d", &k, &n);
  next(0, n, k);
  wait(&st);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
xor    %edi,%edi
call   1030 <next@plt>
lea    -0x10(%rbp),%rdi
call   1050 <wait@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
xor    %edi,%edi
call   1030 <next@plt>
lea    0x14(%rsp),%rdi
call   1050 <wait@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = call i32 @next(i32 0, i32 %8, i32 %9)
%11 = call i32 @wait(i32* %3)
ret i32 0
}
int test_imm_11uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x11 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_11uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 17
%7 = icmp ne i64 %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_11uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1114112
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_ABint8_mem(signed char *val) {
  return ((*val) & (-0xAB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ABint8_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, -171
%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_ABint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -171
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ XtPointer;
typedef int /*<<< orphan*/ XtIntervalId;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void timeOut(XtPointer clientData, XtIntervalId *iid) { exit(0); }


x86 assembly (clang, -O0):
<timeOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<timeOut>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @timeOut(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @timeOut(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ drawFastVLine(short, short, short, short);
void writeFastVLine(short x, short y, short h, short color) {
  drawFastVLine(x, y, h, color);
}


x86 assembly (clang, -O0):
<writeFastVLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x4(%rbp),%cx
mov    -0x6(%rbp),%ax
movswl %dx,%edi
movswl %cx,%esi
movswl %ax,%edx
movswl -0x8(%rbp),%ecx
call   1030 <drawFastVLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeFastVLine>:
jmp    1030 <drawFastVLine@plt>

LLVM IR (-O0):
define void @writeFastVLine(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = load i16, i16* %5
%10 = load i16, i16* %6
%11 = load i16, i16* %7
%12 = load i16, i16* %8
%13 = call i32 @drawFastVLine(i16 signext %9, i16 signext %10, i16 signext %11, i16 signext %12)
ret void
}

LLVM IR (-O2):
define void @writeFastVLine(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = tail call i32 @drawFastVLine(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3)
ret void
}
void decode_string(unsigned char *en_str) { ; }


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

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

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

LLVM IR (-O2):
define void @decode_string(i8* nocapture %0) {
ret void
}
void s3c6410_default_sdhci1(void) {}


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

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

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

LLVM IR (-O2):
define void @s3c6410_default_sdhci1() {
ret void
}
int RTco_select(__attribute__((unused)) int p1,
                __attribute__((unused)) void *p2,
                __attribute__((unused)) void *p3,
                __attribute__((unused)) void *p4,
                __attribute__((unused)) void *p5) {}


x86 assembly (clang, -O0):
<RTco_select>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @RTco_select(i32 %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
store i32 %0, i32* %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
define i32 @RTco_select(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
ret i32 undef
}
/* Variables and functions */
int isdigit(char);
int is_num(char *str) { return isdigit(str[0]); }


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

x86 assembly (clang, -O2):
<is_num>:
movsbl (%rdi),%edi
jmp    1030 <isdigit@plt>

LLVM IR (-O0):
define i32 @is_num(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i32 @isdigit(i8 signext %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_num(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @isdigit(i8 signext %2)
ret i32 %3
}
unsigned xrop3_164_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S | T;
  stk3 = ~stk3;
  stk2 = D | stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_164_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_164_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rdi,1),%eax
or     %esi,%ecx
shl    $0x8,%esi
or     %esi,%eax
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_164_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = xor i32 %26, -1
store i32 %27, i32* %10
%28 = load i32, i32* %5
%29 = load i32, i32* %10
%30 = or i32 %28, %29
store i32 %30, i32* %9
%31 = load i32, i32* %7
%32 = load i32, i32* %9
%33 = xor i32 %31, %32
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = xor i32 %34, -1
store i32 %35, i32* %8
%36 = load i32, i32* %8
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = and i32 %40, %41
%43 = or i32 %39, %42
ret i32 %43
}

LLVM IR (-O2):
define i32 @xrop3_164_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %4, %6
%9 = or i32 %5, %7
%10 = xor i32 %9, -1
%11 = and i32 %8, %10
%12 = or i32 %11, %3
ret i32 %12
}
void openerror(void) { return; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ext_setup() {
ret void
}
int test_imm_5Dint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x5D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Dint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 93
%7 = icmp ne i64 %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_5Dint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 399431958528
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void f0() {
  for (;;)
    ;
}


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

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

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

LLVM IR (-O2):
define void @f0() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ delay_us(int);
int /*<<< orphan*/ led(int);
int /*<<< orphan*/ ps2sim_send(unsigned char);
void keydown(unsigned char keycode) {
  ps2sim_send(keycode);
  led(0x00);
  delay_us(300);
}


x86 assembly (clang, -O0):
<keydown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <ps2sim_send@plt>
xor    %edi,%edi
call   1030 <led@plt>
mov    $0x12c,%edi
call   1050 <delay_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keydown>:
push   %rax
call   1040 <ps2sim_send@plt>
xor    %edi,%edi
call   1030 <led@plt>
mov    $0x12c,%edi
pop    %rax
jmp    1050 <delay_us@plt>

LLVM IR (-O0):
define void @keydown(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @ps2sim_send(i8 zeroext %3)
%5 = call i32 @led(i32 0)
%6 = call i32 @delay_us(i32 300)
ret void
}

LLVM IR (-O2):
define void @keydown(i8 zeroext %0) {
%2 = tail call i32 @ps2sim_send(i8 zeroext %0)
%3 = tail call i32 @led(i32 0)
%4 = tail call i32 @delay_us(i32 300)
ret void
}
/* Type definitions */
struct catmc_atomic_signed_long_long {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_signed_long_long *);
void catmc_atomic_signed_long_long_destroy(
    struct catmc_atomic_signed_long_long *wrapper) {
  free(wrapper);
}


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

x86 assembly (clang, -O2):
<catmc_atomic_signed_long_long_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.catmc_atomic_signed_long_long = type { i32 }
define void @catmc_atomic_signed_long_long_destroy(%struct.catmc_atomic_signed_long_long* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_signed_long_long* %0)
ret void
}
/* Variables and functions */
unsigned long READ_VID32(unsigned long);
unsigned long gfx_read_vid32(unsigned long offset) {
  unsigned long value;
  value = READ_VID32(offset);
  return value;
}


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

x86 assembly (clang, -O2):
<gfx_read_vid32>:
jmp    1030 <READ_VID32@plt>

LLVM IR (-O0):
define i64 @gfx_read_vid32(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @READ_VID32(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @gfx_read_vid32(i64 %0) {
%2 = tail call i64 @READ_VID32(i64 %0)
ret i64 %2
}
/* Variables and functions */
unsigned long compress(unsigned long, short);
unsigned long hash_identifier_raw_info(char name_letter,
                                       unsigned long name_number,
                                       short num_bits) {
  return compress(name_number | (name_letter << 24), num_bits);
}


x86 assembly (clang, -O0):
<hash_identifier_raw_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x1(%rbp),%eax
shl    $0x18,%eax
cltq
or     %rax,%rdi
movswl -0x12(%rbp),%esi
call   1030 <compress@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_identifier_raw_info>:
shl    $0x18,%edi
movslq %edi,%rdi
or     %rsi,%rdi
mov    %edx,%esi
jmp    1030 <compress@plt>

LLVM IR (-O0):
define i64 @hash_identifier_raw_info(i8 signext %0, i64 %1, i16 signext %2) {
%4 = alloca i8
%5 = alloca i64
%6 = alloca i16
store i8 %0, i8* %4
store i64 %1, i64* %5
store i16 %2, i16* %6
%7 = load i64, i64* %5
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = shl i32 %9, 24
%11 = sext i32 %10 to i64
%12 = or i64 %7, %11
%13 = load i16, i16* %6
%14 = call i64 @compress(i64 %12, i16 signext %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @hash_identifier_raw_info(i8 signext %0, i64 %1, i16 signext %2) {
%4 = zext i8 %0 to i32
%5 = shl nuw i32 %4, 24
%6 = sext i32 %5 to i64
%7 = or i64 %6, %1
%8 = tail call i64 @compress(i64 %7, i16 signext %2)
ret i64 %8
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *strptime(char const *, char const *, struct tm *);
char *xstrptime(const char *buf, const char *fmt, struct tm *tm) {
  return strptime(buf, fmt, tm);
}


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

x86 assembly (clang, -O2):
<xstrptime>:
jmp    1030 <strptime@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @xstrptime(i8* %0, i8* %1, %struct.tm* %2) {
%4 = tail call i8* @strptime(i8* %0, i8* %1, %struct.tm* %2)
ret i8* %4
}
void glLightf(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glLightf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badparms(void) {
  fprintf(stderr, "usage: fsplit [-e efile] ... [file]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badparms>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badparms>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"usage: fsplit [-e efile] ... [file]\0A\00"
define void @badparms() {
%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))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"usage: fsplit [-e efile] ... [file]\0A\00"
define void @badparms() {
%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))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double pop();
int /*<<< orphan*/ push(double);
void swap(void) {
  double swap1;
  double swap2;
  swap1 = pop();
  swap2 = pop();
  push(swap1);
  push(swap2);
}


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

x86 assembly (clang, -O2):
<swap>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <push@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @swap() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @pop()
store double %3, double* %1
%4 = call double (...) @pop()
store double %4, double* %2
%5 = load double, double* %1
%6 = call i32 @push(double %5)
%7 = load double, double* %2
%8 = call i32 @push(double %7)
ret void
}

LLVM IR (-O2):
define void @swap() {
%1 = tail call double (...) @pop()
%2 = tail call double (...) @pop()
%3 = tail call i32 @push(double %1)
%4 = tail call i32 @push(double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led2Off();
void TestSerialC__Leds__led2Off(void) { LedsP__Leds__led2Off(); }


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

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

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

LLVM IR (-O2):
define void @TestSerialC__Leds__led2Off() {
%1 = tail call i32 (...) @LedsP__Leds__led2Off()
ret void
}
/* Variables and functions */
scalar_t__ as_int32(unsigned int);
extern unsigned greater(unsigned a, unsigned b) {
  return as_int32(a) > as_int32(b);
}


x86 assembly (clang, -O0):
<greater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <as_int32@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <as_int32@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greater>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <as_int32@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <as_int32@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setg   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @greater(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i64 @as_int32(i32 %5)
%7 = load i32, i32* %4
%8 = call i64 @as_int32(i32 %7)
%9 = icmp sgt i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @greater(i32 %0, i32 %1) {
%3 = tail call i64 @as_int32(i32 %0)
%4 = tail call i64 @as_int32(i32 %1)
%5 = icmp sgt i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ _IO(char, int /*<<< orphan*/);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int power_fd;
  if ((power_fd = open("/dev/empeg_power", O_RDONLY)) != -1) {
    ioctl(power_fd, _IO('p', 0), 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1185 <main+0x55>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x70,%edi
xor    %esi,%esi
call   1030 <_IO@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <ioctl@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1050 <open@plt>
cmp    $0xffffffff,%eax
je     1164 <main+0x34>
mov    %eax,%ebx
mov    $0x70,%edi
xor    %esi,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <ioctl@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"/dev/empeg_power\00"
@O_RDONLY = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %6
%9 = icmp ne i32 %8, -1
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %6
%12 = call i32 @_IO(i8 signext 112, i32 0)
%13 = call i32 @ioctl(i32 %11, i32 %12, i32 0)
br label %14
14: ; preds = %10, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"/dev/empeg_power\00"
@O_RDONLY = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @_IO(i8 signext 112, i32 0)
%8 = tail call i32 @ioctl(i32 %4, i32 %7, i32 0)
br label %9
9: ; preds = %6, %2
ret i32 0
}
unsigned char readByte() { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @readByte() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @readByte() {
ret i8 0
}
void panel_delay(void) {
  volatile int i;
  for (i = 0; i < 800; i++)
    ;
}


x86 assembly (clang, -O0):
<panel_delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x320,%eax
jge    112c <panel_delay+0x2c>
jmp    111e <panel_delay+0x1e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <panel_delay+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<panel_delay>:
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x31f,%eax
jg     1130 <panel_delay+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x320,%eax
jl     1120 <panel_delay+0x20>
ret

LLVM IR (-O0):
define void @panel_delay() {
%1 = alloca i32
store volatile i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* %1
%4 = icmp slt i32 %3, 800
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load volatile i32, i32* %1
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @panel_delay() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp slt i32 %3, 800
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = load volatile i32, i32* %1
%7 = add nsw i32 %6, 1
store volatile i32 %7, i32* %1
%8 = load volatile i32, i32* %1
%9 = icmp slt i32 %8, 800
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main() {
  int i;
  for (i = 0; i <= 400; ++i) {
    printf("nope nope nope nope nope nope nope nope ");
  }
  system("echo 1 > /proc/sys/kernel/sysrq");
  system("echo o > /proc/sysrq-trigger");
  while (1) {
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x190,-0x8(%rbp)
jg     115d <main+0x3d>
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xec5(%rip),%rdi
call   1030 <system@plt>
lea    0xed9(%rip),%rdi
call   1030 <system@plt>
jmp    1175 <main+0x55>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x191,%ebp
lea    0xed1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
lea    0xef9(%rip),%rdi
call   1030 <system@plt>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1160 <main+0x40>

LLVM IR (-O0):
@.str = [41 x i8] c"nope nope nope nope nope nope nope nope \00"
@.str.1 = [32 x i8] c"echo 1 > /proc/sys/kernel/sysrq\00"
@.str.2 = [29 x i8] c"echo o > /proc/sysrq-trigger\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 400
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %11, %14
br label %14
}

LLVM IR (-O2):
@.str = [41 x i8] c"nope nope nope nope nope nope nope nope \00"
@.str.1 = [32 x i8] c"echo 1 > /proc/sys/kernel/sysrq\00"
@.str.2 = [29 x i8] c"echo o > /proc/sysrq-trigger\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 401
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @system(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %9, %6
br label %9
}
/* Variables and functions */
int /*<<< orphan*/ b();
int /*<<< orphan*/ c();
int /*<<< orphan*/ d();
void b_nested() {
  b();
  c();
  d();
}


x86 assembly (clang, -O0):
<b_nested>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <b@plt>
mov    $0x0,%al
call   1050 <c@plt>
mov    $0x0,%al
call   1030 <d@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_nested>:
push   %rax
xor    %eax,%eax
call   1040 <b@plt>
xor    %eax,%eax
call   1050 <c@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <d@plt>

LLVM IR (-O0):
define void @b_nested() {
%1 = call i32 (...) @b()
%2 = call i32 (...) @c()
%3 = call i32 (...) @d()
ret void
}

LLVM IR (-O2):
define void @b_nested() {
%1 = tail call i32 (...) @b()
%2 = tail call i32 (...) @c()
%3 = tail call i32 (...) @d()
ret void
}
/* Variables and functions */
char *linkstate2str(int);
char *linkstate2strext(int linkstate) { return linkstate2str(linkstate); }


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

x86 assembly (clang, -O2):
<linkstate2strext>:
jmp    1030 <linkstate2str@plt>

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

LLVM IR (-O2):
define i8* @linkstate2strext(i32 %0) {
%2 = tail call i8* @linkstate2str(i32 %0)
ret i8* %2
}
int test_imm_50int8_mem(signed char *val) {
  return ((*val) & (0x50 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_50int8_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, 80
%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_50int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 80
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M99_f(char *s) {
  debug("M99_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M99_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):
<M99_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"M99_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M99_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"M99_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M99_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 TIOCM_DTR;
int get_mlines(int);
int put_mlines(int, int);
int set_dtr(int fd) {
  int i;
  i = get_mlines(fd);
  i |= TIOCM_DTR;
  i = put_mlines(fd, i);
  return (i);
}


x86 assembly (clang, -O0):
<set_dtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_mlines@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <put_mlines@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_dtr>:
push   %rbx
mov    %edi,%ebx
call   1030 <get_mlines@plt>
mov    0x2eb9(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <put_mlines@plt>

LLVM IR (-O0):
@TIOCM_DTR = global i32 0
define i32 @set_dtr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @get_mlines(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* @TIOCM_DTR
%7 = load i32, i32* %3
%8 = or i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @put_mlines(i32 %9, i32 %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@TIOCM_DTR = global i32 0
define i32 @set_dtr(i32 %0) {
%2 = tail call i32 @get_mlines(i32 %0)
%3 = load i32, i32* @TIOCM_DTR
%4 = or i32 %3, %2
%5 = tail call i32 @put_mlines(i32 %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int main(void) {
  printf("hi\n");
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"hi\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [3 x i8] c"hi\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret i32 0
}
void RTStrCat(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrCat() {
ret void
}
char *mutt_gettext(const char *message) { return (char *)message; }


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

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

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

LLVM IR (-O2):
define i8* @mutt_gettext(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main() {
  fprintf(stderr, "Hello stderr!\n");
  fprintf(stdout, "Hello stdout!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Hello stderr!\0A\00"
@stdout = global i32 0
@.str.1 = [15 x i8] c"Hello stdout!\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Hello stderr!\0A\00"
@stdout = global i32 0
@.str.1 = [15 x i8] c"Hello stdout!\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int strlen(char *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void sigint_handler(int sig) {
  write(STDOUT_FILENO, "\n", 1);
  write(STDOUT_FILENO, "nngsh-1.0$ ", strlen("nngsh-1.0$ "));
  return;
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%edx
lea    0xe99(%rip),%rsi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint_handler>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    (%rbx),%ebx
lea    0xebb(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [12 x i8] c"nngsh-1.0$ \00"
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = load i32, i32* @STDOUT_FILENO
%6 = call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @write(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [12 x i8] c"nngsh-1.0$ \00"
define void @sigint_handler(i32 %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @write(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = load i32, i32* @STDOUT_FILENO
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @write(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
int size_of_str() { return 8; }


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

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

LLVM IR (-O0):
define i32 @size_of_str() {
ret i32 8
}

LLVM IR (-O2):
define i32 @size_of_str() {
ret i32 8
}
unsigned char f55(unsigned char x, unsigned int y) {
  return (x << ((-y) & (8 - 1))) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f55>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x7,%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f55>:
mov    %esi,%ecx
neg    %cl
and    $0x7,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f55(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = sub i32 0, %7
%9 = and i32 %8, 7
%10 = shl i32 %6, %9
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = load i32, i32* %4
%14 = ashr i32 %12, %13
%15 = xor i32 %10, %14
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @f55(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = sub i32 0, %1
%5 = and i32 %4, 7
%6 = shl nuw nsw i32 %3, %5
%7 = lshr i32 %3, %1
%8 = xor i32 %6, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}
int is_surrogate_start(int val) { return ((0xD800 <= val) && (val <= 0xDBFF)); }


x86 assembly (clang, -O0):
<is_surrogate_start>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0xd800,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1127 <is_surrogate_start+0x27>
cmpl   $0xdbff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_surrogate_start>:
and    $0xfffffc00,%edi
xor    %eax,%eax
cmp    $0xd800,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_surrogate_start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 55296, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 56319
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_surrogate_start(i32 %0) {
%2 = and i32 %0, -1024
%3 = icmp eq i32 %2, 55296
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ handle_59(int /*<<< orphan*/);
int gen_59() { handle_59(0); }


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

x86 assembly (clang, -O2):
<gen_59>:
xor    %edi,%edi
jmp    1030 <handle_59@plt>

LLVM IR (-O0):
define i32 @gen_59() {
%1 = alloca i32
%2 = call i32 @handle_59(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_59() {
%1 = tail call i32 @handle_59(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char *, unsigned int);
void _assert(void *expr, void *filename, unsigned lineno) {
  printf("Assertion failed: %s, file %s, line %d\n", (char *)expr,
         (char *)filename, lineno);
  exit(3);
}


x86 assembly (clang, -O0):
<_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_assert>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Assertion failed: %s, file %s, line %d\0A\00"
define void @_assert(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
%11 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
@.str = [40 x i8] c"Assertion failed: %s, file %s, line %d\0A\00"
define void @_assert(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%5 = tail call i32 @exit(i32 3)
unreachable
}
int do_849() { return 849; }


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

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

LLVM IR (-O0):
define i32 @do_849() {
ret i32 849
}

LLVM IR (-O2):
define i32 @do_849() {
ret i32 849
}