xunge/DecIR huggingface dataset:
int checkChar(char c) {
  if ((c >= 97) || (c <= 122)) {
    if ((c == 'a') || (c == 'e') || (c == 'i') || (c == 'o') || (c == 'u')) {
      return 1;
    } else {
      return 2;
    }
  }
  return 3;
}


x86 assembly (clang, -O0):
<checkChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jge    1124 <checkChar+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     117d <checkChar+0x7d>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
je     1165 <checkChar+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x65,%eax
je     1165 <checkChar+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x69,%eax
je     1165 <checkChar+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x6f,%eax
je     1165 <checkChar+0x65>
movsbl -0x5(%rbp),%eax
cmp    $0x75,%eax
jne    1171 <checkChar+0x71>
movl   $0x1,-0x4(%rbp)
jmp    1184 <checkChar+0x84>
movl   $0x2,-0x4(%rbp)
jmp    1184 <checkChar+0x84>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkChar>:
mov    %edi,%eax
and    $0xfb,%al
cmp    $0x61,%al
sete   %al
cmp    $0x69,%dil
sete   %cl
cmp    $0x6f,%dil
sete   %dl
or     %cl,%dl
or     %al,%dl
cmp    $0x75,%dil
sete   %al
or     %dl,%al
movzbl %al,%ecx
mov    $0x2,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @checkChar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %33
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 97
br i1 %14, label %31, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 101
br i1 %18, label %31, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 105
br i1 %22, label %31, label %23
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 111
br i1 %26, label %31, label %27
27: ; preds = %23
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 117
br i1 %30, label %31, label %32
31: ; preds = %27, %23, %19, %15, %11
store i32 1, i32* %2
br label %34
32: ; preds = %27
store i32 2, i32* %2
br label %34
33: ; preds = %7
store i32 3, i32* %2
br label %34
34: ; preds = %33, %32, %31
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
define i32 @checkChar(i8 signext %0) {
%2 = and i8 %0, -5
%3 = icmp eq i8 %2, 97
%4 = icmp eq i8 %0, 105
%5 = or i1 %4, %3
%6 = icmp eq i8 %0, 111
%7 = or i1 %6, %5
%8 = icmp eq i8 %0, 117
%9 = or i1 %8, %7
%10 = select i1 %9, i32 1, i32 2
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ TransformAlarmC__2__AlarmFrom__fired();
void Msp430AlarmC__2__Alarm__fired(void) {
  TransformAlarmC__2__AlarmFrom__fired();
}


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

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

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

LLVM IR (-O2):
define void @Msp430AlarmC__2__Alarm__fired() {
%1 = tail call i32 (...) @TransformAlarmC__2__AlarmFrom__fired()
ret void
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};
typedef int /*<<< orphan*/ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ INADDR_NONE;
int /*<<< orphan*/ inet_aton(char const *, struct in_addr *);
in_addr_t inet_addr(const char *cp) {
  struct in_addr a;
  if (!inet_aton(cp, &a))
    return INADDR_NONE;
  else
    return a.s_addr;
}


x86 assembly (clang, -O0):
<inet_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <inet_aton@plt>
cmp    $0x0,%eax
jne    1143 <inet_addr+0x33>
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <inet_addr+0x39>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_addr>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <inet_aton@plt>
test   %eax,%eax
jne    112d <inet_addr+0x1d>
mov    0x2ebb(%rip),%rbx
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@INADDR_NONE = global i32 0
define i32 @inet_addr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.in_addr
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @inet_aton(i8* %5, %struct.in_addr* %4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load i32, i32* @INADDR_NONE
store i32 %9, i32* %2
br label %13
10: ; preds = %1
%11 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@INADDR_NONE = global i32 0
define i32 @inet_addr(i8* %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = call i32 @inet_aton(i8* %0, %struct.in_addr* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @INADDR_NONE
%9 = select i1 %5, i32 %8, i32 %7
ret i32 %9
}
void consome(int buffer[]) {}


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

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

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

LLVM IR (-O2):
define void @consome(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_ceil();
int /*<<< orphan*/ test_exceptions();
int /*<<< orphan*/ test_exp();
int /*<<< orphan*/ test_floor();
int /*<<< orphan*/ test_htrig();
int /*<<< orphan*/ test_inverse_tan();
int /*<<< orphan*/ test_inverse_trig();
int /*<<< orphan*/ test_log();
int /*<<< orphan*/ test_sqrt();
int /*<<< orphan*/ test_trig();
void main() {
  test_exceptions();
  test_ceil();
  test_floor();
  test_trig();
  test_inverse_tan();
  test_inverse_trig();
  test_htrig();
  test_sqrt();
  test_exp();
  test_log();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <test_exceptions@plt>
mov    $0x0,%al
call   10c0 <test_ceil@plt>
mov    $0x0,%al
call   1090 <test_floor@plt>
mov    $0x0,%al
call   1070 <test_trig@plt>
mov    $0x0,%al
call   10a0 <test_inverse_tan@plt>
mov    $0x0,%al
call   1030 <test_inverse_trig@plt>
mov    $0x0,%al
call   10b0 <test_htrig@plt>
mov    $0x0,%al
call   1040 <test_sqrt@plt>
mov    $0x0,%al
call   1050 <test_exp@plt>
mov    $0x0,%al
call   1080 <test_log@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_exceptions@plt>
xor    %eax,%eax
call   10c0 <test_ceil@plt>
xor    %eax,%eax
call   1090 <test_floor@plt>
xor    %eax,%eax
call   1070 <test_trig@plt>
xor    %eax,%eax
call   10a0 <test_inverse_tan@plt>
xor    %eax,%eax
call   1030 <test_inverse_trig@plt>
xor    %eax,%eax
call   10b0 <test_htrig@plt>
xor    %eax,%eax
call   1040 <test_sqrt@plt>
xor    %eax,%eax
call   1050 <test_exp@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <test_log@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @test_exceptions()
%2 = call i32 (...) @test_ceil()
%3 = call i32 (...) @test_floor()
%4 = call i32 (...) @test_trig()
%5 = call i32 (...) @test_inverse_tan()
%6 = call i32 (...) @test_inverse_trig()
%7 = call i32 (...) @test_htrig()
%8 = call i32 (...) @test_sqrt()
%9 = call i32 (...) @test_exp()
%10 = call i32 (...) @test_log()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @test_exceptions()
%2 = tail call i32 (...) @test_ceil()
%3 = tail call i32 (...) @test_floor()
%4 = tail call i32 (...) @test_trig()
%5 = tail call i32 (...) @test_inverse_tan()
%6 = tail call i32 (...) @test_inverse_trig()
%7 = tail call i32 (...) @test_htrig()
%8 = tail call i32 (...) @test_sqrt()
%9 = tail call i32 (...) @test_exp()
%10 = tail call i32 (...) @test_log()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fatal_error(const char *err) {
  fprintf(stderr, "ERROR: %s\n", err);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @fatal_error(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 ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @fatal_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void yy_1_ListPrefix(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_ListPrefix(i8* nocapture %0, i32 %1) {
ret void
}
Tot(int x[]) {
  int tot;
  tot = (x[1] + x[0] * 12) * 30 + x[2];
  return (tot);
}


x86 assembly (clang, -O0):
<Tot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
imul   $0xc,(%rcx),%ecx
add    %ecx,%eax
imul   $0x1e,%eax,%eax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tot>:
mov    (%rdi),%eax
lea    (%rax,%rax,2),%ecx
shl    $0x2,%ecx
add    0x4(%rdi),%ecx
mov    %ecx,%eax
shl    $0x5,%eax
sub    %ecx,%eax
sub    %ecx,%eax
add    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @Tot(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 1
%6 = load i32, i32* %5
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 12
%11 = add nsw i32 %6, %10
%12 = mul nsw i32 %11, 30
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = add nsw i32 %12, %15
store i32 %16, i32* %3
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @Tot(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = load i32, i32* %0
%5 = mul nsw i32 %4, 12
%6 = add nsw i32 %5, %3
%7 = mul nsw i32 %6, 30
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ PTHREAD_CREATE_DETACHED;
int /*<<< orphan*/ pthread_attr_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_attr_setdetachstate(int /*<<< orphan*/ *,
                                               int /*<<< orphan*/);
int /*<<< orphan*/ pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  void *(*)(void *), void *);
void create_detached(void *(*entrypoint)(void *), void *arg) {
  pthread_t thread;
  pthread_attr_t attr;
  pthread_attr_init(&attr);
  pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
  pthread_create(&thread, &attr, entrypoint, arg);
}


x86 assembly (clang, -O0):
<create_detached>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <pthread_attr_init@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rdi
call   1040 <pthread_attr_setdetachstate@plt>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <pthread_create@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_detached>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <pthread_attr_init@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <pthread_attr_setdetachstate@plt>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1050 <pthread_create@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@PTHREAD_CREATE_DETACHED = global i32 0
define void @create_detached(i8* (i8*)* %0, i8* %1) {
%3 = alloca i8* (i8*)*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* (i8*)* %0, i8* (i8*)** %3
store i8* %1, i8** %4
%7 = call i32 @pthread_attr_init(i32* %6)
%8 = load i32, i32* @PTHREAD_CREATE_DETACHED
%9 = call i32 @pthread_attr_setdetachstate(i32* %6, i32 %8)
%10 = load i8* (i8*)*, i8* (i8*)** %3
%11 = load i8*, i8** %4
%12 = call i32 @pthread_create(i32* %5, i32* %6, i8* (i8*)* %10, i8* %11)
ret void
}

LLVM IR (-O2):
@PTHREAD_CREATE_DETACHED = global i32 0
define void @create_detached(i8* (i8*)* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @pthread_attr_init(i32* %4)
%8 = load i32, i32* @PTHREAD_CREATE_DETACHED
%9 = call i32 @pthread_attr_setdetachstate(i32* %4, i32 %8)
%10 = call i32 @pthread_create(i32* %3, i32* %4, i8* (i8*)* %0, i8* %1)
ret void
}
const char *fdevent_show_event_handlers(void) {
  return "\nEvent Handlers:\n\n"
         "\t- select (generic)\n"
         "\t- poll (Unix)\n"
         "\t- epoll (Linux)\n"
         "\t- /dev/poll (Solaris)\n"
         "\t- eventports (Solaris)\n"
         "\t- kqueue (FreeBSD)\n"
         "\t- libev (generic)\n";
}


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

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

LLVM IR (-O0):
@.str = [157 x i8] c"\0AEvent Handlers:\0A\0A\09- select (generic)\0A\09- poll (Unix)\0A\09- epoll (Linux)\0A\09- /dev/poll (Solaris)\0A\09- eventports (Solaris)\0A\09- kqueue (FreeBSD)\0A\09- libev (generic)\0A\00"
define i8* @fdevent_show_event_handlers() {
ret i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [157 x i8] c"\0AEvent Handlers:\0A\0A\09- select (generic)\0A\09- poll (Unix)\0A\09- epoll (Linux)\0A\09- /dev/poll (Solaris)\0A\09- eventports (Solaris)\0A\09- kqueue (FreeBSD)\0A\09- libev (generic)\0A\00"
define i8* @fdevent_show_event_handlers() {
ret i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sagetv_free(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<sagetv_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @sagetv_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
float fmin(float, float);
void vec2_min(float *dst, float *b) {
  dst[0] = fmin(dst[0], b[0]);
  dst[1] = fmin(dst[1], b[1]);
}


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

x86 assembly (clang, -O2):
<vec2_min>:
movss  (%rsi),%xmm0
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm2
movaps %xmm1,%xmm3
cmpunordss %xmm1,%xmm3
movaps %xmm3,%xmm4
andps  %xmm0,%xmm4
minss  %xmm1,%xmm0
andnps %xmm0,%xmm3
orps   %xmm4,%xmm3
movss  %xmm3,(%rdi)
movss  0x4(%rsi),%xmm0
movaps %xmm2,%xmm1
cmpunordss %xmm2,%xmm1
movaps %xmm1,%xmm3
andps  %xmm0,%xmm3
minss  %xmm2,%xmm0
andnps %xmm0,%xmm1
orps   %xmm3,%xmm1
movss  %xmm1,0x4(%rdi)
ret

LLVM IR (-O0):
define void @vec2_min(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 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = call float @fmin(float %7, float %10)
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float*, float** %3
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 1
%19 = load float, float* %18
%20 = call float @fmin(float %16, float %19)
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 1
store float %20, float* %22
ret void
}

LLVM IR (-O2):
define void @vec2_min(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = tail call nsz float @llvm.minnum.f32(float %3, float %4)
store float %5, float* %0
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %1, i64 1
%9 = load float, float* %8
%10 = tail call nsz float @llvm.minnum.f32(float %7, float %9)
store float %10, float* %6
ret void
}
int test1(int x) { return -(x >> ((sizeof(int) * 8) - 1)); }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 31
%5 = sub nsw i32 0, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @test1(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
char *get_trace_from_stack(void **stack, int size) { return ""; }


x86 assembly (clang, -O0):
<get_trace_from_stack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeee(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @get_trace_from_stack(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @get_trace_from_stack(i8** nocapture readnone %0, i32 %1) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ is_black(char);
char is_white(char p) { return !is_black(p); }


x86 assembly (clang, -O0):
<is_white>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <is_black@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_white>:
push   %rax
call   1030 <is_black@plt>
test   %eax,%eax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @is_white(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @is_black(i8 signext %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @is_white(i8 signext %0) {
%2 = tail call i32 @is_black(i8 signext %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ ArgText();
int /*<<< orphan*/ Me();
int /*<<< orphan*/ SetPrompt(int /*<<< orphan*/, char *);
char *TextOf(int /*<<< orphan*/);
void Act_Prompt(void) {
  char *a = TextOf(ArgText());
  SetPrompt(Me(), a);
}


x86 assembly (clang, -O0):
<Act_Prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <Me@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <SetPrompt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_Prompt>:
push   %rbx
xor    %eax,%eax
call   1040 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <Me@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <SetPrompt@plt>

LLVM IR (-O0):
define void @Act_Prompt() {
%1 = alloca i8*
%2 = call i32 (...) @ArgText()
%3 = call i8* @TextOf(i32 %2)
store i8* %3, i8** %1
%4 = call i32 (...) @Me()
%5 = load i8*, i8** %1
%6 = call i32 @SetPrompt(i32 %4, i8* %5)
ret void
}

LLVM IR (-O2):
define void @Act_Prompt() {
%1 = tail call i32 (...) @ArgText()
%2 = tail call i8* @TextOf(i32 %1)
%3 = tail call i32 (...) @Me()
%4 = tail call i32 @SetPrompt(i32 %3, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntDisable(int /*<<< orphan*/);
int /*<<< orphan*/ IntUnregister(int /*<<< orphan*/);
int /*<<< orphan*/ _OneWireIntNumberGet(int /*<<< orphan*/);
void OneWireIntUnregister(uint32_t ui32Base) {
  uint32_t ui32Int;
  ;
  ui32Int = _OneWireIntNumberGet(ui32Base);
  ;
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<OneWireIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_OneWireIntNumberGet@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <IntDisable@plt>
mov    -0x8(%rbp),%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OneWireIntUnregister>:
push   %rbx
call   1040 <_OneWireIntNumberGet@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <IntDisable@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @OneWireIntUnregister(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @_OneWireIntNumberGet(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @IntDisable(i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @IntUnregister(i32 %8)
ret void
}

LLVM IR (-O2):
define void @OneWireIntUnregister(i32 %0) {
%2 = tail call i32 @_OneWireIntNumberGet(i32 %0)
%3 = tail call i32 @IntDisable(i32 %2)
%4 = tail call i32 @IntUnregister(i32 %2)
ret void
}
double toRadians(double angle) { return angle / 180.0 * 3.141592653589793238; }


x86 assembly (clang, -O0):
<toRadians>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<toRadians>:
divsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @toRadians(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.800000e+02
%5 = fmul double %4, 0x400921FB54442D18
ret double %5
}

LLVM IR (-O2):
define double @toRadians(double %0) {
%2 = fdiv double %0, 1.800000e+02
%3 = fmul double %2, 0x400921FB54442D18
ret double %3
}
void cppExec(char *file) {}


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

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

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

LLVM IR (-O2):
define void @cppExec(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int clear_dobldobl_data(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(238, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<clear_dobldobl_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xee,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_dobldobl_data>:
mov    $0xee,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @clear_dobldobl_data() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 238, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_dobldobl_data() {
%1 = tail call i32 @_ada_use_c2phc(i32 238, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
scalar_t__ atan(double);
int /*<<< orphan*/ link_failure_atan();
void test_atan(double d) {
  if (atan(d) != atan(d))
    link_failure_atan();
}


x86 assembly (clang, -O0):
<test_atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <atan@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <atan@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_atan+0x3c>
mov    $0x0,%al
call   1030 <link_failure_atan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_atan>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <atan@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <atan@plt>
cmp    %rax,%rbx
jne    1149 <test_atan+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_atan@plt>

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

LLVM IR (-O2):
define void @test_atan(double %0) {
%2 = tail call i64 @atan(double %0)
%3 = tail call i64 @atan(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_atan()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
void oops(char *s1, char *s2) {
  fprintf(stderr, "Error: %s\n", s1);
  perror(s2);
  exit(1);
}


x86 assembly (clang, -O0):
<oops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<oops>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @oops(i8* %0, i8* nocapture %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @perror(i8* %1)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dec2bin(char *, int);
int /*<<< orphan*/ printf(char *);
void bit_shift_right(int flag, int offset) {
  dec2bin("   flag ", flag);
  dec2bin(" offset ", offset);
  dec2bin("<< (<<) ", flag << offset);
  printf("\n");
}


x86 assembly (clang, -O0):
<bit_shift_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1040 <dec2bin@plt>
mov    -0x8(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1040 <dec2bin@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
shl    %cl,%esi
lea    0xeb7(%rip),%rdi
call   1040 <dec2bin@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_shift_right>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%esi
call   1040 <dec2bin@plt>
lea    0xecd(%rip),%rdi
mov    %ebx,%esi
call   1040 <dec2bin@plt>
mov    %ebx,%ecx
shl    %cl,%ebp
lea    0xec4(%rip),%rdi
mov    %ebp,%esi
call   1040 <dec2bin@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [9 x i8] c" flag \00"
@.str.1 = [9 x i8] c" offset \00"
@.str.2 = [9 x i8] c"<< (<<) \00"
@.str.3 = [2 x i8] c"\0A\00"
define void @bit_shift_right(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @dec2bin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @dec2bin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = shl i32 %9, %10
%12 = call i32 @dec2bin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c" flag \00"
@.str.1 = [9 x i8] c" offset \00"
@.str.2 = [9 x i8] c"<< (<<) \00"
define void @bit_shift_right(i32 %0, i32 %1) {
%3 = tail call i32 @dec2bin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @dec2bin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%5 = shl i32 %0, %1
%6 = tail call i32 @dec2bin(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(double *array, int n) {
  for (int i = 0; i < n; i++)
    printf("%f ", array[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <print+0x4b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1159 <print+0x39>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f \00"
define void @print(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds double, double* %0, i64 %9
%11 = load double, double* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *substring(char *, int, int);
int main() {
  char s[] = "Hello, my darling wife.";
  char *ss;
  printf("string = [%s]\n", s);
  ss = substring(s, 18, 21);
  printf("substring = [%s]\n", ss);
  free(ss);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x12,%esi
mov    $0x15,%edx
call   1050 <substring@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x2e656669772067,%rax
mov    %rax,0x10(%rsp)
lea    0xec5(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
mov    $0x15,%edx
call   1050 <substring@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [24 x i8] c"Hello, my darling wife.\00"
@.str = [15 x i8] c"string = [%s]\0A\00"
@.str.1 = [18 x i8] c"substring = [%s]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [24 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [24 x i8]* %2 to i8*
%5 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%8 = call i8* @substring(i8* %7, i32 18, i32 21)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [24 x i8] c"Hello, my darling wife.\00"
@.str = [15 x i8] c"string = [%s]\0A\00"
@.str.1 = [18 x i8] c"substring = [%s]\0A\00"
define i32 @main() {
%1 = alloca [24 x i8]
%2 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @substring(i8* %2, i32 18, i32 21)
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @free(i8* %4)
ret i32 0
}
/* Variables and functions */
double mean(double const, int const);
double variance(const double sum, const double sumofsquares, const int n) {
  double meanofsum;
  meanofsum = mean(sum, n);
  return (mean(sumofsquares, n) - (meanofsum * meanofsum));
}


x86 assembly (clang, -O0):
<variance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <mean@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <mean@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<variance>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movsd  %xmm1,0x8(%rsp)
call   1030 <mean@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
mov    %ebx,%edi
call   1030 <mean@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @variance(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%8 = load double, double* %4
%9 = load i32, i32* %6
%10 = call double @mean(double %8, i32 %9)
store double %10, double* %7
%11 = load double, double* %5
%12 = load i32, i32* %6
%13 = call double @mean(double %11, i32 %12)
%14 = load double, double* %7
%15 = load double, double* %7
%16 = fneg double %14
%17 = call double @llvm.fmuladd.f64(double %16, double %15, double %13)
ret double %17
}

LLVM IR (-O2):
define double @variance(double %0, double %1, i32 %2) {
%4 = tail call double @mean(double %0, i32 %2)
%5 = tail call double @mean(double %1, i32 %2)
%6 = fneg double %4
%7 = tail call double @llvm.fmuladd.f64(double %6, double %4, double %5)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ print_it(char *);
int print_routine(char *name) {
  print_it(name);
  return 0;
}


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

x86 assembly (clang, -O2):
<print_routine>:
push   %rax
call   1030 <print_it@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @print_routine(i8* %0) {
%2 = tail call i32 @print_it(i8* %0)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ __u16;

/* Variables and functions */
int cec_is_unconfigured(__u16 log_addr_mask) { return log_addr_mask == 0; }


x86 assembly (clang, -O0):
<cec_is_unconfigured>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_is_unconfigured>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @cec_is_unconfigured(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @cec_is_unconfigured(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void sigint_handler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @sigint_handler(i32 %0) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_create_Jacobian_evaluator(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(148, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_create_Jacobian_evaluator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x94,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_create_Jacobian_evaluator>:
mov    $0x94,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syscon_create_Jacobian_evaluator() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 148, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_create_Jacobian_evaluator() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 148, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void brcmf_proto_msgbuf_detach(struct brcmf_pub *drvr) {}


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

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

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

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
define void @brcmf_proto_msgbuf_detach(%struct.brcmf_pub* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heart_shape(int);
void init(void) { heart_shape(((1 << 8) - 1)); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
call   1030 <heart_shape@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
mov    $0xff,%edi
jmp    1030 <heart_shape@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 @heart_shape(i32 255)
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 @heart_shape(i32 255)
ret void
}
char *decimal_padZero(char *buf, int count) {
  for (; count > 0; --count) {
    *buf++ = '0';
  }
  return buf;
}


x86 assembly (clang, -O0):
<decimal_padZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1135 <decimal_padZero+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x30,(%rax)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <decimal_padZero+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal_padZero>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1136 <decimal_padZero+0x26>
mov    %esi,%ebx
mov    %esi,%edx
mov    %r14,%rdi
mov    $0x30,%esi
call   1030 <memset@plt>
add    $0xffffffff,%ebx
add    %rbx,%r14
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @decimal_padZero(i8* writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = add nsw i32 %1, -1
%7 = zext i32 %6 to i64
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr i8, i8* %0, i64 %8
br label %10
10: ; preds = %4, %2
%11 = phi i8* [ %0, %2 ], [ %9, %4 ]
ret i8* %11
}
/* Variables and functions */
unsigned long _find_next_bit(unsigned long const *, unsigned long,
                             unsigned long, unsigned long);
unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
                                 unsigned long offset) {
  return _find_next_bit(addr, size, offset, ~0UL);
}


x86 assembly (clang, -O0):
<find_next_zero_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xffffffffffffffff,%rcx
call   1030 <_find_next_bit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_next_zero_bit>:
mov    $0xffffffffffffffff,%rcx
jmp    1030 <_find_next_bit@plt>

LLVM IR (-O0):
define i64 @find_next_zero_bit(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i64 @_find_next_bit(i64* %7, i64 %8, i64 %9, i64 -1)
ret i64 %10
}

LLVM IR (-O2):
define i64 @find_next_zero_bit(i64* %0, i64 %1, i64 %2) {
%4 = tail call i64 @_find_next_bit(i64* %0, i64 %1, i64 %2, i64 -1)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void prochead(int osvers, int osrel, int ossub) {
  printf("pswch/s devintr/s  clones/s  loadavg1 loadavg5 loadavg15  "
         "     _load_");
}


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

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

LLVM IR (-O0):
@.str = [70 x i8] c"pswch/s devintr/s clones/s loadavg1 loadavg5 loadavg15 _load_\00"
define void @prochead(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 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"pswch/s devintr/s clones/s loadavg1 loadavg5 loadavg15 _load_\00"
define void @prochead(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ access_index_4(int *);
int *malloc(int);
void call_access_index_4_on_malloced_array_Bad() {
  int *ptr = malloc(sizeof(int) * 4);
  access_index_4(ptr);
}


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

x86 assembly (clang, -O2):
<call_access_index_4_on_malloced_array_Bad>:
push   %rax
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <access_index_4@plt>

LLVM IR (-O0):
define void @call_access_index_4_on_malloced_array_Bad() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 16)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @access_index_4(i32* %3)
ret void
}

LLVM IR (-O2):
define void @call_access_index_4_on_malloced_array_Bad() {
%1 = tail call i32* @malloc(i32 16)
%2 = tail call i32 @access_index_4(i32* %1)
ret void
}