xunge/DecIR huggingface dataset:
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
uint8_t osmo_char2bcd(char c) { return c - 0x30; }


x86 assembly (clang, -O0):
<osmo_char2bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<osmo_char2bcd>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @osmo_char2bcd(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @osmo_char2bcd(i8 signext %0) {
%2 = add i8 %0, -48
ret i8 %2
}
int do_805() { return 805; }


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

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

LLVM IR (-O0):
define i32 @do_805() {
ret i32 805
}

LLVM IR (-O2):
define i32 @do_805() {
ret i32 805
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int stringToInt(char *);
int main() {
  char str[] = "15634";
  int result = stringToInt(str);
  printf("int is = %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <stringToInt@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x34,0x4(%rsp)
movl   $0x33363531,(%rsp)
mov    %rsp,%rdi
call   1040 <stringToInt@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [6 x i8] c"15634\00"
@.str = [13 x i8] c"int is = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%6 = call i32 @stringToInt(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [6 x i8] c"15634\00"
@.str = [13 x i8] c"int is = %d\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @stringToInt(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ printf(char *, double);
int main() {
  double my_value;
  char my_string[] = "+1776.23";
  my_value = atof(my_string);
  printf("%f\n", my_value);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x19(%rbp)
mov    0xec8(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x19(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.my_string = [9 x i8] c"+1776.23\00"
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca [9 x i8]
store i32 0, i32* %1
%4 = bitcast [9 x i8]* %3 to i8*
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%6 = call double @atof(i8* %5)
store double %6, double* %2
%7 = load double, double* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.my_string = [9 x i8] c"+1776.23\00"
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call double @atof(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__const.main.my_string, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
void SkipChar(char **CurChar) {
  if (*(*CurChar) == ' ' || *(*CurChar) == '\t') {
    CurChar++;
  }
}


x86 assembly (clang, -O0):
<SkipChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     112e <SkipChar+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    113a <SkipChar+0x3a>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @SkipChar(i8** nocapture %0) {
ret void
}
/* Type definitions */
struct Counter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Counter *);
void dispose(struct Counter *c) { free(c); }


x86 assembly (clang, -O0):
<dispose>:
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):
<dispose>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.Counter = type { i32 }
define void @dispose(%struct.Counter* nocapture %0) {
%2 = tail call i32 @free(%struct.Counter* %0)
ret void
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(char, int);
void tx(char c) {
  while ((inb(0x3fd) & 0x20) == 0)
    ;
  outb(c, 0x3f8);
}


x86 assembly (clang, -O0):
<tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3fd,%edi
call   1040 <inb@plt>
and    $0x20,%eax
cmp    $0x0,%eax
jne    1149 <tx+0x29>
jmp    112e <tx+0xe>
mov    $0x3f8,%esi
movsbl -0x1(%rbp),%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x3fd,%edi
call   1040 <inb@plt>
test   $0x20,%al
je     1130 <tx+0x10>
movsbl %bl,%edi
mov    $0x3f8,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @tx(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = call i32 @inb(i32 1021)
%5 = and i32 %4, 32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
%10 = call i32 @outb(i8 signext %9, i32 1016)
ret void
}

LLVM IR (-O2):
define void @tx(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @inb(i32 1021)
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call i32 @outb(i8 signext %0, i32 1016)
ret void
}
int main() {
  int a = 99;
  int b = 47;
  return a | b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x63,-0x8(%rbp)
movl   $0x2f,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 99, i32* %2
store i32 47, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = or i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 111
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
void test_vorr_s16x4(int16_t *__restrict__ dest, int16_t *a, int16_t *b) {
  int i;
  for (i = 0; i < 4; i++) {
    dest[i] = a[i] | b[i];
  }
}


x86 assembly (clang, -O0):
<test_vorr_s16x4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    1150 <test_vorr_s16x4+0x50>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
or     (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <test_vorr_s16x4+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vorr_s16x4>:
movups (%rsi),%xmm0
movups (%rdx),%xmm1
orps   %xmm0,%xmm1
movups %xmm1,(%rdi)
ret

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

LLVM IR (-O2):
define void @test_vorr_s16x4(i32* noalias nocapture writeonly %0, i32* nocapture %1, i32* nocapture %2) {
%4 = bitcast i32* %1 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = bitcast i32* %2 to <4 x i32>*
%7 = load <4 x i32>, <4 x i32>* %6
%8 = or <4 x i32> %7, %5
%9 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %8, <4 x i32>* %9
ret void
}
/* Variables and functions */
unsigned int Mailbox_SdGetBaseFrequency();
unsigned int Emmc_getBaseClockHz() { return Mailbox_SdGetBaseFrequency(); }


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

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

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

LLVM IR (-O2):
define i32 @Emmc_getBaseClockHz() {
%1 = tail call i32 (...) @Mailbox_SdGetBaseFrequency()
ret i32 %1
}
ServerResetPlanets(pkt) char *pkt;
{ PositionPlanets(); }


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

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

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

LLVM IR (-O2):
define i32 @ServerResetPlanets(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @PositionPlanets()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_int16();
int /*<<< orphan*/ test_uint16();
void main() {
  test_int16();
  test_uint16();
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @test_int16()
%2 = call i32 (...) @test_uint16()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @test_int16()
%2 = tail call i32 (...) @test_uint16()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XMappingEvent;

/* Variables and functions */
void set_XMappingEvent_send_event(void *_p, int _v) {
  ((XMappingEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XMappingEvent_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XMappingEvent_send_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XMappingEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int f() { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 1
}
const char *rmdir00_get_title(void) {
  return "Create and remove directories and files";
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Create and remove directories and files\00"
define i8* @rmdir00_get_title() {
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [40 x i8] c"Create and remove directories and files\00"
define i8* @rmdir00_get_title() {
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0)
}
void marker5() {}


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

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

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

LLVM IR (-O2):
define void @marker5() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, size_t);
int posix_memalign(void **, int, size_t);
void *halide_malloc(void *ctx, size_t len) {
  void *p;
  int status = posix_memalign(&p, 32, len + 64);
  if (status != 0)
    error(status, errno, "posix_memalign failed on allocation of size %ld",
          len);
  return (void *)((char *)p + 32);
}


x86 assembly (clang, -O0):
<halide_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
add    $0x40,%rdx
lea    -0x18(%rbp),%rdi
mov    $0x20,%esi
call   1040 <posix_memalign@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     116f <halide_malloc+0x4f>
mov    -0x1c(%rbp),%edi
mov    0x2e83(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rcx
lea    0xe96(%rip),%rdx
call   1030 <error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<halide_malloc>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x40(%rsi),%rdx
lea    0x8(%rsp),%rdi
mov    $0x20,%esi
call   1040 <posix_memalign@plt>
test   %eax,%eax
je     1159 <halide_malloc+0x39>
mov    0x2e9a(%rip),%rcx
mov    (%rcx),%esi
lea    0xeb1(%rip),%rdx
mov    %eax,%edi
mov    %rbx,%rcx
call   1030 <error@plt>
mov    0x8(%rsp),%rax
add    $0x20,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [48 x i8] c"posix_memalign failed on allocation of size %ld\00"
define i8* @halide_malloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = add i64 %7, 64
%9 = call i32 @posix_memalign(i8** %5, i32 32, i64 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i32, i32* %6
%14 = load i32, i32* @errno
%15 = load i64, i64* %4
%16 = call i32 @error(i32 %13, i32 %14, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i64 %15)
br label %17
17: ; preds = %12, %2
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 32
ret i8* %19
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [48 x i8] c"posix_memalign failed on allocation of size %ld\00"
define i8* @halide_malloc(i8* nocapture readnone %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = add i64 %1, 64
%6 = call i32 @posix_memalign(i8** %3, i32 32, i64 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* @errno
%10 = call i32 @error(i32 %6, i32 %9, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %11
11: ; preds = %8, %2
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 32
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("No HTM support.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"No HTM support.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(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"No HTM support.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f(char *p) { puts(p); }


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

x86 assembly (clang, -O2):
<f>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @f(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_scan_solution_banner(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(132, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_scan_solution_banner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x84,%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):
<solcon_scan_solution_banner>:
mov    $0x84,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_scan_solution_banner() {
%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 132, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_scan_solution_banner() {
%1 = tail call i32 @_ada_use_c2phc(i32 132, i32* undef, i32* undef, double* undef)
ret i32 %1
}
void setb(void *s, unsigned int i) {
  unsigned char *v = s;
  v += i >> 3;
  *v |= 1 << (7 - (i % 8));
}


x86 assembly (clang, -O0):
<setb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7,%eax
mov    $0x7,%ecx
sub    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x18(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setb>:
mov    %esi,%ecx
mov    %esi,%eax
not    %cl
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
shr    $0x3,%rax
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @setb(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = lshr i32 %7, 3
%9 = load i8*, i8** %5
%10 = zext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %5
%12 = load i32, i32* %4
%13 = urem i32 %12, 8
%14 = sub i32 7, %13
%15 = shl i32 1, %14
%16 = load i8*, i8** %5
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %18, %15
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
ret void
}

LLVM IR (-O2):
define void @setb(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = and i32 %1, 7
%7 = xor i32 %6, 7
%8 = shl nuw i32 1, %7
%9 = load i8, i8* %5
%10 = trunc i32 %8 to i8
%11 = or i8 %9, %10
store i8 %11, i8* %5
ret void
}
void INT_Excep_TPU0_TGI0C(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU0_TGI0C() {
ret void
}
void buzzer_off(void) { (*(volatile unsigned long *)0xE02000A4) &= ~(1 << 0); }


x86 assembly (clang, -O0):
<buzzer_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe02000a4,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0xe02000a4,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<buzzer_off>:
mov    $0xe02000a4,%eax
andq   $0xfffffffffffffffe,(%rax)
ret

LLVM IR (-O0):
define void @buzzer_off() {
%1 = load volatile i64, i64* inttoptr (i64 3760193700 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 3760193700 to i64*)
ret void
}

LLVM IR (-O2):
define void @buzzer_off() {
%1 = load volatile i64, i64* inttoptr (i64 3760193700 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 3760193700 to i64*)
ret void
}
RX0I1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[x0]) = 33; }


x86 assembly (clang, -O0):
<RX0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x21,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0I1>:
movslq %edx,%rax
movl   $0x21,(%r8,%rax,4)
ret

LLVM IR (-O0):
define i32 @RX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %12
%15 = load i32, i32* %10
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 33, i32* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @RX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
store i32 33, i32* %8
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void error(char *er) {
  printf("%s\n", er);
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ glmATan3f(float *, float *);
void glmATan3f_(float x[3]) { glmATan3f(x, x); }


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

x86 assembly (clang, -O2):
<glmATan3f_>:
mov    %rdi,%rsi
jmp    1030 <glmATan3f@plt>

LLVM IR (-O0):
define void @glmATan3f_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float*, float** %2
%5 = call i32 @glmATan3f(float* %3, float* %4)
ret void
}

LLVM IR (-O2):
define void @glmATan3f_(float* %0) {
%2 = tail call i32 @glmATan3f(float* %0, float* %0)
ret void
}
int num_digs(int num) {
  int test = 1;
  int digits = 0;
  while (num >= test) {
    ++digits;
    test *= 10;
  }
  return digits + 1;
}


x86 assembly (clang, -O0):
<num_digs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1136 <num_digs+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <num_digs+0x15>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_digs>:
mov    $0x1,%eax
test   %edi,%edi
jle    111c <num_digs+0x1c>
mov    $0x1,%ecx
xchg   %ax,%ax
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
add    $0x1,%eax
cmp    %edi,%ecx
jle    1110 <num_digs+0x10>
ret

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

LLVM IR (-O2):
define i32 @num_digs(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ 1, %1 ]
%6 = mul nsw i32 %5, 10
%7 = add i32 %4, 1
%8 = icmp sgt i32 %6, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
int fun767() { return 767; }


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

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

LLVM IR (-O0):
define i32 @fun767() {
ret i32 767
}

LLVM IR (-O2):
define i32 @fun767() {
ret i32 767
}
int log_2(int i) {
  int count = 0;
  for (i >>= 1; i; i >>= 1)
    count++;
  return count;
}


x86 assembly (clang, -O0):
<log_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1138 <log_2+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1117 <log_2+0x17>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <log_2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <log_2+0x10>
ret

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

LLVM IR (-O2):
define i32 @log_2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void print_arr(int a[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("\x1b[32m"
           "a[%d] = %d\n"
           "\x1b[0m",
           i, a[i]);
  }
}


x86 assembly (clang, -O0):
<print_arr>:
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    115a <print_arr+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_arr+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <print_arr+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_arr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"\1B[32ma[%d] = %d\0A\1B[0m\00"
define void @print_arr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[], char *envp[]) {
  for (char **ptr = envp; *ptr; ptr++)
    puts(*ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     115d <main+0x4d>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
call   1030 <puts@plt>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    1132 <main+0x22>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    (%rdx),%rdi
test   %rdi,%rdi
je     1131 <main+0x21>
mov    %rdx,%rbx
add    $0x8,%rbx
call   1030 <puts@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %7, %3
ret i32 0
7: ; preds = %3, %7
%8 = phi i8* [ %12, %7 ], [ %4, %3 ]
%9 = phi i8** [ %11, %7 ], [ %2, %3 ]
%10 = tail call i32 @puts(i8* %8)
%11 = getelementptr inbounds i8*, i8** %9, i64 1
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %6, label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int pthread_sigmask(int, int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
scalar_t__ pthreads_available();
int sigprocmask(int, int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int pthr_sigmask(int how, const sigset_t *set, sigset_t *oldset) {
  if (pthreads_available())
    return pthread_sigmask(how, set, oldset);
  return sigprocmask(how, set, oldset);
}


x86 assembly (clang, -O0):
<pthr_sigmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <pthreads_available@plt>
cmp    $0x0,%rax
je     116c <pthr_sigmask+0x3c>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <pthread_sigmask@plt>
mov    %eax,-0x4(%rbp)
jmp    117f <pthr_sigmask+0x4f>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthr_sigmask>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <pthreads_available@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
test   %rax,%rax
je     1159 <pthr_sigmask+0x29>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <pthread_sigmask@plt>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <sigprocmask@plt>

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

LLVM IR (-O2):
define i32 @pthr_sigmask(i32 %0, i32* %1, i32* %2) {
%4 = tail call i64 (...) @pthreads_available()
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @pthread_sigmask(i32 %0, i32* %1, i32* %2)
br label %10
8: ; preds = %3
%9 = tail call i32 @sigprocmask(i32 %0, i32* %1, i32* %2)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int pl_open_(char *script_name) {
  fprintf(stderr, "Attempt to use pl_open with Perl disabled\n");
  exit(1);
  return -1;
}


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

x86 assembly (clang, -O2):
<pl_open_>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Attempt to use pl_open with Perl disabled\0A\00"
define i32 @pl_open_(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Attempt to use pl_open with Perl disabled\0A\00"
define i32 @pl_open_(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ptr_set_to_zero(int *);
void call_by_ptr_good() {
  int arr[10];
  int i = 99;
  ptr_set_to_zero(&i);
  arr[i] = 123;
}


x86 assembly (clang, -O0):
<call_by_ptr_good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x63,-0x34(%rbp)
lea    -0x34(%rbp),%rdi
call   1030 <ptr_set_to_zero@plt>
movslq -0x34(%rbp),%rax
movl   $0x7b,-0x30(%rbp,%rax,4)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_by_ptr_good>:
push   %rax
movl   $0x63,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ptr_set_to_zero@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @call_by_ptr_good() {
%1 = alloca [10 x i32]
%2 = alloca i32
store i32 99, i32* %2
%3 = call i32 @ptr_set_to_zero(i32* %2)
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %5
store i32 123, i32* %6
ret void
}

LLVM IR (-O2):
define void @call_by_ptr_good() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 99, i32* %1
%3 = call i32 @ptr_set_to_zero(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main(int argc, char **argv) {
  printf("%d %d %d %d\n", sizeof(int), sizeof(long), sizeof(long *),
         sizeof(short));
  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
mov    $0x4,%esi
mov    $0x8,%ecx
mov    $0x2,%r8d
mov    %ecx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"%d %d %d %d\0A\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 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 4, i32 8, i32 8, i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d %d %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 4, i32 8, i32 8, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
unsigned int wysokosc(void) {
  unsigned int h;
  printf("Podaj wysokosc: ");
  scanf("%d", &h);
  return h;
}


x86 assembly (clang, -O0):
<wysokosc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wysokosc>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Podaj wysokosc: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @wysokosc() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [17 x i8] c"Podaj wysokosc: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @wysokosc() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
indirect(typeobj) char typeobj;
{
  if (typeobj == (1 << 2))
    ol("cvtbl\t(r0),r0");
  else
    ol("movl\t(r0),r0");
}


x86 assembly (clang, -O0):
<indirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x4,%eax
jne    113e <indirect+0x2e>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <ol@plt>
jmp    114c <indirect+0x3c>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indirect>:
cmp    $0x4,%dil
lea    0xee5(%rip),%rax
lea    0xeec(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"cvtbl\09(r0),r0\00"
@.str.1 = [13 x i8] c"movl\09(r0),r0\00"
define i32 @indirect(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 4
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [14 x i8] c"cvtbl\09(r0),r0\00"
@.str.1 = [13 x i8] c"movl\09(r0),r0\00"
define i32 @indirect(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 4
%4 = select i1 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* %4)
ret i32 undef
}
void list_psks(void) {}


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

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

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

LLVM IR (-O2):
define void @list_psks() {
ret void
}
/* Variables and functions */
long double tgamma(double);
long double tgammal(long double x) { return tgamma((double)x); }


x86 assembly (clang, -O0):
<tgammal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <tgamma@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgammal>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <tgamma@plt>

LLVM IR (-O0):
define x86_fp80 @tgammal(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call x86_fp80 @tgamma(double %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @tgammal(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call x86_fp80 @tgamma(double %2)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ *getcwd(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char buffer[256];
  if (getcwd(buffer, 256) == NULL)
    return 1;
  printf("%s \n", buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1040 <getcwd@plt>
cmp    $0x0,%rax
jne    1160 <main+0x40>
movl   $0x1,-0x4(%rbp)
jmp    117a <main+0x5a>
lea    -0x110(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
mov    %rsp,%rdi
mov    $0x100,%esi
call   1040 <getcwd@plt>
test   %rax,%rax
je     1152 <main+0x32>
lea    0xec0(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret
mov    $0x1,%eax
add    $0x108,%rsp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32* @getcwd(i8* %4, i32 256)
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %10
}
int d_gt_mm2(double *a1, double *a2) { return !(((*a1) > (*a2))); }


x86 assembly (clang, -O0):
<d_gt_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_gt_mm2>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
setbe  %al
ret

LLVM IR (-O0):
define i32 @d_gt_mm2(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp ogt double %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @d_gt_mm2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ule double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}