xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char cl, k, pp;
  scanf("%c", &cl);
  pp = cl - 'a';
  k = 'z' - pp;
  printf("\n%c", k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
mov    %al,-0x7(%rbp)
movsbl -0x7(%rbp),%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x6(%rbp)
lea    0xea2(%rip),%rdi
movsbl -0x6(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed9(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0x7(%rsp),%al
movsbl %al,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"\0A%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 97
%9 = trunc i32 %8 to i8
store i8 %9, i8* %4
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = sub nsw i32 122, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %3
%14 = load i8, i8* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"\0A%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay_ms(int);
int /*<<< orphan*/ nrf_cel();
int /*<<< orphan*/ nrf_csh();
void nrf_init() {
  delay_ms(20);
  *(unsigned char *)0x500C |= (1 << 4);
  *(unsigned char *)0x500D |= (1 << 4);
  nrf_csh();
  nrf_cel();
}


x86 assembly (clang, -O0):
<nrf_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
call   1040 <delay_ms@plt>
mov    $0x500c,%eax
movzbl (%rax),%eax
or     $0x10,%eax
mov    %al,%cl
mov    $0x500c,%eax
mov    %cl,(%rax)
mov    $0x500d,%eax
movzbl (%rax),%eax
or     $0x10,%eax
mov    %al,%cl
mov    $0x500d,%eax
mov    %cl,(%rax)
mov    $0x0,%al
call   1030 <nrf_csh@plt>
mov    $0x0,%al
call   1050 <nrf_cel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_init>:
push   %rax
mov    $0x14,%edi
call   1040 <delay_ms@plt>
orb    $0x10,0x500c
10
orb    $0x10,0x500d
10
xor    %eax,%eax
call   1030 <nrf_csh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <nrf_cel@plt>

LLVM IR (-O0):
define void @nrf_init() {
%1 = call i32 @delay_ms(i32 20)
%2 = load i8, i8* inttoptr (i64 20492 to i8*)
%3 = zext i8 %2 to i32
%4 = or i32 %3, 16
%5 = trunc i32 %4 to i8
store i8 %5, i8* inttoptr (i64 20492 to i8*)
%6 = load i8, i8* inttoptr (i64 20493 to i8*)
%7 = zext i8 %6 to i32
%8 = or i32 %7, 16
%9 = trunc i32 %8 to i8
store i8 %9, i8* inttoptr (i64 20493 to i8*)
%10 = call i32 (...) @nrf_csh()
%11 = call i32 (...) @nrf_cel()
ret void
}

LLVM IR (-O2):
define void @nrf_init() {
%1 = tail call i32 @delay_ms(i32 20)
%2 = load i8, i8* inttoptr (i64 20492 to i8*)
%3 = or i8 %2, 16
store i8 %3, i8* inttoptr (i64 20492 to i8*)
%4 = load i8, i8* inttoptr (i64 20493 to i8*)
%5 = or i8 %4, 16
store i8 %5, i8* inttoptr (i64 20493 to i8*)
%6 = tail call i32 (...) @nrf_csh()
%7 = tail call i32 (...) @nrf_cel()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ft_strdel(char **as) {
  if (!as || !*as)
    return;
  free(*as);
  *as = 0;
}


x86 assembly (clang, -O0):
<ft_strdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1135 <ft_strdel+0x25>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113a <ft_strdel+0x2a>
jmp    1151 <ft_strdel+0x41>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdel>:
push   %rbx
test   %rdi,%rdi
je     112d <ft_strdel+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <ft_strdel+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_strdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %1, %3, %6
ret void
}
void coresight_cti_ctx_save(void) {}


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

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

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

LLVM IR (-O2):
define void @coresight_cti_ctx_save() {
ret void
}
/* Variables and functions */
int f();
int q(int x, int y) {
  int u = 5;
  return x + y + f() + u;
}


x86 assembly (clang, -O0):
<q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <f@plt>
add    %ebp,%ebx
add    %ebx,%eax
add    $0x5,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @q(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 5, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = call i32 (...) @f()
%10 = add nsw i32 %8, %9
%11 = load i32, i32* %5
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @q(i32 %0, i32 %1) {
%3 = tail call i32 (...) @f()
%4 = add i32 %0, 5
%5 = add i32 %4, %1
%6 = add i32 %5, %3
ret i32 %6
}
int divisao(int x, int y) { return x / y; }


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

x86 assembly (clang, -O2):
<divisao>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @divisao(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @divisao(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int strlen(char *);
void trim(char *buf) {
  char *cp;
  for (cp = buf + strlen(buf); cp > buf; cp--)
    if (cp[-1] != ' ')
      break;
  *cp = 0;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1177 <trim+0x67>
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x20,%eax
je     1161 <trim+0x51>
jmp    1177 <trim+0x67>
jmp    1166 <trim+0x56>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    113d <trim+0x2d>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
add    %rbx,%rcx
nop
mov    %rcx,%rax
cmp    %rbx,%rcx
jbe    1132 <trim+0x22>
lea    -0x1(%rax),%rcx
cmpb   $0x20,-0x1(%rax)
je     1120 <trim+0x10>
movb   $0x0,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @trim(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
br label %5
5: ; preds = %8, %1
%6 = phi i8* [ %4, %1 ], [ %9, %8 ]
%7 = icmp ugt i8* %6, %0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 -1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 32
br i1 %11, label %5, label %12
12: ; preds = %8, %5
store i8 0, i8* %6
ret void
}
int ft_isalpha(int c) {
  if (c >= 'A' && c <= 'Z')
    return (1);
  else if (c >= 'a' && c <= 'z')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <ft_isalpha+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <ft_isalpha+0x27>
movl   $0x1,-0x4(%rbp)
jmp    114e <ft_isalpha+0x4e>
cmpl   $0x61,-0x8(%rbp)
jl     1147 <ft_isalpha+0x47>
cmpl   $0x7a,-0x8(%rbp)
jg     1147 <ft_isalpha+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <ft_isalpha+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %18
10: ; preds = %6, %1
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 97
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 122
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %2
br label %18
17: ; preds = %13, %10
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int core7_swap(char *, int);
int U_EMRSETWINDOWORGEX_swap(char *record, int torev) {
  return (core7_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRSETWINDOWORGEX_swap>:
jmp    1030 <core7_swap@plt>

LLVM IR (-O0):
define i32 @U_EMRSETWINDOWORGEX_swap(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 = call i32 @core7_swap(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @U_EMRSETWINDOWORGEX_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core7_swap(i8* %0, i32 %1)
ret i32 %3
}
main() {
  static int i;
  __builtin_constant_p(
      __builtin_constant_p(__builtin_types_compatible_p(int, __typeof(i))));
  __builtin_trap();
}


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

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

LLVM IR (-O0):
@main.i = internal global i32 0
define i32 @main() {
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
tail call void @llvm.trap()
unreachable
}
/* Variables and functions */
int mrf24j40_read_short_ctrl_reg(int);
int /*<<< orphan*/ mrf24j40_write_short_ctrl_reg(int, int);
void mrf24j40_rxfifo_flush(void) {
  mrf24j40_write_short_ctrl_reg(0x0D,
                                (mrf24j40_read_short_ctrl_reg(0x0D) | (1)));
}


x86 assembly (clang, -O0):
<mrf24j40_rxfifo_flush>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
call   1030 <mrf24j40_read_short_ctrl_reg@plt>
mov    %eax,%esi
or     $0x1,%esi
mov    $0xd,%edi
call   1040 <mrf24j40_write_short_ctrl_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrf24j40_rxfifo_flush>:
push   %rax
mov    $0xd,%edi
call   1030 <mrf24j40_read_short_ctrl_reg@plt>
or     $0x1,%eax
mov    $0xd,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <mrf24j40_write_short_ctrl_reg@plt>

LLVM IR (-O0):
define void @mrf24j40_rxfifo_flush() {
%1 = call i32 @mrf24j40_read_short_ctrl_reg(i32 13)
%2 = or i32 %1, 1
%3 = call i32 @mrf24j40_write_short_ctrl_reg(i32 13, i32 %2)
ret void
}

LLVM IR (-O2):
define void @mrf24j40_rxfifo_flush() {
%1 = tail call i32 @mrf24j40_read_short_ctrl_reg(i32 13)
%2 = or i32 %1, 1
%3 = tail call i32 @mrf24j40_write_short_ctrl_reg(i32 13, i32 %2)
ret void
}
int ssh_packet_sendx(struct ssh *ssh) {
  int r;
  if ((r = sshpkt_sendx(ssh)) < 0)
    ssh_fatal("%s: %s", __func__, ssh_err(r));
  return r;
}


x86 assembly (clang, -O0):
<ssh_packet_sendx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <sshpkt_sendx@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    1174 <ssh_packet_sendx+0x44>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1030 <ssh_err@plt>
mov    %eax,%edx
lea    0xe9a(%rip),%rdi
lea    0xe9a(%rip),%rsi
mov    $0x0,%al
call   1050 <ssh_fatal@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssh_packet_sendx>:
push   %rbx
xor    %eax,%eax
call   1040 <sshpkt_sendx@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    115e <ssh_packet_sendx+0x2e>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <ssh_err@plt>
lea    0xeb2(%rip),%rdi
lea    0xeb2(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <ssh_fatal@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ssh = type opaque
@.str = [7 x i8] c"%s: %s\00"
@__func__.ssh_packet_sendx = [17 x i8] c"ssh_packet_sendx\00"
define i32 @ssh_packet_sendx(%struct.ssh* %0) {
%2 = alloca %struct.ssh*
%3 = alloca i32
store %struct.ssh* %0, %struct.ssh** %2
%4 = load %struct.ssh*, %struct.ssh** %2
%5 = call i32 (%struct.ssh*, ...) bitcast (i32 (...)* @sshpkt_sendx to i32 (%struct.ssh*, ...)*)(%struct.ssh* %4)
store i32 %5, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 (i32, ...) bitcast (i32 (...)* @ssh_err to i32 (i32, ...)*)(i32 %8)
%10 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @ssh_fatal to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.ssh_packet_sendx, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
%struct.ssh = type opaque
@.str = [7 x i8] c"%s: %s\00"
@__func__.ssh_packet_sendx = [17 x i8] c"ssh_packet_sendx\00"
define i32 @ssh_packet_sendx(%struct.ssh* %0) {
%2 = tail call i32 (%struct.ssh*, ...) bitcast (i32 (...)* @sshpkt_sendx to i32 (%struct.ssh*, ...)*)(%struct.ssh* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @ssh_err to i32 (i32, ...)*)(i32 %2)
%6 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @ssh_fatal to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.ssh_packet_sendx, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ f(long double, int);
main() {
  if (!(int)(f(2.0L, 1)))
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %rsp,%rax
flds   0xeb8(%rip)
fstpt  (%rax)
mov    $0x1,%edi
call   1040 <f@plt>
cmp    $0x0,%eax
jne    1164 <main+0x34>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
flds   0xec6(%rip)
fstpt  (%rsp)
mov    $0x1,%edi
call   1040 <f@plt>
test   %eax,%eax
jne    1152 <main+0x22>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @f(x86_fp80 0xK40008000000000000000, i32 1)
%3 = trunc i64 %2 to i32
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @f(x86_fp80 0xK40008000000000000000, i32 1)
%2 = trunc i64 %1 to i32
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 3;
  int b = 7;
  printf("a is %d, b is %d\n", a, b);
  {
    int z;
    z = a;
    a = b;
    b = z;
  };
  printf("Now swap, and... a is %d and b is %d!\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
mov    $0x7,%edx
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x7,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"a is %d, b is %d\0A\00"
@.str.1 = [39 x i8] c"Now swap, and... a is %d and b is %d!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 7, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %2
store i32 %8, i32* %4
%9 = load i32, i32* %3
store i32 %9, i32* %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"a is %d, b is %d\0A\00"
@.str.1 = [39 x i8] c"Now swap, and... a is %d and b is %d!\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 3, i32 7)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 7, i32 3)
ret i32 0
}
/* Variables and functions */
int M_PI;
float arc2pixel(int zoom, float arc) {
  return ((arc * 256 * (1 << zoom)) / (2 * M_PI)) + ((1 << zoom) * (256 / 2));
}


x86 assembly (clang, -O0):
<arc2pixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  0xeec(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
shl    $0x7,%eax
cvtsi2ss %eax,%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<arc2pixel>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2ss %eax,%xmm1
mulss  0xeeb(%rip),%xmm0
mov    0x2ecc(%rip),%rcx
mov    (%rcx),%ecx
add    %ecx,%ecx
cvtsi2ss %ecx,%xmm2
mulss  %xmm1,%xmm0
divss  %xmm2,%xmm0
shl    $0x7,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @arc2pixel(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fmul float %5, 2.560000e+02
%7 = load i32, i32* %3
%8 = shl i32 1, %7
%9 = sitofp i32 %8 to float
%10 = fmul float %6, %9
%11 = load i32, i32* @M_PI
%12 = mul nsw i32 2, %11
%13 = sitofp i32 %12 to float
%14 = fdiv float %10, %13
%15 = load i32, i32* %3
%16 = shl i32 1, %15
%17 = mul nsw i32 %16, 128
%18 = sitofp i32 %17 to float
%19 = fadd float %14, %18
ret float %19
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @arc2pixel(i32 %0, float %1) {
%3 = fmul float %1, 2.560000e+02
%4 = shl nuw i32 1, %0
%5 = sitofp i32 %4 to float
%6 = fmul float %3, %5
%7 = load i32, i32* @M_PI
%8 = shl nsw i32 %7, 1
%9 = sitofp i32 %8 to float
%10 = fdiv float %6, %9
%11 = shl nsw i32 %4, 7
%12 = sitofp i32 %11 to float
%13 = fadd float %10, %12
ret float %13
}
int octave_o_wronly_wrapper(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @octave_o_wronly_wrapper() {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ ulong;

/* Variables and functions */
int Z_OK;
int /*<<< orphan*/ assert(int);
int uncompress(unsigned char *, int /*<<< orphan*/ *, unsigned char *,
               int /*<<< orphan*/);
ulong uncompress_buffer(char *dfl_buf, ulong buflen, char *srcbuf,
                        ulong srclen) {
  ulong destlen = buflen;
  int res = uncompress((unsigned char *)dfl_buf, &destlen,
                       (unsigned char *)srcbuf, srclen);
  assert(res == Z_OK);
  return destlen;
}


x86 assembly (clang, -O0):
<uncompress_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    -0x20(%rbp),%rsi
call   1030 <uncompress@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uncompress_buffer>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <uncompress@plt>
mov    0x2eba(%rip),%rcx
xor    %edi,%edi
cmp    (%rcx),%eax
sete   %dil
call   1040 <assert@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@Z_OK = global i32 0
define i32 @uncompress_buffer(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = load i32, i32* %6
store i32 %11, i32* %9
%12 = load i8*, i8** %5
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @uncompress(i8* %12, i32* %9, i8* %13, i32 %14)
store i32 %15, i32* %10
%16 = load i32, i32* %10
%17 = load i32, i32* @Z_OK
%18 = icmp eq i32 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32, i32* %9
ret i32 %21
}

LLVM IR (-O2):
@Z_OK = global i32 0
define i32 @uncompress_buffer(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
store i32 %1, i32* %5
%7 = call i32 @uncompress(i8* %0, i32* %5, i8* %2, i32 %3)
%8 = load i32, i32* @Z_OK
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %5
ret i32 %12
}
void XCreateSimpleWindow() {}


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

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

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

LLVM IR (-O2):
define void @XCreateSimpleWindow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_55(int /*<<< orphan*/);
int gen_55() { handle_55(0); }


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

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

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

LLVM IR (-O2):
define i32 @gen_55() {
%1 = tail call i32 @handle_55(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int chislo, a, b;
  scanf("%d", &chislo);
  a = chislo * chislo;
  b = chislo * chislo * chislo;
  printf("%d\n", a);
  printf("%d\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xebb(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %2
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
void init_tokens(char tokens[][20]) {
  int i;
  for (i = 0; i < 15; i++) {
    tokens[i][0] = '\0';
  }
  return;
}


x86 assembly (clang, -O0):
<init_tokens>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xf,-0xc(%rbp)
jge    1139 <init_tokens+0x39>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movb   $0x0,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init_tokens+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_tokens>:
movb   $0x0,(%rdi)
movb   $0x0,0x14(%rdi)
movb   $0x0,0x28(%rdi)
movb   $0x0,0x3c(%rdi)
movb   $0x0,0x50(%rdi)
movb   $0x0,0x64(%rdi)
movb   $0x0,0x78(%rdi)
movb   $0x0,0x8c(%rdi)
movb   $0x0,0xa0(%rdi)
movb   $0x0,0xb4(%rdi)
movb   $0x0,0xc8(%rdi)
movb   $0x0,0xdc(%rdi)
movb   $0x0,0xf0(%rdi)
movb   $0x0,0x104(%rdi)
movb   $0x0,0x118(%rdi)
ret

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

LLVM IR (-O2):
define void @init_tokens([20 x i8]* nocapture writeonly %0) {
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 0, i64 0
store i8 0, i8* %2
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 1, i64 0
store i8 0, i8* %3
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 2, i64 0
store i8 0, i8* %4
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 3, i64 0
store i8 0, i8* %5
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 4, i64 0
store i8 0, i8* %6
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 5, i64 0
store i8 0, i8* %7
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 6, i64 0
store i8 0, i8* %8
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 7, i64 0
store i8 0, i8* %9
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 8, i64 0
store i8 0, i8* %10
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 9, i64 0
store i8 0, i8* %11
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 10, i64 0
store i8 0, i8* %12
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 11, i64 0
store i8 0, i8* %13
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 12, i64 0
store i8 0, i8* %14
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 13, i64 0
store i8 0, i8* %15
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 14, i64 0
store i8 0, i8* %16
ret void
}
int abs_val(double num) { return num >= 0. ? num : -num; }


x86 assembly (clang, -O0):
<abs_val>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112a <abs_val+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <abs_val+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_val>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
cvttsd2si %xmm2,%eax
ret

LLVM IR (-O0):
define i32 @abs_val(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fneg double %8
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
%12 = fptosi double %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @abs_val(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Type definitions */
struct Global {
  int dummy;
};

/* Variables and functions */
int get(struct Global *);
int cget(struct Global *global) {
  int c;
  do {
    c = get(global);
  } while (c == 0x1E);
  return (c);
}


x86 assembly (clang, -O0):
<cget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1e,-0xc(%rbp)
je     111c <cget+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cget>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <get@plt>
cmp    $0x1e,%eax
je     1120 <cget+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.Global = type { i32 }
define i32 @cget(%struct.Global* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @get(%struct.Global* %0)
%4 = icmp eq i32 %3, 30
br i1 %4, label %2, label %5
5: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int strlen(char *);
char *convtype(char *buf) {
  if (buf[strlen(buf) - 1] == '*') {
    buf[strlen(buf) - 1] = 0;
  }
  return buf;
}


x86 assembly (clang, -O0):
<convtype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    1167 <convtype+0x57>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convtype>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0x2a,-0x1(%rax,%rbx,1)
jne    1131 <convtype+0x21>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @convtype(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 42
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = tail call i32 @strlen(i8* %0)
%10 = add nsw i32 %9, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
br label %13
13: ; preds = %8, %1
ret i8* %0
}
float min_f(float a, float b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<min_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <min_f+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <min_f+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_f>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @min_f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @min_f(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char const *);
void die(const char *msg) {
  fprintf(stderr, "%s\n", msg);
  syslog(LOG_ERR, "%s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe97(%rip),%rsi
call   1040 <syslog@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%r14
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <syslog@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@LOG_ERR = global i32 0
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @LOG_ERR
%7 = load i8*, i8** %2
%8 = call i32 @syslog(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@LOG_ERR = global i32 0
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @LOG_ERR
%5 = tail call i32 @syslog(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
__attribute((no)) int b() { return 3; }


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

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

LLVM IR (-O0):
define i32 @b() {
ret i32 3
}

LLVM IR (-O2):
define i32 @b() {
ret i32 3
}
int f(int foo, int bar, int com) {
  unsigned align = 0;
  if (foo)
    return 0;
  while (1) {
    switch (bar) {
    case 1:
      if (com != 0)
        return align;
      *(char *)0 = 0;
    }
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <f+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    115f <f+0x5f>
jmp    112f <f+0x2f>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
jne    115a <f+0x5a>
jmp    1140 <f+0x40>
cmpl   $0x0,-0x10(%rbp)
je     1155 <f+0x55>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <f+0x5f>
xor    %eax,%eax
movb   $0x0,(%rax)
jmp    112f <f+0x2f>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
jne    1109 <f+0x9>
cmp    $0x1,%esi
jne    1110 <f+0x10>
xor    %eax,%eax
ret
nopl   0x0(%rax)
jmp    1110 <f+0x10>

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %4
br label %22
12: ; preds = %3
br label %13
13: ; preds = %12, %21
%14 = load i32, i32* %6
switch i32 %14, label %21 [
i32 1, label %15
]
15: ; preds = %13
%16 = load i32, i32* %7
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = load i32, i32* %8
store i32 %19, i32* %4
br label %22
20: ; preds = %15
store i8 0, i8* null
br label %21
21: ; preds = %20, %13
br label %13
22: ; preds = %18, %11
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = icmp eq i32 %1, 1
br i1 %6, label %8, label %7
7: ; preds = %5, %7
br label %7
8: ; preds = %5
%9 = icmp ne i32 %2, 0
tail call void @llvm.assume(i1 %9)
br label %10
10: ; preds = %3, %8
ret i32 0
}
/* Variables and functions */
int fb_bpp();
extern int image2screen_getscreenbpp(void) { return fb_bpp(); }


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

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

LLVM IR (-O0):
define i32 @image2screen_getscreenbpp() {
%1 = call i32 (...) @fb_bpp()
ret i32 %1
}

LLVM IR (-O2):
define i32 @image2screen_getscreenbpp() {
%1 = tail call i32 (...) @fb_bpp()
ret i32 %1
}
void foo_2_1_1_2_1_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_1_2_2_1_1() {
ret void
}
__attribute__((always_)) long IS_ERR(const void *ptr) {
  return __builtin_expect(!!(((unsigned long)ptr) > (unsigned long)-1000L), 0);
}


x86 assembly (clang, -O0):
<IS_ERR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0xfffffffffffffc18,%rax
seta   %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<IS_ERR>:
xor    %eax,%eax
cmp    $0xfffffffffffffc19,%rdi
setae  %al
ret

LLVM IR (-O0):
define i64 @IS_ERR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = icmp ugt i64 %4, -1000
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @IS_ERR(i8* readnone %0) {
%2 = icmp ugt i8* %0, inttoptr (i64 -1000 to i8*)
%3 = zext i1 %2 to i64
ret i64 %3
}
void PKCS7_free(void) {}


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

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

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

LLVM IR (-O2):
define void @PKCS7_free() {
ret void
}
int cmpint(const void *a, const void *b) { return (*(int *)a - *(int *)b); }


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

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

LLVM IR (-O0):
define i32 @cmpint(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmpint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
unsigned int get_hex8(char *);
unsigned int get_hex32(char *txt) {
  unsigned int val = 0;
  int i;
  for (i = 0; i < 4; i++)
    val = (val << 8) | get_hex8(&txt[i * 2]);
  return val;
}


x86 assembly (clang, -O0):
<get_hex32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1169 <get_hex32+0x59>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
cltq
add    %rax,%rdi
call   1030 <get_hex8@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <get_hex32+0x1a>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hex32>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <get_hex8@plt>
mov    %eax,%r14d
lea    0x2(%rbx),%rdi
call   1030 <get_hex8@plt>
mov    %eax,%r15d
shl    $0x10,%r14d
shl    $0x8,%r15d
lea    0x4(%rbx),%rdi
call   1030 <get_hex8@plt>
mov    %eax,%ebp
or     %r14d,%ebp
or     %r15d,%ebp
shl    $0x8,%ebp
add    $0x6,%rbx
mov    %rbx,%rdi
call   1030 <get_hex8@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @get_hex32(i8* %0) {
%2 = tail call i32 @get_hex8(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = tail call i32 @get_hex8(i8* %3)
%5 = shl i32 %2, 16
%6 = shl i32 %4, 8
%7 = or i32 %5, %6
%8 = getelementptr inbounds i8, i8* %0, i64 4
%9 = tail call i32 @get_hex8(i8* %8)
%10 = or i32 %9, %7
%11 = shl i32 %10, 8
%12 = getelementptr inbounds i8, i8* %0, i64 6
%13 = tail call i32 @get_hex8(i8* %12)
%14 = or i32 %13, %11
ret i32 %14
}
void init_filesize() {}


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

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

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

LLVM IR (-O2):
define void @init_filesize() {
ret void
}
struct s3c2400_mmc *s3c2400_get_base_mmc(void) {
  return (struct s3c2400_mmc *)0x15A00000;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x15a00000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x15a00000,%eax
ret

LLVM IR (-O0):
%struct.s3c2400_mmc = type opaque
define %struct.s3c2400_mmc* @s3c2400_get_base_mmc() {
ret %struct.s3c2400_mmc* inttoptr (i64 362807296 to %struct.s3c2400_mmc*)
}

LLVM IR (-O2):
%struct.s3c2400_mmc = type opaque
define %struct.s3c2400_mmc* @s3c2400_get_base_mmc() {
ret %struct.s3c2400_mmc* inttoptr (i64 362807296 to %struct.s3c2400_mmc*)
}