xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sys_print(char *);
int main(void) {
  unsigned int i;
  while (1) {
    sys_print("Hello, I'm dummy1!\n");
    for (i = 0; i < 9999999; i++)
      ;
  }
  return 4;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <sys_print@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x98967f,-0x8(%rbp)
jae    1152 <main+0x42>
jmp    1144 <main+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <main+0x22>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <sys_print@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [20 x i8] c"Hello, I'm dummy1!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %12
%4 = call i32 @sys_print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %5
5: ; preds = %9, %3
%6 = load i32, i32* %2
%7 = icmp ult i32 %6, 9999999
br i1 %7, label %8, label %12
8: ; preds = %5
br label %9
9: ; preds = %8
%10 = load i32, i32* %2
%11 = add i32 %10, 1
store i32 %11, i32* %2
br label %5
12: ; preds = %5
br label %3
}

LLVM IR (-O2):
@.str = [20 x i8] c"Hello, I'm dummy1!\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @sys_print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %1
}
void fn1(void) {}


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

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

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

LLVM IR (-O2):
define void @fn1() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void SHAMD5DMAEnable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000110))) |=
      0x00000080 | 0x00000008;
}


x86 assembly (clang, -O0):
<SHAMD5DMAEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x110(%rax),%rcx
or     $0x88,%rcx
mov    %rcx,0x110(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAMD5DMAEnable>:
orq    $0x88,0x110(%rdi)
ret

LLVM IR (-O0):
define void @SHAMD5DMAEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 272
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 136
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @SHAMD5DMAEnable(i64 %0) {
%2 = add nsw i64 %0, 272
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 136
store volatile i64 %5, i64* %3
ret void
}
void RAWToRGBARow_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @RAWToRGBARow_Any_SSSE3() {
ret void
}
/* Variables and functions */
bool numeric(const char c) {
  if (c >= '0' && c <= '9')
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <numeric+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <numeric+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <numeric+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeric>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @numeric(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int GLUT_LEFT;
int glutGetWindow();
int /*<<< orphan*/ printf(char *, int, char *);
void enter_leave(int state) {
  printf("enter/leave %d = %s\n", glutGetWindow(),
         state == GLUT_LEFT ? "left" : "entered");
}


x86 assembly (clang, -O0):
<enter_leave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <glutGetWindow@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%ecx
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rdx
lea    0xec7(%rip),%rax
cmp    %edi,%ecx
cmove  %rax,%rdx
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enter_leave>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <glutGetWindow@plt>
mov    0x2eaf(%rip),%rcx
cmp    %ebx,(%rcx)
lea    0xedb(%rip),%rcx
lea    0xed9(%rip),%rdx
cmove  %rcx,%rdx
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"enter/leave %d = %s\0A\00"
@GLUT_LEFT = global i32 0
@.str.1 = [5 x i8] c"left\00"
@.str.2 = [8 x i8] c"entered\00"
define void @enter_leave(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @glutGetWindow()
%4 = load i32, i32* %2
%5 = load i32, i32* @GLUT_LEFT
%6 = icmp eq i32 %4, %5
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"enter/leave %d = %s\0A\00"
@GLUT_LEFT = global i32 0
@.str.1 = [5 x i8] c"left\00"
@.str.2 = [8 x i8] c"entered\00"
define void @enter_leave(i32 %0) {
%2 = tail call i32 (...) @glutGetWindow()
%3 = load i32, i32* @GLUT_LEFT
%4 = icmp eq i32 %3, %0
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %5)
ret void
}
const char *getopt_progname(int argc, char *const argv[],
                            struct u_getopt_r *K) {
  (void)K;
  return (argc > 0 && argv[0]) ? argv[0] : "";
}


x86 assembly (clang, -O0):
<getopt_progname>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1137 <getopt_progname+0x37>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1137 <getopt_progname+0x37>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1147 <getopt_progname+0x47>
lea    0xec2(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1147 <getopt_progname+0x47>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_progname>:
test   %edi,%edi
jle    1116 <getopt_progname+0x16>
mov    (%rsi),%rcx
test   %rcx,%rcx
lea    0xeef(%rip),%rax
cmovne %rcx,%rax
ret
lea    0xee3(%rip),%rax
ret

LLVM IR (-O0):
%struct.u_getopt_r = type opaque
@.str = [1 x i8] zeroinitializer
define i8* @getopt_progname(i32 %0, i8** %1, %struct.u_getopt_r* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.u_getopt_r*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.u_getopt_r* %2, %struct.u_getopt_r** %6
%7 = load %struct.u_getopt_r*, %struct.u_getopt_r** %6
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %3
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
br label %20
19: ; preds = %10, %3
br label %20
20: ; preds = %19, %15
%21 = phi i8* [ %18, %15 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %19 ]
ret i8* %21
}

LLVM IR (-O2):
%struct.u_getopt_r = type opaque
@.str = [1 x i8] zeroinitializer
define i8* @getopt_progname(i32 %0, i8** nocapture %1, %struct.u_getopt_r* nocapture readnone %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = load i8*, i8** %1
%7 = icmp eq i8* %6, null
%8 = select i1 %7, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %6
br label %9
9: ; preds = %5, %3
%10 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %3 ], [ %8, %5 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ __assert_fail();
int main() {
  int x = 0, y = 0;
  while (1) {
    x++;
    y++;
    if (x != y) {
      __assert_fail();
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     115d <main+0x4d>
mov    $0x0,%al
call   1030 <__assert_fail@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    112d <main+0x1d>

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

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(int status) {
  fprintf(stderr, "usage: dnspoof redirectDomain orignalResquetedDomain\n");
  exit(status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"usage: dnspoof redirectDomain orignalResquetedDomain\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"usage: dnspoof redirectDomain orignalResquetedDomain\0A\00"
define void @usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ debugPrintStr(char *, char *);
void emailsUnreadRecvd(char *line) {
  debugPrintStr("command parser: emailsUnreadRecvd: ", line);
}


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

x86 assembly (clang, -O2):
<emailsUnreadRecvd>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <debugPrintStr@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"command parser: emailsUnreadRecvd: \00"
define void @emailsUnreadRecvd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @debugPrintStr(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"command parser: emailsUnreadRecvd: \00"
define void @emailsUnreadRecvd(i8* %0) {
%2 = tail call i32 @debugPrintStr(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void setup_signal_handler() {}


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

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

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

LLVM IR (-O2):
define void @setup_signal_handler() {
ret void
}
int gcm(int a, int b) {
  if (a < 0) {
    return gcm(-a, b);
  } else if (b < 0) {
    return gcm(a, -b);
  } else if (b > 0) {
    return gcm(b, a % b);
  } else {
    return a;
  }
}


x86 assembly (clang, -O0):
<gcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    113d <gcm+0x2d>
xor    %edi,%edi
sub    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <gcm@plt>
mov    %eax,-0x4(%rbp)
jmp    1185 <gcm+0x75>
cmpl   $0x0,-0xc(%rbp)
jge    115c <gcm+0x4c>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
sub    -0xc(%rbp),%esi
call   1030 <gcm@plt>
mov    %eax,-0x4(%rbp)
jmp    1185 <gcm+0x75>
cmpl   $0x0,-0xc(%rbp)
jle    117f <gcm+0x6f>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcm@plt>
mov    %eax,-0x4(%rbp)
jmp    1185 <gcm+0x75>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcm>:
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
test   %eax,%eax
jns    1130 <gcm+0x30>
cs nopw 0x0(%rax,%rax,1)
neg    %eax
test   %eax,%eax
js     1120 <gcm+0x20>
cs nopw 0x0(%rax,%rax,1)
mov    %edx,%edi
neg    %edx
test   %edi,%edi
js     1130 <gcm+0x30>
je     1140 <gcm+0x40>
xor    %edx,%edx
div    %edi
jmp    1110 <gcm+0x10>
ret

LLVM IR (-O0):
define i32 @gcm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = sub nsw i32 0, %9
%11 = load i32, i32* %5
%12 = call i32 @gcm(i32 %10, i32 %11)
store i32 %12, i32* %3
br label %32
13: ; preds = %2
%14 = load i32, i32* %5
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = sub nsw i32 0, %18
%20 = call i32 @gcm(i32 %17, i32 %19)
store i32 %20, i32* %3
br label %32
21: ; preds = %13
%22 = load i32, i32* %5
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = load i32, i32* %5
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = srem i32 %26, %27
%29 = call i32 @gcm(i32 %25, i32 %28)
store i32 %29, i32* %3
br label %32
30: ; preds = %21
%31 = load i32, i32* %4
store i32 %31, i32* %3
br label %32
32: ; preds = %30, %24, %16, %8
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @gcm(i32 %0, i32 %1) {
br label %3
3: ; preds = %17, %2
%4 = phi i32 [ %12, %17 ], [ %0, %2 ]
%5 = phi i32 [ %18, %17 ], [ %1, %2 ]
br label %6
6: ; preds = %3, %9
%7 = phi i32 [ %10, %9 ], [ %4, %3 ]
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = sub nsw i32 0, %7
br label %6
11: ; preds = %6, %11
%12 = phi i32 [ %14, %11 ], [ %5, %6 ]
%13 = icmp slt i32 %12, 0
%14 = sub nsw i32 0, %12
br i1 %13, label %11, label %15
15: ; preds = %11
%16 = icmp eq i32 %12, 0
br i1 %16, label %19, label %17
17: ; preds = %15
%18 = urem i32 %7, %12
br label %3
19: ; preds = %15
ret i32 %7
}
/* Variables and functions */
unsigned long syscall(int, unsigned long);
void *sbrk(intptr_t inc) {
  unsigned long cur = syscall(12, 0);
  if (inc && syscall(12, cur + inc) != cur + inc)
    return (void *)-1;
  return (void *)cur;
}


x86 assembly (clang, -O0):
<sbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0xc,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <syscall@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116c <sbrk+0x5c>
mov    -0x18(%rbp),%rsi
add    -0x10(%rbp),%rsi
mov    $0xc,%edi
call   1030 <syscall@plt>
mov    -0x18(%rbp),%rcx
add    -0x10(%rbp),%rcx
cmp    %rcx,%rax
je     116c <sbrk+0x5c>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <sbrk+0x64>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbrk>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xc,%edi
xor    %esi,%esi
call   1030 <syscall@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     114a <sbrk+0x3a>
add    %r14,%rbx
mov    $0xc,%edi
mov    %rbx,%rsi
call   1030 <syscall@plt>
mov    %rax,%rcx
mov    $0xffffffffffffffff,%rax
cmp    %rbx,%rcx
jne    114d <sbrk+0x3d>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @sbrk(i64 %0) {
%2 = tail call i64 @syscall(i32 12, i64 0)
%3 = icmp eq i64 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = add i64 %2, %0
%6 = tail call i64 @syscall(i32 12, i64 %5)
%7 = icmp eq i64 %6, %5
br i1 %7, label %8, label %10
8: ; preds = %4, %1
%9 = inttoptr i64 %2 to i8*
br label %10
10: ; preds = %4, %8
%11 = phi i8* [ %9, %8 ], [ inttoptr (i64 -1 to i8*), %4 ]
ret i8* %11
}
void O1(char *tacIr) {}


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

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

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

LLVM IR (-O2):
define void @O1(i8* nocapture %0) {
ret void
}
unsigned int max(unsigned int a, unsigned int b) { return (a > b) ? a : b; }


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

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

LLVM IR (-O0):
define i32 @max(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 = icmp ugt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ sleep(int);
void *sub_thread_void() {
  char sub_buf[1024] = {0x00};
  pthread_t tid = pthread_self();
  ;
  sleep(1);
  ;
  return NULL;
}


x86 assembly (clang, -O0):
<sub_thread_void>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x400(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,-0x404(%rbp)
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_thread_void>:
push   %rax
xor    %eax,%eax
call   1030 <pthread_self@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @sub_thread_void() {
%1 = alloca [1024 x i8]
%2 = alloca i32
%3 = bitcast [1024 x i8]* %1 to i8*
%4 = call i32 (...) @pthread_self()
store i32 %4, i32* %2
%5 = call i32 @sleep(i32 1)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @sub_thread_void() {
%1 = tail call i32 (...) @pthread_self()
%2 = tail call i32 @sleep(i32 1)
ret i8* null
}
int fun389() { return 389; }


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

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

LLVM IR (-O0):
define i32 @fun389() {
ret i32 389
}

LLVM IR (-O2):
define i32 @fun389() {
ret i32 389
}
/* Variables and functions */
double nextafter(double, double);
double c_nextafter(int argc, void *argv[]) {
  return nextafter(*(double *)argv[0], *(double *)argv[1]);
}


x86 assembly (clang, -O0):
<c_nextafter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsd  (%rax),%xmm1
call   1030 <nextafter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_nextafter>:
mov    (%rsi),%rax
mov    0x8(%rsi),%rcx
movsd  (%rax),%xmm0
movsd  (%rcx),%xmm1
jmp    1030 <nextafter@plt>

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

LLVM IR (-O2):
define double @c_nextafter(i32 %0, i8** nocapture %1) {
%3 = bitcast i8** %1 to double**
%4 = load double*, double** %3
%5 = load double, double* %4
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = bitcast i8** %6 to double**
%8 = load double*, double** %7
%9 = load double, double* %8
%10 = tail call double @nextafter(double %5, double %9)
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int int8_t;

/* Variables and functions */
scalar_t__ hd44780_ll_register_write(int /*<<< orphan*/, int /*<<< orphan*/);
int8_t hd44780_ll_instruction_write(uint8_t instruction) {
  if (hd44780_ll_register_write(instruction, 0)) {
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<hd44780_ll_instruction_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <hd44780_ll_register_write@plt>
cmp    $0x0,%rax
je     113b <hd44780_ll_instruction_write+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1142 <hd44780_ll_instruction_write+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd44780_ll_instruction_write>:
push   %rax
xor    %esi,%esi
call   1030 <hd44780_ll_register_write@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hd44780_ll_instruction_write(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @hd44780_ll_register_write(i32 %4, i32 0)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @hd44780_ll_instruction_write(i32 %0) {
%2 = tail call i64 @hd44780_ll_register_write(i32 %0, i32 0)
%3 = icmp ne i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
void reverseStr(char *s, int start, int last) {
  char t;
  while (start < last) {
    t = s[start];
    s[start] = s[last];
    s[last] = t;
    start++;
    last--;
  }
}


x86 assembly (clang, -O0):
<reverseStr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1163 <reverseStr+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    110e <reverseStr+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseStr>:
cmp    %edx,%esi
jge    1131 <reverseStr+0x31>
movslq %esi,%rax
movslq %edx,%rcx
add    $0x1,%rax
xchg   %ax,%ax
movzbl -0x1(%rdi,%rax,1),%esi
movzbl (%rdi,%rcx,1),%edx
mov    %dl,-0x1(%rdi,%rax,1)
mov    %sil,(%rdi,%rcx,1)
add    $0xffffffffffffffff,%rcx
lea    0x1(%rax),%rdx
cmp    %rcx,%rax
mov    %rdx,%rax
jl     1110 <reverseStr+0x10>
ret

LLVM IR (-O0):
define void @reverseStr(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %8
8: ; preds = %12, %3
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %36
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
store i8 %17, i8* %7
%18 = load i8*, i8** %4
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = load i8*, i8** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
%27 = load i8, i8* %7
%28 = load i8*, i8** %4
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
store i8 %27, i8* %31
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
%34 = load i32, i32* %6
%35 = add nsw i32 %34, -1
store i32 %35, i32* %6
br label %8
36: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @reverseStr(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %16, %8 ]
%10 = phi i64 [ %6, %5 ], [ %15, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %9
%14 = load i8, i8* %13
store i8 %14, i8* %11
store i8 %12, i8* %13
%15 = add nsw i64 %10, 1
%16 = add nsw i64 %9, -1
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void print_string(char *s) {
  while (*s != '\0') {
    printf("%d\n", *s++);
  }
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114f <print_string+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    111c <print_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <print_string+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <print_string+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ init1();
int main() {
  init();
  init1();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <init1@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @init()
%2 = call i32 (...) @init1()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @init1()
ret i32 0
}
int stun_msg2class(int msg) {
  return ((msg & 0x0010) >> 4) | ((msg & 0x0100) >> 7);
}


x86 assembly (clang, -O0):
<stun_msg2class>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x10,%eax
sar    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0x100,%ecx
sar    $0x7,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stun_msg2class>:
mov    %edi,%eax
shr    $0x4,%eax
and    $0x1,%eax
shr    $0x7,%edi
and    $0x2,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @stun_msg2class(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16
%5 = ashr i32 %4, 4
%6 = load i32, i32* %2
%7 = and i32 %6, 256
%8 = ashr i32 %7, 7
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @stun_msg2class(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 1
%4 = lshr i32 %0, 7
%5 = and i32 %4, 2
%6 = or i32 %3, %5
ret i32 %6
}
unsigned xrop3_84_0_1(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 = T | S;
  stk2 = ~stk2;
  stk1 = D | stk2;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

x86 assembly (clang, -O2):
<xrop3_84_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
not    %edi
and    %esi,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_84_0_1(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* %7
%23 = load i32, i32* %6
%24 = or 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* %5
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = or i32 %34, %38
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = xor i32 %41, -1
%43 = and i32 %40, %42
%44 = load i32, i32* %5
%45 = and i32 %43, %44
%46 = or i32 %39, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_84_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = xor i32 %3, -1
%7 = and i32 %6, %5
%8 = or i32 %4, %7
ret i32 %8
}
int is_ccn_blob(int tag) { return tag == 5 || tag == 6; }


x86 assembly (clang, -O0):
<is_ccn_blob>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x5,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <is_ccn_blob+0x20>
cmpl   $0x6,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ccn_blob>:
add    $0xfffffffb,%edi
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_ccn_blob(i32 %0) {
%2 = add i32 %0, -5
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
int stkop_default_fini(struct scan_stk *s) { return 0; }


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

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

LLVM IR (-O0):
%struct.scan_stk = type opaque
define i32 @stkop_default_fini(%struct.scan_stk* %0) {
%2 = alloca %struct.scan_stk*
store %struct.scan_stk* %0, %struct.scan_stk** %2
ret i32 0
}

LLVM IR (-O2):
%struct.scan_stk = type opaque
define i32 @stkop_default_fini(%struct.scan_stk* nocapture readnone %0) {
ret i32 0
}
void intr_disable(void) { __asm__ volatile("cli"); }


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

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

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

LLVM IR (-O2):
define void @intr_disable() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: turnin [-h|--help] [-V|--version] assignment@class "
                  "file1 [file2 [...]]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
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 = [79 x i8] c"Usage: turnin [-h|--help] [-V|--version] assignment@class file1 [file2 [...]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [79 x i8] c"Usage: turnin [-h|--help] [-V|--version] assignment@class file1 [file2 [...]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_77int64_midword_reg(long long val) {
  return ((val >> 16) & (0x77 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_77int64_midword_reg(i64 %0) {
%2 = and i64 %0, 7798784
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *, float *, float *);
int main() {
  float x, y, z, media;
  scanf("%f%f%f", &x, &y, &z);
  media = (x + y + z) / 3;
  printf("O valor calculado foi: %f\n", media);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  0xea2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
divss  0xea7(%rip),%xmm0
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%f%f%f\00"
@.str.1 = [27 x i8] c"O valor calculado foi: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float* %2, float* %3, float* %4)
%7 = load float, float* %2
%8 = load float, float* %3
%9 = fadd float %7, %8
%10 = load float, float* %4
%11 = fadd float %9, %10
%12 = fdiv float %11, 3.000000e+00
store float %12, float* %5
%13 = load float, float* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), float %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%f%f%f\00"
@.str.1 = [27 x i8] c"O valor calculado foi: %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3)
%8 = load float, float* %1
%9 = load float, float* %2
%10 = fadd float %8, %9
%11 = load float, float* %3
%12 = fadd float %10, %11
%13 = fdiv float %12, 3.000000e+00
%14 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), float %13)
ret i32 0
}
void XtVaGetApplicationResources() {}


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

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

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

LLVM IR (-O2):
define void @XtVaGetApplicationResources() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_string_and_free(char *);
char *gp_strdup(char const *);
void do_string(const char *s) {
  char *cmdline = gp_strdup(s);
  do_string_and_free(cmdline);
}


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

x86 assembly (clang, -O2):
<do_string>:
push   %rax
call   1030 <gp_strdup@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <do_string_and_free@plt>

LLVM IR (-O0):
define void @do_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @gp_strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @do_string_and_free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @do_string(i8* %0) {
%2 = tail call i8* @gp_strdup(i8* %0)
%3 = tail call i32 @do_string_and_free(i8* %2)
ret void
}
/* Variables and functions */
int gr_measureEx(char const *, int /*<<< orphan*/ *);
int gr_measure(const char *s) { return gr_measureEx(s, NULL); }


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

x86 assembly (clang, -O2):
<gr_measure>:
xor    %esi,%esi
jmp    1030 <gr_measureEx@plt>

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

LLVM IR (-O2):
define i32 @gr_measure(i8* %0) {
%2 = tail call i32 @gr_measureEx(i8* %0, i32* null)
ret i32 %2
}
int srslte_cqi_hl_get_subband_size(int nof_prb) {
  if (nof_prb < 7) {
    return 0;
  } else if (nof_prb <= 26) {
    return 4;
  } else if (nof_prb <= 63) {
    return 6;
  } else if (nof_prb <= 110) {
    return 8;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<srslte_cqi_hl_get_subband_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jge    111d <srslte_cqi_hl_get_subband_size+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1166 <srslte_cqi_hl_get_subband_size+0x66>
cmpl   $0x1a,-0x8(%rbp)
jg     1133 <srslte_cqi_hl_get_subband_size+0x33>
movl   $0x4,-0x4(%rbp)
jmp    1166 <srslte_cqi_hl_get_subband_size+0x66>
cmpl   $0x3f,-0x8(%rbp)
jg     1149 <srslte_cqi_hl_get_subband_size+0x49>
movl   $0x6,-0x4(%rbp)
jmp    1166 <srslte_cqi_hl_get_subband_size+0x66>
cmpl   $0x6e,-0x8(%rbp)
jg     115f <srslte_cqi_hl_get_subband_size+0x5f>
movl   $0x8,-0x4(%rbp)
jmp    1166 <srslte_cqi_hl_get_subband_size+0x66>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<srslte_cqi_hl_get_subband_size>:
xor    %eax,%eax
cmp    $0x7,%edi
jl     1129 <srslte_cqi_hl_get_subband_size+0x29>
mov    $0x4,%eax
cmp    $0x1b,%edi
jb     1129 <srslte_cqi_hl_get_subband_size+0x29>
mov    $0x6,%eax
cmp    $0x40,%edi
jb     1129 <srslte_cqi_hl_get_subband_size+0x29>
xor    %eax,%eax
cmp    $0x6f,%edi
setb   %al
lea    (%rax,%rax,8),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @srslte_cqi_hl_get_subband_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 7
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %20
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 26
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 4, i32* %2
br label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 63
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 6, i32* %2
br label %20
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 110
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 8, i32* %2
br label %20
19: ; preds = %15
store i32 -1, i32* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @srslte_cqi_hl_get_subband_size(i32 %0) {
%2 = icmp slt i32 %0, 7
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 27
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 64
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 111
%9 = select i1 %8, i32 8, i32 -1
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i32 [ 0, %1 ], [ 4, %3 ], [ 6, %5 ], [ %9, %7 ]
ret i32 %11
}
int test_imm_E9int8_reg(signed char val) {
  return ((val) & (0xE9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E9int8_reg(i8 signext %0) {
%2 = and i8 %0, -23
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}