xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ismtp_write_data(int, char *);
int /*<<< orphan*/ msmtp_write_data(int, char *);
scalar_t__ use_mailer();
void smtp_write_data(int fd, char *p) {
  if (use_mailer())
    msmtp_write_data(fd, p);
  else
    ismtp_write_data(fd, p);
}


x86 assembly (clang, -O0):
<smtp_write_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <use_mailer@plt>
cmp    $0x0,%rax
je     1161 <smtp_write_data+0x31>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <msmtp_write_data@plt>
jmp    116d <smtp_write_data+0x3d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <ismtp_write_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smtp_write_data>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <use_mailer@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
test   %rax,%rax
je     1154 <smtp_write_data+0x24>
pop    %rbx
pop    %rbp
jmp    1030 <msmtp_write_data@plt>
pop    %rbx
pop    %rbp
jmp    1040 <ismtp_write_data@plt>

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

LLVM IR (-O2):
define void @smtp_write_data(i32 %0, i8* %1) {
%3 = tail call i64 (...) @use_mailer()
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @msmtp_write_data(i32 %0, i8* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @ismtp_write_data(i32 %0, i8* %1)
br label %9
9: ; preds = %7, %5
ret void
}
void mock_flush(void) {}


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

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

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

LLVM IR (-O2):
define void @mock_flush() {
ret void
}
int vlc_ascii_tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    return c + ('a' - 'A');
  else
    return c;
}


x86 assembly (clang, -O0):
<vlc_ascii_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <vlc_ascii_tolower+0x29>
cmpl   $0x5a,-0x8(%rbp)
jg     1129 <vlc_ascii_tolower+0x29>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <vlc_ascii_tolower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlc_ascii_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @vlc_ascii_tolower(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 %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @vlc_ascii_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t fake_shift_needed(uint16_t scan) {
  switch (scan) {
  case 0x147:
  case 0x148:
  case 0x149:
  case 0x14a:
  case 0x14d:
  case 0x14f:
  case 0x150:
  case 0x151:
  case 0x152:
  case 0x153:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<fake_shift_needed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffeb9,%eax
sub    $0x4,%eax
jb     1149 <fake_shift_needed+0x49>
jmp    1120 <fake_shift_needed+0x20>
mov    -0xc(%rbp),%eax
sub    $0x14d,%eax
je     1149 <fake_shift_needed+0x49>
jmp    1133 <fake_shift_needed+0x33>
mov    -0xc(%rbp),%eax
add    $0xfffffeb1,%eax
sub    $0x4,%eax
ja     1155 <fake_shift_needed+0x55>
jmp    1149 <fake_shift_needed+0x49>
movl   $0x1,-0x4(%rbp)
jmp    115c <fake_shift_needed+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fake_shift_needed>:
add    $0xfffffeb9,%edi
xor    %eax,%eax
cmp    $0xc,%edi
ja     111a <fake_shift_needed+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @fake_shift_needed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 327, label %5
i32 328, label %5
i32 329, label %5
i32 330, label %5
i32 333, label %5
i32 335, label %5
i32 336, label %5
i32 337, label %5
i32 338, label %5
i32 339, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@switch.table.fake_shift_needed = [13 x i32] [i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1]
define i32 @fake_shift_needed(i32 %0) {
%2 = add i32 %0, -327
%3 = icmp ult i32 %2, 13
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [13 x i32], [13 x i32]* @switch.table.fake_shift_needed, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
void foo(char *x) {
  int i;
  for (i = 0; i < 2; i++)
    ;
  x[i + i] = '\0';
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    112c <foo+0x2c>
jmp    111e <foo+0x1e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <foo+0xf>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    -0xc(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movb   $0x0,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @foo(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
store i8 0, i8* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
int main(int argc, char *argv[]) {
  foo("this is a test.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"this is a test.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @foo(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"this is a test.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int fun1022() { return 1022; }


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

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

LLVM IR (-O0):
define i32 @fun1022() {
ret i32 1022
}

LLVM IR (-O2):
define i32 @fun1022() {
ret i32 1022
}
/* Variables and functions */
int pop();
int /*<<< orphan*/ push(int);
void mul(void) { push(pop() * pop()); }


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

x86 assembly (clang, -O2):
<mul>:
push   %rbx
xor    %eax,%eax
call   1030 <pop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <pop@plt>
imul   %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @mul() {
%1 = call i32 (...) @pop()
%2 = call i32 (...) @pop()
%3 = mul nsw i32 %1, %2
%4 = call i32 @push(i32 %3)
ret void
}

LLVM IR (-O2):
define void @mul() {
%1 = tail call i32 (...) @pop()
%2 = tail call i32 (...) @pop()
%3 = mul nsw i32 %2, %1
%4 = tail call i32 @push(i32 %3)
ret void
}
void baz_ldouble_t(long double *x) { *x = __imag foo_ldouble_t(5); }


x86 assembly (clang, -O0):
<baz_ldouble_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    $0x5,%edi
call   1030 <foo_ldouble_t@plt>
mov    -0x8(%rbp),%rax
fldz
fstpt  (%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz_ldouble_t>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <foo_ldouble_t@plt>
fldz
fstpt  (%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @baz_ldouble_t(x86_fp80* %0) {
%2 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @foo_ldouble_t to i32 (i32, ...)*)(i32 5)
%4 = load x86_fp80*, x86_fp80** %2
store x86_fp80 0xK00000000000000000000, x86_fp80* %4
ret void
}

LLVM IR (-O2):
define void @baz_ldouble_t(x86_fp80* nocapture writeonly %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo_ldouble_t to i32 (i32, ...)*)(i32 5)
store x86_fp80 0xK00000000000000000000, x86_fp80* %0
ret void
}
/* Type definitions */
struct sigaction {
  int /*<<< orphan*/ sa_mask;
  scalar_t__ sa_flags;
  scalar_t__ sa_handler;
};

/* Variables and functions */
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             struct sigaction *);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
main() {
  struct sigaction sa;
  sa.sa_handler = 0;
  sa.sa_flags = 0;
  sigemptyset(&sa.sa_mask);
  sigaction(0, &sa, (struct sigaction *)0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <sigemptyset@plt>
xor    %edi,%edi
lea    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
xor    %edi,%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32, i64, i64 }
define i32 @main() {
%1 = alloca %struct.sigaction
%2 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 2
store i64 0, i64* %2
%3 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 1
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
%5 = call i32 @sigemptyset(i32* %4)
%6 = call i32 @sigaction(i32 0, %struct.sigaction* %1, %struct.sigaction* null)
ret i32 0
}

LLVM IR (-O2):
%struct.sigaction = type { i32, i64, i64 }
define i32 @main() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 1
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
%5 = bitcast i64* %3 to i8*
%6 = call i32 @sigemptyset(i32* %4)
%7 = call i32 @sigaction(i32 0, %struct.sigaction* %1, %struct.sigaction* null)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ generateNextTypes(int *);
int /*<<< orphan*/ shiftNextTypes(int *);
int takeNextType(int *nextTypes) {
  int pieceType = nextTypes[0];
  shiftNextTypes(nextTypes);
  if (nextTypes[7] == -1) {
    generateNextTypes(nextTypes);
  }
  return pieceType;
}


x86 assembly (clang, -O0):
<takeNextType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <shiftNextTypes@plt>
mov    -0x8(%rbp),%rax
cmpl   $0xffffffff,0x1c(%rax)
jne    1155 <takeNextType+0x35>
mov    -0x8(%rbp),%rdi
call   1040 <generateNextTypes@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<takeNextType>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%ebp
call   1030 <shiftNextTypes@plt>
cmpl   $0xffffffff,0x1c(%rbx)
jne    113b <takeNextType+0x1b>
mov    %rbx,%rdi
call   1040 <generateNextTypes@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @takeNextType(i32* %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @shiftNextTypes(i32* %0)
%4 = getelementptr inbounds i32, i32* %0, i64 7
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @generateNextTypes(i32* %0)
br label %9
9: ; preds = %7, %1
ret i32 %2
}
/* Variables and functions */
scalar_t__ already_running();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  if (already_running()) {
    printf("already running\n");
    return -1;
  } else
    printf("does't running");
  sleep(100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <already_running@plt>
cmp    $0x0,%rax
je     1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <main+0x55>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <sleep@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <already_running@plt>
test   %rax,%rax
je     1162 <main+0x22>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
jmp    1178 <main+0x38>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
mov    $0x64,%edi
call   1060 <sleep@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"already running\0A\00"
@.str.1 = [15 x i8] c"does't running\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @already_running()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %10
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = call i32 @sleep(i32 100)
store i32 0, i32* %1
br label %10
10: ; preds = %8, %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"does't running\00"
@str = [16 x i8] c"already running\00"
define i32 @main() {
%1 = tail call i64 (...) @already_running()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @sleep(i32 100)
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ -1, %3 ], [ 0, %5 ]
ret i32 %9
}
/* Variables and functions */
size_t strlen(char *);
int is_array_argument(char *buf) {
  const size_t len = strlen(buf);
  if (']' == buf[len - 1]) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_array_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x5d,%eax
cmp    %ecx,%eax
jne    1152 <is_array_argument+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1159 <is_array_argument+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_array_argument>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmpb   $0x5d,-0x1(%rax,%rbx,1)
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_array_argument(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, -1
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 93
%7 = zext i1 %6 to i32
ret i32 %7
}
unsigned gll_lag_size(unsigned n) { return (n <= 24 ? 1 : 9) * n; }


x86 assembly (clang, -O0):
<gll_lag_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x9,%eax
mov    $0x1,%ecx
cmp    $0x18,%edx
cmovbe %ecx,%eax
imul   -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gll_lag_size>:
xor    %eax,%eax
cmp    $0x19,%edi
setae  %al
lea    0x1(,%rax,8),%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @gll_lag_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ule i32 %3, 24
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 9
%7 = load i32, i32* %2
%8 = mul i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @gll_lag_size(i32 %0) {
%2 = icmp ult i32 %0, 25
%3 = select i1 %2, i32 1, i32 9
%4 = mul i32 %3, %0
ret i32 %4
}
/* Type definitions */
typedef int const u_int32_t;
typedef int u_char;

/* Variables and functions */
u_int32_t __get_unaligned_le32(const u_char *p) {
  return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
}


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

x86 assembly (clang, -O2):
<__get_unaligned_le32>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__get_unaligned_le32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = shl i32 %13, 16
%15 = or i32 %10, %14
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = shl i32 %18, 24
%20 = or i32 %15, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @__get_unaligned_le32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = or i32 %6, %9
%11 = getelementptr inbounds i32, i32* %0, i64 3
%12 = load i32, i32* %11
%13 = shl i32 %12, 24
%14 = or i32 %10, %13
ret i32 %14
}
/* Type definitions */
struct dualtimer_cmsdk_dev_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
dualtimer_cmsdk_enable_timer1(struct dualtimer_cmsdk_dev_t const *);
int /*<<< orphan*/
dualtimer_cmsdk_enable_timer2(struct dualtimer_cmsdk_dev_t const *);
void dualtimer_cmsdk_enable_both_timers(
    const struct dualtimer_cmsdk_dev_t *dev) {
  dualtimer_cmsdk_enable_timer1(dev);
  dualtimer_cmsdk_enable_timer2(dev);
}


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

x86 assembly (clang, -O2):
<dualtimer_cmsdk_enable_both_timers>:
push   %rbx
mov    %rdi,%rbx
call   1030 <dualtimer_cmsdk_enable_timer1@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <dualtimer_cmsdk_enable_timer2@plt>

LLVM IR (-O0):
%struct.dualtimer_cmsdk_dev_t = type { i32 }
define void @dualtimer_cmsdk_enable_both_timers(%struct.dualtimer_cmsdk_dev_t* %0) {
%2 = alloca %struct.dualtimer_cmsdk_dev_t*
store %struct.dualtimer_cmsdk_dev_t* %0, %struct.dualtimer_cmsdk_dev_t** %2
%3 = load %struct.dualtimer_cmsdk_dev_t*, %struct.dualtimer_cmsdk_dev_t** %2
%4 = call i32 @dualtimer_cmsdk_enable_timer1(%struct.dualtimer_cmsdk_dev_t* %3)
%5 = load %struct.dualtimer_cmsdk_dev_t*, %struct.dualtimer_cmsdk_dev_t** %2
%6 = call i32 @dualtimer_cmsdk_enable_timer2(%struct.dualtimer_cmsdk_dev_t* %5)
ret void
}

LLVM IR (-O2):
%struct.dualtimer_cmsdk_dev_t = type { i32 }
define void @dualtimer_cmsdk_enable_both_timers(%struct.dualtimer_cmsdk_dev_t* %0) {
%2 = tail call i32 @dualtimer_cmsdk_enable_timer1(%struct.dualtimer_cmsdk_dev_t* %0)
%3 = tail call i32 @dualtimer_cmsdk_enable_timer2(%struct.dualtimer_cmsdk_dev_t* %0)
ret void
}
void initialize_verify_stack_enumeration() {}


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

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

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

LLVM IR (-O2):
define void @initialize_verify_stack_enumeration() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printer(char *s) { printf("The string = [%s]\n", s); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"The string = [%s]\0A\00"
define void @printer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"The string = [%s]\0A\00"
define void @printer(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int strlen(char *);
void append(char *s, char c) {
  int len = strlen(s);
  s[len] = c;
  s[len + 1] = '\0';
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @append(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8, i8* %4
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %8, i8* %12
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
define void @append(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %1, i8* %5
%6 = add nsw i32 %3, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret void
}
makehimask(nbuf, ng) char *nbuf, *ng;
{
  if (!findex(nbuf, ng))
    (void)sprintf(rindex(nbuf, '\0'), ",!%s", ng);
}


x86 assembly (clang, -O0):
<makehimask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1050 <findex@plt>
cmp    $0x0,%eax
jne    1178 <makehimask+0x48>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <rindex@plt>
mov    %rax,%rdi
mov    -0x18(%rbp),%rdx
lea    0xe8f(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makehimask>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <findex@plt>
test   %eax,%eax
jne    1163 <makehimask+0x33>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <rindex@plt>
lea    0xeaa(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c",!%s\00"
define i32 @makehimask(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @findex to i32 (i8*, i8*, ...)*)(i8* %6, i8* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i8* @rindex(i8* %11, i32 0)
%13 = load i8*, i8** %5
%14 = call i32 (i8*, i8*, ...) @sprintf(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %10, %2
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [5 x i8] c",!%s\00"
define i32 @makehimask(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @findex to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i8* @rindex(i8* %0, i32 0)
%7 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %6, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %5, %2
ret i32 undef
}
int strict_comparison(const void *a, const void *b) {
  return (a == b) ? 0 : -1;
}


x86 assembly (clang, -O0):
<strict_comparison>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strict_comparison>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @strict_comparison(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 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 -1
ret i32 %9
}

LLVM IR (-O2):
define i32 @strict_comparison(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ attachInterrupt(int, void (*)(), int);
int /*<<< orphan*/ ino(int);
void attachInterruptX(int x, int ir, void (*func)(), int mode) {
  ino(x);
  attachInterrupt(ir, func, mode);
  return;
}


x86 assembly (clang, -O0):
<attachInterruptX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ino@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <attachInterrupt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attachInterruptX>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %esi,%ebp
call   1030 <ino@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <attachInterrupt@plt>

LLVM IR (-O0):
define void @attachInterruptX(i32 %0, i32 %1, void (...)* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca void (...)*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store void (...)* %2, void (...)** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = call i32 @ino(i32 %9)
%11 = load i32, i32* %6
%12 = load void (...)*, void (...)** %7
%13 = load i32, i32* %8
%14 = call i32 @attachInterrupt(i32 %11, void (...)* %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @attachInterruptX(i32 %0, i32 %1, void (...)* %2, i32 %3) {
%5 = tail call i32 @ino(i32 %0)
%6 = tail call i32 @attachInterrupt(i32 %1, void (...)* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cicle(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int numb;
  int val;
  printf("input number:");
  scanf("%d", &numb);
  printf("input value:");
  scanf("%d", &val);
  cicle(val, numb);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%esi
call   1030 <cicle@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"input number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"input value:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = load i32, i32* %1
%11 = call i32 @cicle(i32 %9, i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ beast();
int /*<<< orphan*/ man();
int /*<<< orphan*/ rules();
scalar_t__ yes(char *);
int main(int argc, char *argv[]) {
  if (yes("Print rules"))
    rules();
  if (yes("Play first"))
    man();
  for (;;) {
    beast();
    man();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <yes@plt>
cmp    $0x0,%rax
je     1173 <main+0x33>
mov    $0x0,%al
call   1060 <rules@plt>
lea    0xe92(%rip),%rdi
call   1040 <yes@plt>
cmp    $0x0,%rax
je     1190 <main+0x50>
mov    $0x0,%al
call   1050 <man@plt>
jmp    1195 <main+0x55>
mov    $0x0,%al
call   1030 <beast@plt>
mov    $0x0,%al
call   1050 <man@plt>
jmp    1195 <main+0x55>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <yes@plt>
test   %rax,%rax
je     1159 <main+0x19>
xor    %eax,%eax
call   1060 <rules@plt>
lea    0xeac(%rip),%rdi
call   1040 <yes@plt>
test   %rax,%rax
je     1180 <main+0x40>
xor    %eax,%eax
call   1050 <man@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <beast@plt>
xor    %eax,%eax
call   1050 <man@plt>
jmp    1180 <main+0x40>

LLVM IR (-O0):
@.str = [12 x i8] c"Print rules\00"
@.str.1 = [11 x i8] c"Play first\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 @yes(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @rules()
br label %10
10: ; preds = %8, %2
%11 = call i64 @yes(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @man()
br label %15
15: ; preds = %13, %10
br label %16
16: ; preds = %16, %15
%17 = call i32 (...) @beast()
%18 = call i32 (...) @man()
br label %16
}

LLVM IR (-O2):
@.str = [12 x i8] c"Print rules\00"
@.str.1 = [11 x i8] c"Play first\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @yes(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @rules()
br label %7
7: ; preds = %5, %2
%8 = tail call i64 @yes(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (...) @man()
br label %12
12: ; preds = %10, %7
br label %13
13: ; preds = %12, %13
%14 = tail call i32 (...) @beast()
%15 = tail call i32 (...) @man()
br label %13
}
/* Type definitions */
struct cec_msg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cec_msg_htng_init(struct cec_msg *, int);
void cec_msg_htng_clr_all_sleep_wake(struct cec_msg *msg) {
  cec_msg_htng_init(msg, 0x86);
}


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

x86 assembly (clang, -O2):
<cec_msg_htng_clr_all_sleep_wake>:
mov    $0x86,%esi
jmp    1030 <cec_msg_htng_init@plt>

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

LLVM IR (-O2):
%struct.cec_msg = type { i32 }
define void @cec_msg_htng_clr_all_sleep_wake(%struct.cec_msg* %0) {
%2 = tail call i32 @cec_msg_htng_init(%struct.cec_msg* %0, i32 134)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void put_mem(uint32_t address, uint32_t value) {
  *((volatile uint32_t *)address) = value;
}


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

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

LLVM IR (-O0):
define void @put_mem(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i64*
store volatile i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
define void @put_mem(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store volatile i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
void prkalc(int course, double dist) {
  printf(": course %d  dist %.3f\n", course, dist);
}


x86 assembly (clang, -O0):
<prkalc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prkalc>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c": course %d dist %.3f\0A\00"
define void @prkalc(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = load double, double* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5, double %6)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c": course %d dist %.3f\0A\00"
define void @prkalc(i32 %0, double %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, double %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _bytecode_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
uint32_t bytecode_iadd(uint8_t r0, uint8_t r1, uint8_t r2) {
  return _bytecode_write(22, 0, 0, r0, r1, r2);
}


x86 assembly (clang, -O0):
<bytecode_iadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    $0x16,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <_bytecode_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytecode_iadd>:
mov    %edx,%r9d
mov    %esi,%r8d
mov    %edi,%ecx
mov    $0x16,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <_bytecode_write@plt>

LLVM IR (-O0):
define i32 @bytecode_iadd(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 = load i32, i32* %6
%10 = call i32 @_bytecode_write(i32 22, i32 0, i32 0, i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @bytecode_iadd(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_bytecode_write(i32 22, i32 0, i32 0, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef unsigned long uint8_t;

/* Variables and functions */
int /*<<< orphan*/ layer_state_set(unsigned long);
void layer_move(uint8_t layer) { layer_state_set(1UL << layer); }


x86 assembly (clang, -O0):
<layer_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%edi
shl    %cl,%rdi
call   1030 <layer_state_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<layer_move>:
mov    %rdi,%rcx
mov    $0x1,%edi
shl    %cl,%rdi
jmp    1030 <layer_state_set@plt>

LLVM IR (-O0):
define void @layer_move(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 1, %3
%5 = call i32 @layer_state_set(i64 %4)
ret void
}

LLVM IR (-O2):
define void @layer_move(i64 %0) {
%2 = shl nuw i64 1, %0
%3 = tail call i32 @layer_state_set(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sighandler(int sig) {
  printf("SIGINT (%d) cuaght, will print this and continue afterwards\n", sig);
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighandler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"SIGINT (%d) cuaght, will print this and continue afterwards\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"SIGINT (%d) cuaght, will print this and continue afterwards\0A\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nvic_globalirq_disable();
void noInterrupts() { nvic_globalirq_disable(); }


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

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

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

LLVM IR (-O2):
define void @noInterrupts() {
%1 = tail call i32 (...) @nvic_globalirq_disable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PacketFinish();
int /*<<< orphan*/ PacketStart();
void PacketEmpty() {
  PacketStart();
  PacketFinish();
}


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

x86 assembly (clang, -O2):
<PacketEmpty>:
push   %rax
xor    %eax,%eax
call   1030 <PacketStart@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <PacketFinish@plt>

LLVM IR (-O0):
define void @PacketEmpty() {
%1 = call i32 (...) @PacketStart()
%2 = call i32 (...) @PacketFinish()
ret void
}

LLVM IR (-O2):
define void @PacketEmpty() {
%1 = tail call i32 (...) @PacketStart()
%2 = tail call i32 (...) @PacketFinish()
ret void
}
int test_imm_06int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x06 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_06int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 25769803776
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ halt(int);
int /*<<< orphan*/ nxsy();
void org_dir(void) {
  halt(6);
  nxsy();
}


x86 assembly (clang, -O0):
<org_dir>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1040 <halt@plt>
mov    $0x0,%al
call   1030 <nxsy@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<org_dir>:
push   %rax
mov    $0x6,%edi
call   1040 <halt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nxsy@plt>

LLVM IR (-O0):
define void @org_dir() {
%1 = call i32 @halt(i32 6)
%2 = call i32 (...) @nxsy()
ret void
}

LLVM IR (-O2):
define void @org_dir() {
%1 = tail call i32 @halt(i32 6)
%2 = tail call i32 (...) @nxsy()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ putc(unsigned long, int /*<<< orphan*/ *);
int WRITELONG(FILE *fp, unsigned long l) {
  putc(l, fp);
  putc(l >> 8, fp);
  putc(l >> 16, fp);
  return putc(l >> 24, fp) != EOF;
}


x86 assembly (clang, -O0):
<WRITELONG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x10(%rbp),%rdi
shr    $0x8,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x10(%rbp),%rdi
shr    $0x10,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x10(%rbp),%rdi
shr    $0x18,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WRITELONG>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %rbx,%rdi
shr    $0x8,%rdi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %rbx,%rdi
shr    $0x10,%rdi
mov    %r14,%rsi
call   1030 <putc@plt>
shr    $0x18,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    0x2e8f(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @WRITELONG(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i32*, i32** %3
%7 = call i64 @putc(i64 %5, i32* %6)
%8 = load i64, i64* %4
%9 = lshr i64 %8, 8
%10 = load i32*, i32** %3
%11 = call i64 @putc(i64 %9, i32* %10)
%12 = load i64, i64* %4
%13 = lshr i64 %12, 16
%14 = load i32*, i32** %3
%15 = call i64 @putc(i64 %13, i32* %14)
%16 = load i64, i64* %4
%17 = lshr i64 %16, 24
%18 = load i32*, i32** %3
%19 = call i64 @putc(i64 %17, i32* %18)
%20 = load i64, i64* @EOF
%21 = icmp ne i64 %19, %20
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @WRITELONG(i32* nocapture %0, i64 %1) {
%3 = tail call i64 @putc(i64 %1, i32* %0)
%4 = lshr i64 %1, 8
%5 = tail call i64 @putc(i64 %4, i32* %0)
%6 = lshr i64 %1, 16
%7 = tail call i64 @putc(i64 %6, i32* %0)
%8 = lshr i64 %1, 24
%9 = tail call i64 @putc(i64 %8, i32* %0)
%10 = load i64, i64* @EOF
%11 = icmp ne i64 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}