xunge/DecIR huggingface dataset:
/* Type definitions */
struct sample {
  int dummy;
};
struct decision {
  int dummy;
};

/* Variables and functions */
struct decision *dt_parse_samples(struct sample const *, int,
                                  int /*<<< orphan*/ *);
struct decision *dt_create(const struct sample *samples, int count) {
  return dt_parse_samples(samples, count, NULL);
}


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

x86 assembly (clang, -O2):
<dt_create>:
xor    %edx,%edx
jmp    1030 <dt_parse_samples@plt>

LLVM IR (-O0):
%struct.decision = type { i32 }
%struct.sample = type { i32 }
define %struct.decision* @dt_create(%struct.sample* %0, i32 %1) {
%3 = alloca %struct.sample*
%4 = alloca i32
store %struct.sample* %0, %struct.sample** %3
store i32 %1, i32* %4
%5 = load %struct.sample*, %struct.sample** %3
%6 = load i32, i32* %4
%7 = call %struct.decision* @dt_parse_samples(%struct.sample* %5, i32 %6, i32* null)
ret %struct.decision* %7
}

LLVM IR (-O2):
%struct.decision = type { i32 }
%struct.sample = type { i32 }
define %struct.decision* @dt_create(%struct.sample* %0, i32 %1) {
%3 = tail call %struct.decision* @dt_parse_samples(%struct.sample* %0, i32 %1, i32* null)
ret %struct.decision* %3
}
/* Variables and functions */
unsigned short dxl_read_word(unsigned char, int);
unsigned short getMovingSpeed(unsigned char id) {
  return dxl_read_word(id, (32));
}


x86 assembly (clang, -O0):
<getMovingSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x20,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_word@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @getMovingSpeed(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i16 @dxl_read_word(i8 zeroext %3, i32 32)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @getMovingSpeed(i8 zeroext %0) {
%2 = tail call zeroext i16 @dxl_read_word(i8 zeroext %0, i32 32)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ shutdownReset();
void shutdownInit(void) { shutdownReset(); }


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

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

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

LLVM IR (-O2):
define void @shutdownInit() {
%1 = tail call i32 (...) @shutdownReset()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int num) {
  if (num < 10)
    printf("%d", num);
  else
    printf("%c", num - 10 + 'A');
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1139 <print+0x29>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
jmp    114e <print+0x3e>
mov    -0x4(%rbp),%esi
sub    $0xa,%esi
add    $0x41,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %edi,%esi
cmp    $0x9,%edi
jg     1123 <print+0x13>
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>
add    $0x37,%esi
lea    0xed6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%c\00"
define void @print(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %13
8: ; preds = %1
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 10
%11 = add nsw i32 %10, 65
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%c\00"
define void @print(i32 %0) {
%2 = icmp slt i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
5: ; preds = %1
%6 = add nuw nsw i32 %0, 55
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
scalar_t__ isascii(char const);
size_t strlen(char const *);
int str_isalpha(const char *str) {
  size_t i = strlen(str);
  while (i--)
    if (isascii(str[i]) == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<str_isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     117e <str_isalpha+0x5e>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <isascii@plt>
cmp    $0x0,%rax
jne    1179 <str_isalpha+0x59>
movl   $0x0,-0x4(%rbp)
jmp    1185 <str_isalpha+0x65>
jmp    1139 <str_isalpha+0x19>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_isalpha>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%rbx
nop
sub    $0x1,%rbx
jb     1150 <str_isalpha+0x30>
movsbl -0x1(%r14,%rax,1),%edi
call   1040 <isascii@plt>
mov    %rax,%rcx
mov    %rbx,%rax
test   %rcx,%rcx
jne    1130 <str_isalpha+0x10>
xor    %eax,%eax
jmp    1155 <str_isalpha+0x35>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @str_isalpha(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
br label %3
3: ; preds = %7, %1
%4 = phi i64 [ %2, %1 ], [ %5, %7 ]
%5 = add i64 %4, -1
%6 = icmp eq i64 %4, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %0, i64 %5
%9 = load i8, i8* %8
%10 = tail call i64 @isascii(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %3, %7
%13 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %13
}
/* Variables and functions */
char *av_malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
char *av_strdup(const char *s) {
  char *ptr;
  int len = strlen(s) + 1;
  ptr = av_malloc(len);
  if (ptr)
    memcpy(ptr, s, len);
  return ptr;
}


x86 assembly (clang, -O0):
<av_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <av_malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <av_strdup+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1030 <av_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115d <av_strdup+0x2d>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @av_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @av_malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Type definitions */
struct contact {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ contact_new_from_client(struct contact *);
int chat_connect(struct contact *c) {
  if (c == NULL) {
    return 0;
  }
  if (!contact_new_from_client(c)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<chat_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <chat_connect+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1158 <chat_connect+0x48>
mov    -0x10(%rbp),%rdi
call   1030 <contact_new_from_client@plt>
cmp    $0x0,%eax
jne    1151 <chat_connect+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1158 <chat_connect+0x48>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chat_connect>:
test   %rdi,%rdi
je     1129 <chat_connect+0x19>
push   %rax
call   1030 <contact_new_from_client@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.contact = type { i32 }
define i32 @chat_connect(%struct.contact* %0) {
%2 = alloca i32
%3 = alloca %struct.contact*
store %struct.contact* %0, %struct.contact** %3
%4 = load %struct.contact*, %struct.contact** %3
%5 = icmp eq %struct.contact* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
%8 = load %struct.contact*, %struct.contact** %3
%9 = call i32 @contact_new_from_client(%struct.contact* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7
store i32 0, i32* %2
br label %13
12: ; preds = %7
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.contact = type { i32 }
define i32 @chat_connect(%struct.contact* %0) {
%2 = icmp eq %struct.contact* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @contact_new_from_client(%struct.contact* %0)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
void unblock_fatal_signals() {}


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

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

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

LLVM IR (-O2):
define void @unblock_fatal_signals() {
ret void
}
/* Variables and functions */
scalar_t__ strtod(char const *, int /*<<< orphan*/);
double atof(const char *nptr) { return (double)strtod(nptr, 0); }


x86 assembly (clang, -O0):
<atof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <strtod@plt>
cvtsi2sd %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atof>:
push   %rax
xor    %esi,%esi
call   1030 <strtod@plt>
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @atof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtod(i8* %3, i32 0)
%5 = sitofp i64 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @atof(i8* %0) {
%2 = tail call i64 @strtod(i8* %0, i32 0)
%3 = sitofp i64 %2 to double
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t radio_df_ant_num_get(void) { return 0; }


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

x86 assembly (clang, -O2):
<radio_df_ant_num_get>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @radio_df_ant_num_get() {
ret i32 0
}

LLVM IR (-O2):
define i32 @radio_df_ant_num_get() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr,
          "Usage: %s thread_count array_size\n\n"
          "Exactly two argument required:\n"
          "    thread_count: The number of threads to create.\n"
          "    array_size: The size of the array to run with.\n",
          argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
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 = [169 x i8] c"Usage: %s thread_count array_size\0A\0AExactly two argument required:\0A thread_count: The number of threads to create.\0A array_size: The size of the array to run with.\0A\00"
define void @usage(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 ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [169 x i8] c"Usage: %s thread_count array_size\0A\0AExactly two argument required:\0A thread_count: The number of threads to create.\0A array_size: The size of the array to run with.\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void mem_free(void *block) {}


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

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

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

LLVM IR (-O2):
define void @mem_free(i8* nocapture %0) {
ret void
}
void snd_info_card_id_change(struct snd_card *card) {}


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

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

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

LLVM IR (-O2):
%struct.snd_card = type opaque
define void @snd_info_card_id_change(%struct.snd_card* nocapture %0) {
ret void
}
int bundle_add(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<bundle_add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @bundle_add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bundle_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
char *icpyalloc(string) const char *const string;
{ return icatalloc((char *)((void *)0), string); }


x86 assembly (clang, -O0):
<icpyalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
mov    $0x0,%al
call   1030 <icatalloc@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icpyalloc>:
push   %rax
mov    %rdi,%rsi
xor    %edi,%edi
xor    %eax,%eax
call   1030 <icatalloc@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @icpyalloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @icatalloc to i32 (i8*, i8*, ...)*)(i8* null, i8* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @icpyalloc(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @icatalloc to i32 (i8*, i8*, ...)*)(i8* null, i8* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int EAGAIN;
int EINVAL;
int pthread_setconcurrency(int val) {
  if (val < 0)
    return EINVAL;
  if (val > 0)
    return EAGAIN;
  return 0;
}


x86 assembly (clang, -O0):
<pthread_setconcurrency>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1122 <pthread_setconcurrency+0x22>
mov    0x2ec8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <pthread_setconcurrency+0x44>
cmpl   $0x0,-0x8(%rbp)
jle    113d <pthread_setconcurrency+0x3d>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <pthread_setconcurrency+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_setconcurrency>:
mov    %edi,%eax
test   %edi,%edi
mov    0x2ec5(%rip),%rcx
cmovne (%rcx),%eax
mov    0x2ecb(%rip),%rcx
cmovs  (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@EAGAIN = global i32 0
define i32 @pthread_setconcurrency(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @EINVAL
store i32 %7, i32* %2
br label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = load i32, i32* @EAGAIN
store i32 %12, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %11, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@EINVAL = global i32 0
@EAGAIN = global i32 0
define i32 @pthread_setconcurrency(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = load i32, i32* @EINVAL
%4 = icmp eq i32 %0, 0
%5 = load i32, i32* @EAGAIN
%6 = select i1 %4, i32 0, i32 %5
%7 = select i1 %2, i32 %3, i32 %6
ret i32 %7
}
__attribute__((noreturn)) void __stack_chk_fail(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<__stack_chk_fail>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <__stack_chk_fail+0x9>
jmp    1109 <__stack_chk_fail+0x9>

x86 assembly (clang, -O2):
<__stack_chk_fail>:
jmp    1100 <__stack_chk_fail>

LLVM IR (-O0):
define void @__stack_chk_fail() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @__stack_chk_fail() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
unsigned long GrMapUTF16_Unicode(char const *, unsigned long, unsigned long *,
                                 int);
unsigned long GrMapUTF16LE_Unicode(const char *pcSrcChar, unsigned long ulCount,
                                   unsigned long *pulSkip) {
  return (GrMapUTF16_Unicode(pcSrcChar, ulCount, pulSkip, 1));
}


x86 assembly (clang, -O0):
<GrMapUTF16LE_Unicode>:
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    $0x1,%ecx
call   1030 <GrMapUTF16_Unicode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GrMapUTF16LE_Unicode>:
mov    $0x1,%ecx
jmp    1030 <GrMapUTF16_Unicode@plt>

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

LLVM IR (-O2):
define i64 @GrMapUTF16LE_Unicode(i8* %0, i64 %1, i64* %2) {
%4 = tail call i64 @GrMapUTF16_Unicode(i8* %0, i64 %1, i64* %2, i32 1)
ret i64 %4
}
int main() {
  int i;
  i = 0;
  while (i < 100) {
    if (i < 50) {
      i = i + 1;
    } else {
      i = i - 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1142 <main+0x42>
cmpl   $0x32,-0x8(%rbp)
jge    1134 <main+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x3d>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %15, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 50
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %15
12: ; preds = %6
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %9
br label %3
16: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void abort(void) {
  fprintf(stderr, "[abort] Exiting gracefully\n");
  exit(0);
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"[abort] Exiting gracefully\0A\00"
define void @abort() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"[abort] Exiting gracefully\0A\00"
define void @abort() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
void USBDevConnect(unsigned long ulBase) {
  ;
  (*((volatile unsigned char *)(ulBase + 0x00000001))) |= 0x00000040;
}


x86 assembly (clang, -O0):
<USBDevConnect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
movzbl %cl,%ecx
or     $0x40,%ecx
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDevConnect>:
orb    $0x40,0x1(%rdi)
ret

LLVM IR (-O0):
define void @USBDevConnect(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 1
%5 = inttoptr i64 %4 to i8*
%6 = load volatile i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %7, 64
%9 = trunc i32 %8 to i8
store volatile i8 %9, i8* %5
ret void
}

LLVM IR (-O2):
define void @USBDevConnect(i64 %0) {
%2 = add i64 %0, 1
%3 = inttoptr i64 %2 to i8*
%4 = load volatile i8, i8* %3
%5 = or i8 %4, 64
store volatile i8 %5, i8* %3
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void setNotInUse(uint64_t *guard_object) { ((uint8_t *)guard_object)[1] = 0; }


x86 assembly (clang, -O0):
<setNotInUse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setNotInUse>:
movq   $0x0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @setNotInUse(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to i64*
%5 = getelementptr inbounds i64, i64* %4, i64 1
store i64 0, i64* %5
ret void
}

LLVM IR (-O2):
define void @setNotInUse(i32* nocapture writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = bitcast i32* %2 to i64*
store i64 0, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtmRfa1TimerMacP__CompareC__default__fired();
void HplAtmRfa1TimerMacP__CompareC__fired(void) {
  HplAtmRfa1TimerMacP__CompareC__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplAtmRfa1TimerMacP__CompareC__fired() {
%1 = tail call i32 (...) @HplAtmRfa1TimerMacP__CompareC__default__fired()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
char *strlen(char *);
main() {
  if (strcmp("paul", "Paul") == 0) {
    printf(strlen("paul"));
  } else {
    printf("Bye!");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1175 <main+0x45>
lea    0xe9d(%rip),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
jmp    1181 <main+0x51>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1152 <main+0x22>
lea    0xeba(%rip),%rdi
jmp    1161 <main+0x31>
lea    0xea7(%rip),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"paul\00"
@.str.1 = [5 x i8] c"Paul\00"
@.str.2 = [5 x i8] c"Bye!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i8* @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* %5)
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"paul\00"
@.str.1 = [5 x i8] c"Paul\00"
@.str.2 = [5 x i8] c"Bye!\00"
define i32 @main() {
%1 = tail call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i8* @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %0 ]
%7 = tail call i32 @printf(i8* dereferenceable(1) %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int suzerain_inorder_wavenumber_min(const int N) {
  assert(0 < N);
  return (1 - N) / 2;
}


x86 assembly (clang, -O0):
<suzerain_inorder_wavenumber_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%eax
sub    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suzerain_inorder_wavenumber_min>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
call   1030 <assert@plt>
mov    $0x1,%ecx
sub    %ebx,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @suzerain_inorder_wavenumber_min(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 0, %3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = sub nsw i32 1, %7
%9 = sdiv i32 %8, 2
ret i32 %9
}

LLVM IR (-O2):
define i32 @suzerain_inorder_wavenumber_min(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = sub nsw i32 1, %0
%6 = sdiv i32 %5, 2
ret i32 %6
}
int machine_is_little_endian() {
  int i = 1;
  unsigned char *p = (unsigned char *)&i;
  if (p[0] == 1)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<machine_is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x1,%eax
jne    112f <machine_is_little_endian+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <machine_is_little_endian+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @machine_is_little_endian() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 1, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 1, i32* %1
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %1
ret i32 %13
}

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

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XMapEvent(void) {
  XMapEvent *_p = (XMapEvent *)malloc(sizeof(XMapEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XMapEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XMapEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XMapEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XMapEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XMapEvent() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XMapEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ __p3dfft_MOD_p3dfft_clean();
void p3dfft_clean() { __p3dfft_MOD_p3dfft_clean(); }


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

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

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

LLVM IR (-O2):
define void @p3dfft_clean() {
%1 = tail call i32 (...) @__p3dfft_MOD_p3dfft_clean()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
char super_chomp_n(char *, int /*<<< orphan*/);
char super_chomp(char *istring) {
  return super_chomp_n(istring, strlen(istring));
}


x86 assembly (clang, -O0):
<super_chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <super_chomp_n@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<super_chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <super_chomp_n@plt>

LLVM IR (-O0):
define signext i8 @super_chomp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call signext i8 @super_chomp_n(i8* %3, i32 %5)
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @super_chomp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call signext i8 @super_chomp_n(i8* %0, i32 %2)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int);
int builtin_exec(int argc, char *argv[]) {
  if (argc == 0)
    return 0;
  execvp(argv[0], argv);
  exit(127);
}


x86 assembly (clang, -O0):
<builtin_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1141 <builtin_exec+0x21>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <execvp@plt>
mov    $0x7f,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<builtin_exec>:
test   %edi,%edi
jne    1127 <builtin_exec+0x7>
xor    %eax,%eax
ret
push   %rax
mov    (%rsi),%rdi
call   1030 <execvp@plt>
mov    $0x7f,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @builtin_exec(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
ret i32 0
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %4
%13 = call i32 @execvp(i8* %11, i8** %12)
%14 = call i32 @exit(i32 127)
unreachable
}

LLVM IR (-O2):
define i32 @builtin_exec(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %5
4: ; preds = %2
ret i32 0
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 @execvp(i8* %6, i8** %1)
%8 = tail call i32 @exit(i32 127)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ chaz_OS_run_redirected(char const *, char *);
int /*<<< orphan*/ chaz_Util_remove_and_verify(char *);
char *chaz_Util_slurp_file(char *, size_t *);
char *chaz_OS_run_and_capture(const char *command, size_t *output_len) {
  char *output;
  chaz_OS_run_redirected(command, "_charmonizer_target");
  output = chaz_Util_slurp_file("_charmonizer_target", output_len);
  chaz_Util_remove_and_verify("_charmonizer_target");
  return output;
}


x86 assembly (clang, -O0):
<chaz_OS_run_and_capture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <chaz_OS_run_redirected@plt>
mov    -0x10(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1050 <chaz_Util_slurp_file@plt>
mov    %rax,-0x18(%rbp)
lea    0xe95(%rip),%rdi
call   1040 <chaz_Util_remove_and_verify@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chaz_OS_run_and_capture>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0xec2(%rip),%r14
mov    %r14,%rsi
call   1030 <chaz_OS_run_redirected@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <chaz_Util_slurp_file@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <chaz_Util_remove_and_verify@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"_charmonizer_target\00"
define i8* @chaz_OS_run_and_capture(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i8*
store i8* %0, i8** %3
store i64* %1, i64** %4
%6 = load i8*, i8** %3
%7 = call i32 @chaz_OS_run_redirected(i8* %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = load i64*, i64** %4
%9 = call i8* @chaz_Util_slurp_file(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64* %8)
store i8* %9, i8** %5
%10 = call i32 @chaz_Util_remove_and_verify(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
@.str = [20 x i8] c"_charmonizer_target\00"
define i8* @chaz_OS_run_and_capture(i8* %0, i64* %1) {
%3 = tail call i32 @chaz_OS_run_redirected(i8* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = tail call i8* @chaz_Util_slurp_file(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64* %1)
%5 = tail call i32 @chaz_Util_remove_and_verify(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
int crypto_des_encrypt() {
  int result;
  result = 0;
  return result;
}


x86 assembly (clang, -O0):
<crypto_des_encrypt>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_des_encrypt>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @crypto_des_encrypt() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(unsigned char *, char *, unsigned char);
int /*<<< orphan*/ tp_serial_send_cmd(int, unsigned char *);
void syn_serial_set_mode(int fd, unsigned char mode) {
  unsigned char bytes[15];
  sprintf(bytes, "%%C3B%02X5555", mode);
  tp_serial_send_cmd(fd, bytes);
}


x86 assembly (clang, -O0):
<syn_serial_set_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
lea    -0x14(%rbp),%rdi
lea    0xec4(%rip),%rsi
movzbl -0x5(%rbp),%edx
call   1040 <sprintf@plt>
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1030 <tp_serial_send_cmd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syn_serial_set_mode>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %esi,%edx
mov    %edi,%ebx
lea    0xece(%rip),%rsi
lea    0x9(%rsp),%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <tp_serial_send_cmd@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%%C3B%02X5555\00"
define void @syn_serial_set_mode(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca [15 x i8]
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%7 = load i8, i8* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
%9 = load i32, i32* %3
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%11 = call i32 @tp_serial_send_cmd(i32 %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%%C3B%02X5555\00"
define void @syn_serial_set_mode(i32 %0, i8 zeroext %1) {
%3 = alloca [15 x i8]
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
%6 = call i32 @tp_serial_send_cmd(i32 %0, i8* %4)
ret void
}
unsigned int cpumask_next_zero(int n, const struct cpumask *srcp) {
  return n + 1;
}


x86 assembly (clang, -O0):
<cpumask_next_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cpumask = type opaque
define i32 @cpumask_next_zero(i32 %0, %struct.cpumask* %1) {
%3 = alloca i32
%4 = alloca %struct.cpumask*
store i32 %0, i32* %3
store %struct.cpumask* %1, %struct.cpumask** %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
%struct.cpumask = type opaque
define i32 @cpumask_next_zero(i32 %0, %struct.cpumask* nocapture readnone %1) {
%3 = add nsw i32 %0, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bit_set(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void bit_zeroes(uint32_t *bitmap, int bits) {
  int i;
  for (i = 0; i < bits; i++)
    bit_set(bitmap, i, 0);
}


x86 assembly (clang, -O0):
<bit_zeroes>:
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    114e <bit_zeroes+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
call   1030 <bit_set@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <bit_zeroes+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_zeroes>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1133 <bit_zeroes+0x23>
mov    %esi,%ebx
mov    %rdi,%r14
xor    %ebp,%ebp
nop
mov    %r14,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1030 <bit_set@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <bit_zeroes+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @bit_zeroes(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 = %14, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = call i32 @bit_set(i32* %11, i32 %12, i32 0)
br label %14
14: ; preds = %10
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @bit_zeroes(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @bit_set(i32* %0, i32 %5, i32 0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ oosmos_DelayMS(int);
int /*<<< orphan*/ oosmos_RunStateMachines();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ syncyieldtestNew(char *, int);
extern int main(void) {
  printf("\nThis test does not end.  Control-C to exit.\n\n");
  syncyieldtestNew("TestA", 3);
  syncyieldtestNew("TestB", 10);
  while (1) {
    oosmos_RunStateMachines();
    oosmos_DelayMS(25);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x3,%esi
call   1050 <syncyieldtestNew@plt>
lea    0xec2(%rip),%rdi
mov    $0xa,%esi
call   1050 <syncyieldtestNew@plt>
mov    $0x0,%al
call   1060 <oosmos_RunStateMachines@plt>
mov    $0x19,%edi
call   1040 <oosmos_DelayMS@plt>
jmp    117d <main+0x3d>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
mov    $0x3,%esi
call   1050 <syncyieldtestNew@plt>
lea    0xea1(%rip),%rdi
mov    $0xa,%esi
call   1050 <syncyieldtestNew@plt>
nop
xor    %eax,%eax
call   1060 <oosmos_RunStateMachines@plt>
mov    $0x19,%edi
call   1040 <oosmos_DelayMS@plt>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@.str = [47 x i8] c"\0AThis test does not end. Control-C to exit.\0A\0A\00"
@.str.1 = [6 x i8] c"TestA\00"
@.str.2 = [6 x i8] c"TestB\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @syncyieldtestNew(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 3)
%4 = call i32 @syncyieldtestNew(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 10)
br label %5
5: ; preds = %0, %5
%6 = call i32 (...) @oosmos_RunStateMachines()
%7 = call i32 @oosmos_DelayMS(i32 25)
br label %5
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"TestA\00"
@.str.2 = [6 x i8] c"TestB\00"
@str = [46 x i8] c"\0AThis test does not end. Control-C to exit.\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @syncyieldtestNew(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 3)
%3 = tail call i32 @syncyieldtestNew(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 10)
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @oosmos_RunStateMachines()
%6 = tail call i32 @oosmos_DelayMS(i32 25)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ sleep_ns(int);
void sleep_ms(int millisec) { sleep_ns(millisec * 1000000); }


x86 assembly (clang, -O0):
<sleep_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0xf4240,-0x4(%rbp),%edi
call   1030 <sleep_ns@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_ms>:
imul   $0xf4240,%edi,%edi
jmp    1030 <sleep_ns@plt>

LLVM IR (-O0):
define void @sleep_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000000
%5 = call i32 @sleep_ns(i32 %4)
ret void
}

LLVM IR (-O2):
define void @sleep_ms(i32 %0) {
%2 = mul nsw i32 %0, 1000000
%3 = tail call i32 @sleep_ns(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_strlist_prepend() {
  printf("NOT IMPLEMENTED:"
         "pa_strlist_prepend"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"NOT IMPLEMENTED:pa_strlist_prepend\0A\00"
define i32 @pa_strlist_prepend() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_strlist_prepend\00"
define i32 @pa_strlist_prepend() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void occampi_matchedformal_chook_free(void *chook) { return; }


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

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

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

LLVM IR (-O2):
define void @occampi_matchedformal_chook_free(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
int kill(int /*<<< orphan*/, int /*<<< orphan*/);
int kill_pid(pid_t pid) { return kill(pid, SIGKILL); }


x86 assembly (clang, -O0):
<kill_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_pid>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGKILL = global i32 0
define i32 @kill_pid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGKILL
%5 = call i32 @kill(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SIGKILL = global i32 0
define i32 @kill_pid(i32 %0) {
%2 = load i32, i32* @SIGKILL
%3 = tail call i32 @kill(i32 %0, i32 %2)
ret i32 %3
}