xunge/DecIR huggingface dataset:
int Operand_br4_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~(0x3 << 2)) != 0;
  *valp = *valp >> 2;
  return error;
}


x86 assembly (clang, -O0):
<Operand_br4_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfffffff3,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shr    $0x2,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_br4_encode>:
mov    (%rdi),%ecx
xor    %eax,%eax
test   $0xfffffff3,%ecx
setne  %al
shr    $0x2,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define i32 @Operand_br4_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = and i32 %5, -13
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = lshr i32 %10, 2
%12 = load i32*, i32** %2
store i32 %11, i32* %12
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @Operand_br4_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, -13
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = lshr i32 %2, 2
store i32 %6, i32* %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int nextline(int num, int pos, int max) {
  int newpos = pos + num;
  if (newpos > max) {
    (void)putchar('\n');
    return num;
  }
  return newpos;
}


x86 assembly (clang, -O0):
<nextline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    114b <nextline+0x3b>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <nextline+0x41>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextline>:
mov    %esi,%eax
add    %edi,%eax
cmp    %edx,%eax
jle    1128 <nextline+0x18>
push   %rbx
mov    %edi,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nextline(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = load i32, i32* %7
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = call i32 @putchar(i8 signext 10)
%17 = load i32, i32* %5
store i32 %17, i32* %4
br label %20
18: ; preds = %3
%19 = load i32, i32* %8
store i32 %19, i32* %4
br label %20
20: ; preds = %18, %15
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @nextline(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = icmp sgt i32 %4, %2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @putchar(i8 signext 10)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %0, %6 ], [ %4, %3 ]
ret i32 %9
}
extern int g(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @g() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t ld_u16_be(const void *x) {
  return ((((uint16_t)(((uint8_t *)x)[0])) << 8) |
          ((uint16_t)(((uint8_t *)x)[1])));
}


x86 assembly (clang, -O0):
<ld_u16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_u16_be>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ld_u16_be(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = getelementptr inbounds i64, i64* %4, i64 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = bitcast i8* %9 to i64*
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @ld_u16_be(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = or i32 %5, %9
ret i32 %10
}
int sysrq_mask(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sysrq_mask() {
ret i32 0
}
void gtk_rc_reset_styles() {}


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

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

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

LLVM IR (-O2):
define void @gtk_rc_reset_styles() {
ret void
}
int test_imm_BEuint8_mem(unsigned char *val) {
  return ((*val) & (0xBE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BEuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 190
%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_BEuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -66
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
const char *librtaAbout_Name(void) { return "librta"; }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"librta\00"
define i8* @librtaAbout_Name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"librta\00"
define i8* @librtaAbout_Name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
unsigned xrop3_223_0_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;
  stk2 = D & T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_223_0_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    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_223_0_0>:
mov    %esi,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_223_0_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
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
ret i32 %30
}

LLVM IR (-O2):
define i32 @xrop3_223_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = xor i32 %4, -1
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ POSIX_FADV_SEQUENTIAL;
int /*<<< orphan*/ posix_fadvise(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
void sequential(int fd) { posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); }


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

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

LLVM IR (-O0):
@POSIX_FADV_SEQUENTIAL = global i32 0
define void @sequential(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @POSIX_FADV_SEQUENTIAL
%5 = call i32 @posix_fadvise(i32 %3, i32 0, i32 0, i32 %4)
ret void
}

LLVM IR (-O2):
@POSIX_FADV_SEQUENTIAL = global i32 0
define void @sequential(i32 %0) {
%2 = load i32, i32* @POSIX_FADV_SEQUENTIAL
%3 = tail call i32 @posix_fadvise(i32 %0, i32 0, i32 0, i32 %2)
ret void
}
void fa31(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        p012A:
          goto p012A;
          goto a;
        P012A:
          goto P012A;
          0;
      });
    a:
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa31>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa31+0x4>

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

LLVM IR (-O0):
define void @fa31() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa31() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void mask_signals(void) {
  sigset_t my_set;
  sigemptyset(&my_set);
  sigaddset(&my_set, SIGINT);
  sigaddset(&my_set, SIGALRM);
  sigprocmask(SIG_BLOCK, &my_set, NULL);
}


x86 assembly (clang, -O0):
<mask_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_signals>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@SIGALRM = global i32 0
@SIG_BLOCK = global i32 0
define void @mask_signals() {
%1 = alloca i32
%2 = call i32 @sigemptyset(i32* %1)
%3 = load i32, i32* @SIGINT
%4 = call i32 @sigaddset(i32* %1, i32 %3)
%5 = load i32, i32* @SIGALRM
%6 = call i32 @sigaddset(i32* %1, i32 %5)
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* %1, i32* null)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIGALRM = global i32 0
@SIG_BLOCK = global i32 0
define void @mask_signals() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SIGINT
%5 = call i32 @sigaddset(i32* %1, i32 %4)
%6 = load i32, i32* @SIGALRM
%7 = call i32 @sigaddset(i32* %1, i32 %6)
%8 = load i32, i32* @SIG_BLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %1, i32* null)
ret void
}
void foo609() {}


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

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

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

LLVM IR (-O2):
define void @foo609() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ nop();
void exit_at_end_of_proc_good() {
  nop();
  exit(5);
}


x86 assembly (clang, -O0):
<exit_at_end_of_proc_good>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <nop@plt>
mov    $0x5,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_at_end_of_proc_good>:
push   %rax
xor    %eax,%eax
call   1030 <nop@plt>
mov    $0x5,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @exit_at_end_of_proc_good() {
%1 = call i32 (...) @nop()
%2 = call i32 @exit(i32 5)
unreachable
}

LLVM IR (-O2):
define void @exit_at_end_of_proc_good() {
%1 = tail call i32 (...) @nop()
%2 = tail call i32 @exit(i32 5)
unreachable
}
/* Variables and functions */
int EOF;
int getch();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ ungetch(int);
int main(void) {
  int c;
  ungetch(EOF);
  while ((c = getch()) != EOF)
    putchar(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <ungetch@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%eax
je     1173 <main+0x43>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%edi
call   1040 <ungetch@plt>
nop
xor    %eax,%eax
call   1050 <getch@plt>
cmp    (%rbx),%eax
je     1154 <main+0x24>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @EOF
%4 = call i32 @ungetch(i32 %3)
br label %5
5: ; preds = %9, %0
%6 = call i32 (...) @getch()
store i32 %6, i32* %2
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %2
%11 = call i32 @putchar(i32 %10)
br label %5
12: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @ungetch(i32 %1)
%3 = tail call i32 (...) @getch()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %9, %6 ], [ %3, %0 ]
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 (...) @getch()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
int HTTPWrapperSSLConnect(int s, const struct sockaddr *name, int namelen,
                          char *hostname) {
  return -1;
}


x86 assembly (clang, -O0):
<HTTPWrapperSSLConnect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type opaque
define i32 @HTTPWrapperSSLConnect(i32 %0, %struct.sockaddr* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca %struct.sockaddr*
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store %struct.sockaddr* %1, %struct.sockaddr** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret i32 -1
}

LLVM IR (-O2):
%struct.sockaddr = type opaque
define i32 @HTTPWrapperSSLConnect(i32 %0, %struct.sockaddr* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Xhello() { printf("hello world\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define void @Xhello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define void @Xhello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(int);
char *find_next_whitespace(char *str) {
  if (str == NULL)
    return NULL;
  while (!isspace((int)*str))
    ++str;
  return str;
}


x86 assembly (clang, -O0):
<find_next_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <find_next_whitespace+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1173 <find_next_whitespace+0x63>
jmp    1139 <find_next_whitespace+0x29>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115a <find_next_whitespace+0x4a>
jmp    116b <find_next_whitespace+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1139 <find_next_whitespace+0x29>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_next_whitespace>:
push   %rbx
test   %rdi,%rdi
je     1133 <find_next_whitespace+0x23>
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   (%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %eax,%eax
je     1120 <find_next_whitespace+0x10>
jmp    1135 <find_next_whitespace+0x25>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @find_next_whitespace(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %9, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = tail call i32 @isspace(i32 %6)
%8 = icmp eq i32 %7, 0
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %3, label %10
10: ; preds = %3, %1
%11 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ pendfunc1(int);
int /*<<< orphan*/ pendfunc2(int);
void pendfunc(int x) {
  pendfunc1(x);
  pendfunc2(x);
}


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

x86 assembly (clang, -O2):
<pendfunc>:
push   %rbx
mov    %edi,%ebx
call   1040 <pendfunc1@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <pendfunc2@plt>

LLVM IR (-O0):
define void @pendfunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @pendfunc1(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @pendfunc2(i32 %5)
ret void
}

LLVM IR (-O2):
define void @pendfunc(i32 %0) {
%2 = tail call i32 @pendfunc1(i32 %0)
%3 = tail call i32 @pendfunc2(i32 %0)
ret void
}
/* Variables and functions */
int bit_get(unsigned int, int /*<<< orphan*/);
int bits_ror(unsigned int x) {
  int rightmost = bit_get(x, 0);
  int res = x >> 1;
  if (rightmost == 1) {
    res = res | (1 << (sizeof(int) * 8 - 1));
  }
  return res;
}


x86 assembly (clang, -O0):
<bits_ror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <bit_get@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1146 <bits_ror+0x36>
mov    -0xc(%rbp),%eax
or     $0x80000000,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_ror>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1030 <bit_get@plt>
shr    %ebx
lea    -0x80000000(%rbx),%ecx
cmp    $0x1,%eax
cmovne %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bits_ror(i32 %0) {
%2 = tail call i32 @bit_get(i32 %0, i32 0)
%3 = lshr i32 %0, 1
%4 = icmp eq i32 %2, 1
%5 = or i32 %3, -2147483648
%6 = select i1 %4, i32 %5, i32 %3
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t z80_cb_d0_set_2(uint8_t value) { return value | 0x04; }


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

x86 assembly (clang, -O2):
<z80_cb_d0_set_2>:
mov    %edi,%eax
or     $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @z80_cb_d0_set_2(i32 %0) {
%2 = or i32 %0, 4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void BorrarPantalla(void) {
  system("clear");
  return;
}


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

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

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

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

/* Variables and functions */
int waddch(WINDOW *w, const chtype t) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @waddch(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
size_t utf8_chrw(char const *);
size_t utf8_stro(const char str[]) {
  size_t overhead = 0;
  while (*str != '\0') {
    size_t char_width = utf8_chrw(str);
    str += char_width;
    overhead += char_width - 1;
  }
  return overhead;
}


x86 assembly (clang, -O0):
<utf8_stro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <utf8_stro+0x52>
mov    -0x8(%rbp),%rdi
call   1030 <utf8_chrw@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <utf8_stro+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_stro>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1139 <utf8_stro+0x29>
mov    %rdi,%rbx
xor    %r14d,%r14d
nop
mov    %rbx,%rdi
call   1030 <utf8_chrw@plt>
cmpb   $0x0,(%rbx,%rax,1)
lea    (%rbx,%rax,1),%rbx
lea    -0x1(%r14,%rax,1),%r14
jne    1120 <utf8_stro+0x10>
jmp    113c <utf8_stro+0x2c>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @utf8_stro(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %8, %4 ], [ %0, %1 ]
%6 = phi i64 [ %10, %4 ], [ 0, %1 ]
%7 = tail call i64 @utf8_chrw(i8* %5)
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = add i64 %6, -1
%10 = add i64 %9, %7
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned long);
void _delay_ms(unsigned long delay) { usleep(delay * 1000); }


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

x86 assembly (clang, -O2):
<_delay_ms>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @_delay_ms(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000
%5 = call i32 @usleep(i64 %4)
ret void
}

LLVM IR (-O2):
define void @_delay_ms(i64 %0) {
%2 = mul i64 %0, 1000
%3 = tail call i32 @usleep(i64 %2)
ret void
}
unsigned f(unsigned flags, unsigned capabilities) {
  unsigned gfp_mask;
  unsigned gfp_notmask = 0;
  gfp_mask = flags & ((1 << 25) - 1);
  if (!(capabilities & 0x00000001))
    gfp_mask |= 0x1000000u;
  return (gfp_mask & ~gfp_notmask);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1ffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1136 <f+0x36>
mov    -0xc(%rbp),%eax
or     $0x1000000,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %esi,%eax
and    $0x1ffffff,%edi
shl    $0x18,%eax
not    %eax
and    $0x1000000,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @f(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
store i32 0, i32* %6
%7 = load i32, i32* %3
%8 = and i32 %7, 33554431
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i32, i32* %5
%14 = or i32 %13, 16777216
store i32 %14, i32* %5
br label %15
15: ; preds = %12, %2
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = xor i32 %17, -1
%19 = and i32 %16, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = and i32 %0, 33554431
%4 = shl i32 %1, 24
%5 = and i32 %4, 16777216
%6 = xor i32 %5, 16777216
%7 = or i32 %6, %3
ret i32 %7
}
/* Variables and functions */
char *dec_to_unsigned(char const *, unsigned long *);
char *dec_to_uint(const char *str, unsigned int *out) {
  unsigned long v;
  char *cur = dec_to_unsigned(str, &v);
  if (cur != str) {
    *out = (unsigned int)v;
  }
  return cur;
}


x86 assembly (clang, -O0):
<dec_to_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <dec_to_unsigned@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     114b <dec_to_uint+0x3b>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_to_uint>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1030 <dec_to_unsigned@plt>
cmp    %rbx,%rax
je     112d <dec_to_uint+0x1d>
mov    (%rsp),%ecx
mov    %ecx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @dec_to_uint(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i8* @dec_to_unsigned(i8* %0, i64* %3)
%6 = icmp eq i8* %5, %0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %2
ret i8* %5
}
int centsFromCents(int cents) { return cents % 100; }


x86 assembly (clang, -O0):
<centsFromCents>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<centsFromCents>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @centsFromCents(i32 %0) {
%2 = srem i32 %0, 100
ret i32 %2
}
float convert_temp_c2f(float c) { return (c * (9.0 / 5.0) + 32.0); }


x86 assembly (clang, -O0):
<convert_temp_c2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_temp_c2f>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @convert_temp_c2f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @llvm.fmuladd.f64(double %4, double 1.800000e+00, double 3.200000e+01)
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @convert_temp_c2f(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.200000e+01)
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
scalar_t__ exp(double);
float mbExp(int x) { return (float)exp(0.00230258509299 * x); }


x86 assembly (clang, -O0):
<mbExp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xed8(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbExp>:
push   %rax
cvtsi2sd %edi,%xmm0
mulsd  0xee3(%rip),%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mbExp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double 0x3F62DCDEF575F53F, %4
%6 = call i64 @exp(double %5)
%7 = sitofp i64 %6 to float
ret float %7
}

LLVM IR (-O2):
define float @mbExp(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x3F62DCDEF575F53F
%4 = tail call i64 @exp(double %3)
%5 = sitofp i64 %4 to float
ret float %5
}
/* Type definitions */
typedef union vec3 {
  int dummy;
} vec3;

/* Variables and functions */
int /*<<< orphan*/ vec3_copy(union vec3 *, union vec3 *);
union vec3 *vec3_rot_axis_self(union vec3 *, float, float, float, float);
union vec3 *vec3_rot_axis(union vec3 *vo, union vec3 *vi, float x, float y,
                          float z, float angle) {
  vec3_copy(vo, vi);
  return vec3_rot_axis_self(vo, x, y, z, angle);
}


x86 assembly (clang, -O0):
<vec3_rot_axis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
movss  %xmm3,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <vec3_copy@plt>
mov    -0x8(%rbp),%rdi
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm3
call   1030 <vec3_rot_axis_self@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_rot_axis>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm3,0xc(%rsp)
movss  %xmm2,0x8(%rsp)
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
mov    %rdi,%rbx
call   1040 <vec3_copy@plt>
mov    %rbx,%rdi
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
movss  0x8(%rsp),%xmm2
movss  0xc(%rsp),%xmm3
add    $0x10,%rsp
pop    %rbx
jmp    1030 <vec3_rot_axis_self@plt>

LLVM IR (-O0):
%union.vec3 = type { i32 }
define %union.vec3* @vec3_rot_axis(%union.vec3* %0, %union.vec3* %1, float %2, float %3, float %4, float %5) {
%7 = alloca %union.vec3*
%8 = alloca %union.vec3*
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store %union.vec3* %0, %union.vec3** %7
store %union.vec3* %1, %union.vec3** %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load %union.vec3*, %union.vec3** %7
%14 = load %union.vec3*, %union.vec3** %8
%15 = call i32 @vec3_copy(%union.vec3* %13, %union.vec3* %14)
%16 = load %union.vec3*, %union.vec3** %7
%17 = load float, float* %9
%18 = load float, float* %10
%19 = load float, float* %11
%20 = load float, float* %12
%21 = call %union.vec3* @vec3_rot_axis_self(%union.vec3* %16, float %17, float %18, float %19, float %20)
ret %union.vec3* %21
}

LLVM IR (-O2):
%union.vec3 = type { i32 }
define %union.vec3* @vec3_rot_axis(%union.vec3* %0, %union.vec3* %1, float %2, float %3, float %4, float %5) {
%7 = tail call i32 @vec3_copy(%union.vec3* %0, %union.vec3* %1)
%8 = tail call %union.vec3* @vec3_rot_axis_self(%union.vec3* %0, float %2, float %3, float %4, float %5)
ret %union.vec3* %8
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, ...);
main() {
  printf("Typing in a character should result in a 1, immediatly doing a "
         "CTRL+D should result in 0\n");
  printf("%d\n", (getchar() != EOF));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e9d(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [90 x i8] c"Typing in a character should result in a 1, immediatly doing a CTRL+D should result in 0\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0))
%2 = call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
@str = [89 x i8] c"Typing in a character should result in a 1, immediatly doing a CTRL+D should result in 0\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([89 x i8], [89 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int do_954() { return 954; }


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

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

LLVM IR (-O0):
define i32 @do_954() {
ret i32 954
}

LLVM IR (-O2):
define i32 @do_954() {
ret i32 954
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpgt_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_cmpgt_pi16(__m64 a, __m64 b) { return _mm_cmpgt_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_cmpgt_pi16>:
jmp    1030 <_mm_cmpgt_pi16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpgt_pi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpgt_pi16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ to_gps(int, int);
void test_control(int data) { to_gps(0x7c, data); }


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

x86 assembly (clang, -O2):
<test_control>:
mov    %edi,%esi
mov    $0x7c,%edi
jmp    1030 <to_gps@plt>

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

LLVM IR (-O2):
define void @test_control(i32 %0) {
%2 = tail call i32 @to_gps(i32 124, i32 %0)
ret void
}
int test_imm_8Fuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x8F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Fuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 143
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int strcmp(char *, char *);
int str_compare(char *str1, char *str2) {
  int c = strcmp(str1, str2);
  return (c);
}


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

x86 assembly (clang, -O2):
<str_compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @str_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void gtk_im_context_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_im_context_get_type() {
ret void
}
unsigned char __atomic_fetch_or_1(volatile void *atom, unsigned char value,
                                  int memorder) {
  unsigned char xchg;
  unsigned char cmp;
  __atomic_load((unsigned char *)atom, (unsigned char *)&cmp, 0);
  do {
    xchg = ((cmp | value));
  } while (
      !__atomic_compare_exchange((unsigned char *)atom, &cmp, &xchg, 1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_fetch_or_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x12(%rbp),%al
mov    -0x11(%rbp),%dl
lock cmpxchg %dl,(%rcx)
mov    %al,%cl
sete   %al
mov    %al,-0x15(%rbp)
mov    %cl,-0x14(%rbp)
test   $0x1,%al
jne    114e <__atomic_fetch_or_1+0x4e>
mov    -0x14(%rbp),%al
mov    %al,-0x12(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    111a <__atomic_fetch_or_1+0x1a>
movzbl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_fetch_or_1>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
mov    %eax,%edx
or     %sil,%dl
lock cmpxchg %dl,(%rdi)
jne    1110 <__atomic_fetch_or_1+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @__atomic_fetch_or_1(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = load atomic i8, i8* %10 monotonic
store i8 %11, i8* %8
br label %12
12: ; preds = %27, %3
%13 = load i8, i8* %8
%14 = zext i8 %13 to i32
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
br label %19
19: ; preds = %12
%20 = load i8*, i8** %4
%21 = load i8, i8* %8
%22 = load i8, i8* %7
%23 = cmpxchg weak i8* %20, i8 %21, i8 %22 seq_cst seq_cst
%24 = extractvalue { i8, i1 } %23, 0
%25 = extractvalue { i8, i1 } %23, 1
br i1 %25, label %27, label %26
26: ; preds = %19
store i8 %24, i8* %8
br label %27
27: ; preds = %26, %19
%28 = zext i1 %25 to i8
store i8 %28, i8* %9
%29 = load i8, i8* %9
%30 = trunc i8 %29 to i1
%31 = xor i1 %30, true
br i1 %31, label %12, label %32
32: ; preds = %27
%33 = load i8, i8* %8
ret i8 %33
}

LLVM IR (-O2):
define zeroext i8 @__atomic_fetch_or_1(i8* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = load atomic i8, i8* %0 monotonic
br label %5
5: ; preds = %5, %3
%6 = phi i8 [ %4, %3 ], [ %10, %5 ]
%7 = or i8 %6, %1
%8 = cmpxchg weak i8* %0, i8 %6, i8 %7 seq_cst seq_cst
%9 = extractvalue { i8, i1 } %8, 1
%10 = extractvalue { i8, i1 } %8, 0
br i1 %9, label %11, label %5
11: ; preds = %5
ret i8 %6
}
int FUSING() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @FUSING() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read_array(char *, int /*<<< orphan*/ *);
void *failed_open(void *args) {
  read_array("invalid_file_name", NULL);
  return (NULL);
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"invalid_file_name\00"
define i8* @failed_open(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @read_array(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* null)
ret i8* null
}

LLVM IR (-O2):
@.str = [18 x i8] c"invalid_file_name\00"
define noalias i8* @failed_open(i8* nocapture readnone %0) {
%2 = tail call i32 @read_array(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* null)
ret i8* null
}