xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isalnum(char);
char *leftTrim(char *source) {
  int j = 0;
  while (!isalnum(*source)) {
    ++source;
    ++j;
  }
  return source;
}


x86 assembly (clang, -O0):
<leftTrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1144 <leftTrim+0x34>
jmp    115e <leftTrim+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <leftTrim+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftTrim>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isalnum@plt>
test   %eax,%eax
je     1120 <leftTrim+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @leftTrim(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = call i32 @isalnum(i8 signext %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %10, label %15
10: ; preds = %4
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @leftTrim(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i32 @isalnum(i8 signext %4)
%6 = icmp eq i32 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %2, label %8
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void xor_reg8_imm8(int reg8, unsigned char imm8) {
  put8(0x80);
  put8(0xF0 + reg8);
  put8(imm8);
}


x86 assembly (clang, -O0):
<xor_reg8_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    $0x80,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%eax
add    $0xf0,%eax
movzbl %al,%edi
call   1030 <put8@plt>
movzbl -0x5(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor_reg8_imm8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x80,%edi
call   1030 <put8@plt>
add    $0xf0,%bpl
movzbl %bpl,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @xor_reg8_imm8(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = call i32 @put8(i8 zeroext -128)
%6 = load i32, i32* %3
%7 = add nsw i32 240, %6
%8 = trunc i32 %7 to i8
%9 = call i32 @put8(i8 zeroext %8)
%10 = load i8, i8* %4
%11 = call i32 @put8(i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @xor_reg8_imm8(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @put8(i8 zeroext -128)
%4 = trunc i32 %0 to i8
%5 = add i8 %4, -16
%6 = tail call i32 @put8(i8 zeroext %5)
%7 = tail call i32 @put8(i8 zeroext %1)
ret void
}
/* Variables and functions */
int rotation_dir(int, int);
int dir_max(int dir1, int dir2, int max_dir) {
  return (rotation_dir(dir1, dir2) == max_dir ? dir2 : dir1);
}


x86 assembly (clang, -O0):
<dir_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <rotation_dir@plt>
cmp    -0xc(%rbp),%eax
jne    1140 <dir_max+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <dir_max+0x36>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_max>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <rotation_dir@plt>
cmp    %r14d,%eax
cmove  %ebp,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dir_max(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @rotation_dir(i32 %7, i32 %8)
%10 = load i32, i32* %6
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = load i32, i32* %5
br label %16
14: ; preds = %3
%15 = load i32, i32* %4
br label %16
16: ; preds = %14, %12
%17 = phi i32 [ %13, %12 ], [ %15, %14 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @dir_max(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @rotation_dir(i32 %0, i32 %1)
%5 = icmp eq i32 %4, %2
%6 = select i1 %5, i32 %1, i32 %0
ret i32 %6
}
void funcb(void) {
  int i, n;
  for (i = 0; i < 1000000; i++) {
    n++;
    n--;
  }
}


x86 assembly (clang, -O0):
<funcb>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jge    1138 <funcb+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <funcb+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @funcb() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void rnd_init(void) { srand((unsigned int)time(NULL)); }


x86 assembly (clang, -O0):
<rnd_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd_init>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @rnd_init() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @rnd_init() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int create_tcp_socket() {
  int sock;
  if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
    perror("Can't create TCP socket");
    exit(2);
  }
  return sock;
}


x86 assembly (clang, -O0):
<create_tcp_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
call   1050 <socket@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    117a <create_tcp_socket+0x4a>
lea    0xe95(%rip),%rdi
call   1030 <perror@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_tcp_socket>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
call   1050 <socket@plt>
test   %eax,%eax
js     1157 <create_tcp_socket+0x27>
pop    %rcx
ret
lea    0xea2(%rip),%rdi
call   1030 <perror@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [24 x i8] c"Can't create TCP socket\00"
define i32 @create_tcp_socket() {
%1 = alloca i32
%2 = load i32, i32* @AF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = load i32, i32* @IPPROTO_TCP
%5 = call i32 @socket(i32 %2, i32 %3, i32 %4)
store i32 %5, i32* %1
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 2)
unreachable
10: ; preds = %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [24 x i8] c"Can't create TCP socket\00"
define i32 @create_tcp_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = load i32, i32* @IPPROTO_TCP
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = tail call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 2)
unreachable
9: ; preds = %0
ret i32 %4
}
void array() { int a[(1 + 1 == 2) * 2]; }


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

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

LLVM IR (-O0):
define void @array() {
%1 = alloca [2 x i32]
ret void
}

LLVM IR (-O2):
define void @array() {
ret void
}
int adddigit(int x) {
  int sum = 0;
  while (x != 0) {
    int t = x % 10;
    sum += t;
    x = x / 10;
  }
  return sum;
}


x86 assembly (clang, -O0):
<adddigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1142 <adddigit+0x42>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <adddigit+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adddigit>:
xor    %eax,%eax
test   %edi,%edi
je     113b <adddigit+0x3b>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <adddigit+0x10>
ret

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

LLVM IR (-O2):
define i32 @adddigit(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = add nsw i32 %6, %5
%8 = sdiv i32 %4, 10
%9 = add i32 %4, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
long atol(const char *nptr) {
__ESBMC_HIDE:;
  long res;
  return res;
}


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

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

LLVM IR (-O0):
define i64 @atol(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
br label %4
4: ; preds = %1
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @atol(i8* nocapture readnone %0) {
ret i64 undef
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t SEG(void *__p) { return (uint16_t)(((uint32_t)__p) >> 4); }


x86 assembly (clang, -O0):
<SEG>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SEG>:
mov    %rdi,%rax
sar    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @SEG(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = ashr i32 %3, 4
ret i32 %4
}
/* Variables and functions */
int recv(int, char *, int, int /*<<< orphan*/);
int socket_recv(int sock, char *buff, int buff_len) {
  int rv = recv(sock, buff, buff_len, 0);
  return rv;
}


x86 assembly (clang, -O0):
<socket_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_recv>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @socket_recv(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEinvokenonvirtual(char *, int /*<<< orphan*/ *);
void code_invokenonvirtual(char *arg) {
  appendCODE(makeCODEinvokenonvirtual(arg, NULL));
}


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

x86 assembly (clang, -O2):
<code_invokenonvirtual>:
push   %rax
xor    %esi,%esi
call   1030 <makeCODEinvokenonvirtual@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <appendCODE@plt>

LLVM IR (-O0):
define void @code_invokenonvirtual(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @makeCODEinvokenonvirtual(i8* %3, i32* null)
%5 = call i32 @appendCODE(i32 %4)
ret void
}

LLVM IR (-O2):
define void @code_invokenonvirtual(i8* %0) {
%2 = tail call i32 @makeCODEinvokenonvirtual(i8* %0, i32* null)
%3 = tail call i32 @appendCODE(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jd_to_gregorian(double, int *, int *, int *, int *, int *,
                                   double *);
void mjd_to_gregorian(double jd, int *year, int *month, int *day, int *hour,
                      int *min, double *sec) {
  jd_to_gregorian(jd + 2400000.5, year, month, day, hour, min, sec);
}


x86 assembly (clang, -O0):
<mjd_to_gregorian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movsd  0xec3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   1030 <jd_to_gregorian@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mjd_to_gregorian>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <jd_to_gregorian@plt>

LLVM IR (-O0):
define void @mjd_to_gregorian(double %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, double* %6) {
%8 = alloca double
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca double*
store double %0, double* %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store double* %6, double** %14
%15 = load double, double* %8
%16 = fadd double %15, 0x41424F8040000000
%17 = load i32*, i32** %9
%18 = load i32*, i32** %10
%19 = load i32*, i32** %11
%20 = load i32*, i32** %12
%21 = load i32*, i32** %13
%22 = load double*, double** %14
%23 = call i32 @jd_to_gregorian(double %16, i32* %17, i32* %18, i32* %19, i32* %20, i32* %21, double* %22)
ret void
}

LLVM IR (-O2):
define void @mjd_to_gregorian(double %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, double* %6) {
%8 = fadd double %0, 0x41424F8040000000
%9 = tail call i32 @jd_to_gregorian(double %8, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, double* %6)
ret void
}
int _test_polyphonic_key_pressure(void *buffer) {
  return (((unsigned char *)buffer)[0] & 0xf0) == (0xa << 4);
}


x86 assembly (clang, -O0):
<_test_polyphonic_key_pressure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xf0,%eax
cmp    $0xa0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_polyphonic_key_pressure>:
mov    (%rdi),%cl
and    $0xf0,%cl
xor    %eax,%eax
cmp    $0xa0,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @_test_polyphonic_key_pressure(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 240
%8 = icmp eq i32 %7, 160
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_test_polyphonic_key_pressure(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -16
%4 = icmp eq i8 %3, -96
%5 = zext i1 %4 to i32
ret i32 %5
}
char hex_nibble(char c) { return (c >= 10) ? 'A' + c - 10 : '0' + c; }


x86 assembly (clang, -O0):
<hex_nibble>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jl     1129 <hex_nibble+0x29>
movsbl -0x1(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <hex_nibble+0x33>
movsbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_nibble>:
cmp    $0xa,%dil
mov    $0x37,%ecx
mov    $0x30,%eax
cmovge %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @hex_nibble(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = add nsw i32 65, %8
%10 = sub nsw i32 %9, 10
br label %15
11: ; preds = %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = add nsw i32 48, %13
br label %15
15: ; preds = %11, %6
%16 = phi i32 [ %10, %6 ], [ %14, %11 ]
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @hex_nibble(i8 signext %0) {
%2 = icmp sgt i8 %0, 9
%3 = select i1 %2, i8 55, i8 48
%4 = add i8 %3, %0
ret i8 %4
}
/* Variables and functions */
scalar_t__ is_stmt();
int /*<<< orphan*/ stmt();
void stmt_list() {
  while (is_stmt()) {
    stmt();
  }
}


x86 assembly (clang, -O0):
<stmt_list>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <stmt_list+0x9>
mov    $0x0,%al
call   1040 <is_stmt@plt>
cmp    $0x0,%rax
je     1146 <stmt_list+0x26>
mov    $0x0,%al
call   1030 <stmt@plt>
jmp    1129 <stmt_list+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stmt_list>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <is_stmt@plt>
test   %rax,%rax
je     1145 <stmt_list+0x25>
xor    %eax,%eax
call   1030 <stmt@plt>
jmp    1130 <stmt_list+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @stmt_list() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @is_stmt()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 (...) @stmt()
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @stmt_list() {
%1 = tail call i64 (...) @is_stmt()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @stmt()
%5 = tail call i64 (...) @is_stmt()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret void
}
unsigned int IntPendingIrqMaskedStatusGet(unsigned int intrNum) {
  return (
      (0 ==
       ((*((volatile unsigned int *)((0x48200000) +
                                     (0x98 + ((intrNum >> (0x05)) * 0x20))))) >>
        (((intrNum & (0x1F))) & 0x01)))
          ? 0
          : 1);
}


x86 assembly (clang, -O0):
<IntPendingIrqMaskedStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
shl    $0x5,%eax
add    $0x98,%eax
add    $0x48200000,%eax
mov    %eax,%eax
mov    (%rax),%edx
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
and    $0x1,%ecx
shr    %cl,%edx
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    %edx,%ecx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntPendingIrqMaskedStatusGet>:
mov    %edi,%ecx
mov    %edi,%eax
and    $0xffffffe0,%eax
add    $0x48200098,%eax
mov    (%rax),%edx
and    $0x1,%cl
shr    %cl,%edx
xor    %eax,%eax
test   %edx,%edx
setne  %al
ret

LLVM IR (-O0):
define i32 @IntPendingIrqMaskedStatusGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 5
%5 = mul i32 %4, 32
%6 = add i32 152, %5
%7 = add i32 1210056704, %6
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = load i32, i32* %2
%12 = and i32 %11, 31
%13 = and i32 %12, 1
%14 = lshr i32 %10, %13
%15 = icmp eq i32 0, %14
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 1
ret i32 %17
}

LLVM IR (-O2):
define i32 @IntPendingIrqMaskedStatusGet(i32 %0) {
%2 = and i32 %0, -32
%3 = add i32 %2, 1210056856
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %0, 1
%8 = lshr i32 %6, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
void foo084(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo084(i32 %0) {
ret void
}
double linear_gradient(const double x) {
  (void)x;
  return 1;
}


x86 assembly (clang, -O0):
<linear_gradient>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_gradient>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @linear_gradient(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @linear_gradient(double %0) {
ret double 1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printd(int);
void div(int a, int b) {
  printd(a);
  print(" / ");
  printd(b);
  print(" -> ");
  printd(a / b);
  print("\r\n");
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <printd@plt>
lea    0xec3(%rip),%rdi
call   1040 <print@plt>
mov    -0x8(%rbp),%edi
call   1030 <printd@plt>
lea    0xeb3(%rip),%rdi
call   1040 <print@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
call   1030 <printd@plt>
lea    0xe9e(%rip),%rdi
call   1040 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <printd@plt>
lea    0xecd(%rip),%rdi
call   1040 <print@plt>
mov    %ebx,%edi
call   1030 <printd@plt>
lea    0xebe(%rip),%rdi
call   1040 <print@plt>
mov    %ebp,%eax
cltd
idiv   %ebx
mov    %eax,%edi
call   1030 <printd@plt>
lea    0xeab(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <print@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" / \00"
@.str.1 = [5 x i8] c" -> \00"
@.str.2 = [3 x i8] c"\0D\0A\00"
define void @div(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @printd(i32 %5)
%7 = call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = call i32 @printd(i32 %8)
%10 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sdiv i32 %11, %12
%14 = call i32 @printd(i32 %13)
%15 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" / \00"
@.str.1 = [5 x i8] c" -> \00"
@.str.2 = [3 x i8] c"\0D\0A\00"
define void @div(i32 %0, i32 %1) {
%3 = tail call i32 @printd(i32 %0)
%4 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printd(i32 %1)
%6 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = sdiv i32 %0, %1
%8 = tail call i32 @printd(i32 %7)
%9 = tail call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int readmend();
int readmsg(int);
int readmnull(int msg) {
  int x;
  x = readmsg(msg);
  if (x == (1))
    x = readmend();
  return (x);
}


x86 assembly (clang, -O0):
<readmnull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <readmsg@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114a <readmnull+0x2a>
mov    $0x0,%al
call   1040 <readmend@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readmnull>:
push   %rax
call   1030 <readmsg@plt>
cmp    $0x1,%eax
jne    1133 <readmnull+0x13>
xor    %eax,%eax
pop    %rcx
jmp    1040 <readmend@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @readmnull(i32 %0) {
%2 = tail call i32 @readmsg(i32 %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @readmend()
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ %2, %1 ]
ret i32 %7
}
const char *perf_get_description(void) {
  return "Syncs the file system (a newly created empty file system is "
         "preferable). Creates a file named perf_test_file_pid, where "
         "pid is the process id. The file is filled with random data. "
         "The size of the file is given by the -z or --size option, "
         "otherwise it defaults to 10MiB. Unmounts the file system. "
         "Mounts the file system. Reads the entire file in 32KiB size "
         "blocks. Displays the time taken for each activity. Deletes "
         "the file. Note that the file is synced after writing and "
         "that time is included in the write time and speed.";
}


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

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

LLVM IR (-O0):
@.str = [523 x i8] c"Syncs the file system (a newly created empty file system is preferable). Creates a file named perf_test_file_pid, where pid is the process id. The file is filled with random data. The size of the file is given by the -z or --size option, otherwise it defaults to 10MiB. Unmounts the file system. Mounts the file system. Reads the entire file in 32KiB size blocks. Displays the time taken for each activity. Deletes the file. Note that the file is synced after writing and that time is included in the write time and speed.\00"
define i8* @perf_get_description() {
ret i8* getelementptr inbounds ([523 x i8], [523 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [523 x i8] c"Syncs the file system (a newly created empty file system is preferable). Creates a file named perf_test_file_pid, where pid is the process id. The file is filled with random data. The size of the file is given by the -z or --size option, otherwise it defaults to 10MiB. Unmounts the file system. Mounts the file system. Reads the entire file in 32KiB size blocks. Displays the time taken for each activity. Deletes the file. Note that the file is synced after writing and that time is included in the write time and speed.\00"
define i8* @perf_get_description() {
ret i8* getelementptr inbounds ([523 x i8], [523 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ start_rpc(int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Input a packet drop_rate!\n");
    exit(1);
  }
  start_rpc(atoi(argv[1]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     116f <main+0x2f>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <start_rpc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    115a <main+0x1a>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1030 <start_rpc@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe9f(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Input a packet drop_rate!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %2
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
%15 = call i32 @start_rpc(i32 %14)
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"Input a packet drop_rate!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = tail call i32 @start_rpc(i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free_matrix(void **pointer, int row) {
  int loop;
  for (loop = 0; loop < row; loop++) {
    free(pointer[loop]);
  }
  free(pointer);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_matrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_matrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_matrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_matrix(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = bitcast i8** %8 to i8***
%10 = load i8**, i8*** %9
%11 = tail call i32 @free(i8** %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @free(i8** %0)
ret void
}
int main() {
  unsigned long arg1 = 0xFFFFFFFFFFFFFFFFL;
  unsigned long arg2 = 0xFFFFFFFFFFFFFFFFL;
  unsigned long mulLo = 0;
  unsigned long mulHi = 0;
  __asm__("mulq %%rbx;" : "=a"(mulLo), "=d"(mulHi) : "a"(arg1), "b"(arg2));
  return (mulLo == 1) && (mulHi == 0xFFFFFFFFFFFFFFFEL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movl   $0x0,-0xc(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rbx
mul    %rbx
mov    %rax,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
xor    %eax,%eax
cmpq   $0x1,-0x28(%rbp)
mov    %al,-0x31(%rbp)
jne    115a <main+0x5a>
cmpq   $0xfffffffffffffffe,-0x30(%rbp)
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffffffffffff,%rax
mov    $0xffffffffffffffff,%rbx
mul    %rbx
xor    $0x1,%rax
xor    $0xfffffffffffffffe,%rdx
xor    %ecx,%ecx
or     %rax,%rdx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i64 -1, i64* %2
store i64 -1, i64* %3
store i64 0, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %2
%7 = load i64, i64* %3
%8 = call { i64, i64 } asm "mulq %rbx;", "={ax},={dx},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
%9 = extractvalue { i64, i64 } %8, 0
%10 = extractvalue { i64, i64 } %8, 1
store i64 %9, i64* %4
store i64 %10, i64* %5
%11 = load i64, i64* %4
%12 = icmp eq i64 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %0
%14 = load i64, i64* %5
%15 = icmp eq i64 %14, -2
br label %16
16: ; preds = %13, %0
%17 = phi i1 [ false, %0 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call { i64, i64 } asm "mulq %rbx;", "={ax},={dx},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i64 -1, i64 -1)
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = icmp eq i64 %2, 1
%5 = icmp eq i64 %3, -2
%6 = select i1 %4, i1 %5, i1 false
%7 = zext i1 %6 to i32
ret i32 %7
}
int test_imm_0Aint16_reg(short val) {
  return ((val) & (-0x0A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Aint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xfffffff6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_0Aint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -10
%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_0Aint16_reg(i16 signext %0) {
%2 = and i16 %0, -10
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_letters(char *);
void print_arguments(int argc, char *argv[]) {
  int i = 0;
  for (i = 1; i < argc; i++) {
    print_letters(argv[i]);
  }
}


x86 assembly (clang, -O0):
<print_arguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1158 <print_arguments+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <print_letters@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <print_arguments+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arguments>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <print_arguments+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <print_letters@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <print_arguments+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @print_arguments(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @print_letters(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void gtk_tree_view_column_get_alignment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_get_alignment() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int fwrite(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int stdout_write(char *data, int len) {
  if (fwrite(data, 1, len, stdout) != len) {
    perror(NULL);
    return 0;
  }
  fflush(stdout);
  return len;
}


x86 assembly (clang, -O0):
<stdout_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    0x2e93(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1050 <fwrite@plt>
cmp    -0x14(%rbp),%eax
je     1177 <stdout_write+0x47>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    118b <stdout_write+0x5b>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdout_write>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    0x2ea3(%rip),%r14
mov    (%r14),%ecx
mov    $0x1,%esi
mov    %ebx,%edx
call   1050 <fwrite@plt>
cmp    %ebx,%eax
jne    1162 <stdout_write+0x32>
mov    (%r14),%edi
call   1030 <fflush@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %ebx,%ebx
xor    %edi,%edi
call   1040 <perror@plt>
jmp    1158 <stdout_write+0x28>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @stdout_write(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = load i32, i32* %5
%8 = load i32, i32* @stdout
%9 = call i32 @fwrite(i8* %6, i32 1, i32 %7, i32 %8)
%10 = load i32, i32* %5
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @perror(i32* null)
store i32 0, i32* %3
br label %18
14: ; preds = %2
%15 = load i32, i32* @stdout
%16 = call i32 @fflush(i32 %15)
%17 = load i32, i32* %5
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %12
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @stdout_write(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fwrite(i8* %0, i32 1, i32 %1, i32 %3)
%5 = icmp eq i32 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @perror(i32* null)
br label %11
8: ; preds = %2
%9 = load i32, i32* @stdout
%10 = tail call i32 @fflush(i32 %9)
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ 0, %6 ], [ %1, %8 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void __attribute__((noreturn)) main() {
  print("Hello, World!\r\n:)");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <print@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O0):
@.str = [18 x i8] c"Hello, World!\0D\0A:)\00"
define void @main() {
%1 = call i32 @print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [18 x i8] c"Hello, World!\0D\0A:)\00"
define void @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void Delay(volatile uint32_t nCount) {
  while (nCount--) {
  }
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1120 <Delay+0x20>
jmp    1107 <Delay+0x7>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay>:
mov    %edi,-0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
subl   $0x1,-0x4(%rsp)
jae    1110 <Delay+0x10>
ret

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

LLVM IR (-O2):
define void @Delay(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
%4 = load volatile i32, i32* %2
%5 = add nsw i32 %4, -1
store volatile i32 %5, i32* %2
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
void ignore_sigalarm(int __attribute__((unused)) signum) {}


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

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

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

LLVM IR (-O2):
define void @ignore_sigalarm(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void chartest(char *str, int i) { printf("Char: %c \n", str[i]); }


x86 assembly (clang, -O0):
<chartest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xed2(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chartest>:
movslq %esi,%rax
movsbl (%rdi,%rax,1),%esi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Char: %c \0A\00"
define void @chartest(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %9)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Char: %c \0A\00"
define void @chartest(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void wiringXSerialClose(int fd) {
  if (fd > 0) {
    close(fd);
  }
}


x86 assembly (clang, -O0):
<wiringXSerialClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112d <wiringXSerialClose+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiringXSerialClose>:
test   %edi,%edi
jle    1119 <wiringXSerialClose+0x9>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @wiringXSerialClose(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @wiringXSerialClose(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_palindrome(char const *, int, int);
void test3(void) {
  const char a[] = {'a', 'a'};
  test_palindrome(a, sizeof(a), 1);
  test_palindrome(a, sizeof(a), 2);
  printf("\n");
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
lea    -0x2(%rbp),%rdi
mov    $0x2,%edx
mov    %edx,%esi
call   1040 <test_palindrome@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
push   %rbx
sub    $0x10,%rsp
movw   $0x6161,0xe(%rsp)
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test3.a = [2 x i8] c"aa"
@.str = [2 x i8] c"\0A\00"
define void @test3() {
%1 = alloca [2 x i8]
%2 = bitcast [2 x i8]* %1 to i8*
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%4 = call i32 @test_palindrome(i8* %3, i32 2, i32 1)
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%6 = call i32 @test_palindrome(i8* %5, i32 2, i32 2)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @test3() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
store i16 24929, i16* %1
%3 = call i32 @test_palindrome(i8* %2, i32 2, i32 1)
%4 = call i32 @test_palindrome(i8* %2, i32 2, i32 2)
%5 = call i32 @putchar(i32 10)
ret void
}
int get_key() { return -1; }


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

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

LLVM IR (-O0):
define i32 @get_key() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @get_key() {
ret i32 -1
}