xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISREG(int /*<<< orphan*/);
int stat(char const *, struct stat *);
int cli_file_exists(const char *fpath) {
  struct stat st;
  if (stat(fpath, &st) == -1)
    return (0);
  if (!S_ISREG(st.st_mode))
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<cli_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    114e <cli_file_exists+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1172 <cli_file_exists+0x52>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%eax
jne    116b <cli_file_exists+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1172 <cli_file_exists+0x52>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1141 <cli_file_exists+0x21>
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @cli_file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISREG(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char *);
char *strdup(char *);
char *xstrdup(char *string) {
  char *dup = strdup(string);
  if (dup == NULL)
    err(1, "Can't dup %s", string);
  return dup;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1159 <xstrdup+0x39>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xeac(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <xstrdup+0x28>
lea    0xec5(%rip),%rsi
mov    $0x1,%edi
mov    %r14,%rdx
call   1030 <err@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Can't dup %s\00"
define noalias i8* @xstrdup(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void heap_reinitp() {}


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

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

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

LLVM IR (-O2):
define void @heap_reinitp() {
ret void
}
/* Variables and functions */
double strtod(char const *, char **);
double atof(const char *ascii) { return strtod(ascii, (char **)0); }


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

x86 assembly (clang, -O2):
<atof>:
xor    %esi,%esi
jmp    1030 <strtod@plt>

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

LLVM IR (-O2):
define double @atof(i8* nocapture %0) {
%2 = tail call double @strtod(i8* nocapture %0, i8** null)
ret double %2
}
void SWAP_double(double *val) {
  char *p = (char *)val;
  char t;
  int i, j;
  for (i = 0; i < 4; i++) {
    j = i ^ 7;
    t = p[i];
    p[i] = p[j];
    p[j] = t;
  }
}


x86 assembly (clang, -O0):
<SWAP_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    116a <SWAP_double+0x6a>
mov    -0x18(%rbp),%eax
xor    $0x7,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1117 <SWAP_double+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SWAP_double>:
mov    (%rdi),%al
mov    0x7(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x7(%rdi)
movzwl 0x1(%rdi),%eax
rol    $0x8,%ax
movzwl 0x5(%rdi),%ecx
rol    $0x8,%cx
mov    %cx,0x1(%rdi)
mov    %ax,0x5(%rdi)
rolw   $0x8,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @SWAP_double(double* nocapture %0) {
%2 = bitcast double* %0 to i8*
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 7
%5 = load i8, i8* %4
store i8 %5, i8* %2
store i8 %3, i8* %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %2, i64 6
%9 = load i8, i8* %8
store i8 %9, i8* %6
store i8 %7, i8* %8
%10 = getelementptr inbounds i8, i8* %2, i64 2
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %2, i64 5
%13 = load i8, i8* %12
store i8 %13, i8* %10
store i8 %11, i8* %12
%14 = getelementptr inbounds i8, i8* %2, i64 3
%15 = load i8, i8* %14
%16 = getelementptr inbounds i8, i8* %2, i64 4
%17 = load i8, i8* %16
store i8 %17, i8* %14
store i8 %15, i8* %16
ret void
}
/* Variables and functions */
int isdigit(int);
int in_decimal_digit_class(int c) { return isdigit(c); }


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

x86 assembly (clang, -O2):
<in_decimal_digit_class>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @in_decimal_digit_class(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct chat_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ chat_end_listen(struct chat_state *);
unsigned command_endlisten(struct chat_state *state, int argc, char **argv) {
  (void)argv;
  if (argc != 0) {
    return 2;
  }
  chat_end_listen(state);
  return 0;
}


x86 assembly (clang, -O0):
<command_endlisten>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1139 <command_endlisten+0x29>
movl   $0x2,-0x4(%rbp)
jmp    1149 <command_endlisten+0x39>
mov    -0x10(%rbp),%rdi
call   1030 <chat_end_listen@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_endlisten>:
mov    $0x2,%eax
test   %esi,%esi
je     111a <command_endlisten+0xa>
ret
push   %rax
call   1030 <chat_end_listen@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
%struct.chat_state = type { i32 }
define i32 @command_endlisten(%struct.chat_state* %0, i32 %1, i8** nocapture readnone %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @chat_end_listen(%struct.chat_state* %0)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ 0, %5 ], [ 2, %3 ]
ret i32 %8
}
int is_string_start(int c) { return c == '"'; }


x86 assembly (clang, -O0):
<is_string_start>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x22,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_string_start>:
xor    %eax,%eax
cmp    $0x22,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_string_start(i32 %0) {
%2 = icmp eq i32 %0, 34
%3 = zext i1 %2 to i32
ret i32 %3
}
int HPCC_external_finalize(int argc, char *argv[], void *extdata) { return 0; }


x86 assembly (clang, -O0):
<HPCC_external_finalize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @HPCC_external_finalize(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @HPCC_external_finalize(i32 %0, i8** nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emsStat(int *);
void errStat(int *status) { emsStat(status); }


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

x86 assembly (clang, -O2):
<errStat>:
jmp    1030 <emsStat@plt>

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

LLVM IR (-O2):
define void @errStat(i32* %0) {
%2 = tail call i32 @emsStat(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ADC8(int /*<<< orphan*/);
int /*<<< orphan*/ SA1Immediate8(int);
void Op69M1(void) { ADC8(SA1Immediate8(1)); }


x86 assembly (clang, -O0):
<Op69M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <SA1Immediate8@plt>
mov    %eax,%edi
call   1030 <ADC8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op69M1>:
push   %rax
mov    $0x1,%edi
call   1040 <SA1Immediate8@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ADC8@plt>

LLVM IR (-O0):
define void @Op69M1() {
%1 = call i32 @SA1Immediate8(i32 1)
%2 = call i32 @ADC8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op69M1() {
%1 = tail call i32 @SA1Immediate8(i32 1)
%2 = tail call i32 @ADC8(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double uniform_thorfinn() { return ((double)rand() / (double)RAND_MAX); }


x86 assembly (clang, -O0):
<uniform_thorfinn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<uniform_thorfinn>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @uniform_thorfinn() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @uniform_thorfinn() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
void rop3_120_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk1 = T ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_120_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_120_0_0>:
and    (%rdi),%sil
xor    %dl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_120_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
store i8 %22, i8* %23
ret void
}

LLVM IR (-O2):
define void @rop3_120_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %5, %2
store i8 %6, i8* %0
ret void
}
int gcd(int a, int b) {
  int r;
  if (b == 0)
    r = a;
  else
    r = gcd(b, a % b);
  return r;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <gcd+0x23>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <gcd+0x37>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int mutex_unlock(int /*<<< orphan*/ *);
int pthread_mutex_unlock(pthread_mutex_t *mutex) { return mutex_unlock(mutex); }


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

x86 assembly (clang, -O2):
<pthread_mutex_unlock>:
jmp    1030 <mutex_unlock@plt>

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

LLVM IR (-O2):
define i32 @pthread_mutex_unlock(i32* %0) {
%2 = tail call i32 @mutex_unlock(i32* %0)
ret i32 %2
}
/* Type definitions */
struct sockaddr_un {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ sa;

/* Variables and functions */
int anetGenericAccept(char *, int, struct sockaddr *, int *);
int kr_net_unix_accept(char *err, int s) {
  int fd;
  struct sockaddr_un sa;
  socklen_t salen = sizeof(sa);
  if ((fd = anetGenericAccept(err, s, (struct sockaddr *)&sa, &salen)) == -1)
    return -1;
  return fd;
}


x86 assembly (clang, -O0):
<kr_net_unix_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
call   1030 <anetGenericAccept@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    1152 <kr_net_unix_accept+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <kr_net_unix_accept+0x48>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kr_net_unix_accept>:
sub    $0x18,%rsp
movl   $0x4,0xc(%rsp)
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <anetGenericAccept@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_un = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @kr_net_unix_accept(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.sockaddr_un
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 4, i32* %8
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = bitcast %struct.sockaddr_un* %7 to %struct.sockaddr*
%12 = call i32 @anetGenericAccept(i8* %9, i32 %10, %struct.sockaddr* %11, i32* %8)
store i32 %12, i32* %6
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %17
15: ; preds = %2
%16 = load i32, i32* %6
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %14
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @kr_net_unix_accept(i8* %0, i32 %1) {
%3 = alloca %struct.sockaddr_un
%4 = alloca i32
%5 = bitcast %struct.sockaddr_un* %3 to i8*
%6 = bitcast i32* %4 to i8*
store i32 4, i32* %4
%7 = bitcast %struct.sockaddr_un* %3 to %struct.sockaddr*
%8 = call i32 @anetGenericAccept(i8* %0, i32 %1, %struct.sockaddr* %7, i32* %4)
ret i32 %8
}
/* Variables and functions */
double M_SQRT1_2;
double erfc(double);
double rnormal(double value) { return 0.5 * erfc(-value * M_SQRT1_2); }


x86 assembly (clang, -O0):
<rnormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    0x2ea0(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <erfc@plt>
movaps %xmm0,%xmm1
movsd  0xeac(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnormal>:
push   %rax
xorpd  0xee7(%rip),%xmm0
mov    0x2ec0(%rip),%rax
mulsd  (%rax),%xmm0
call   1030 <erfc@plt>
mulsd  0xedf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_SQRT1_2 = global double 0.000000e+00
define double @rnormal(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = load double, double* @M_SQRT1_2
%6 = fmul double %4, %5
%7 = call double @erfc(double %6)
%8 = fmul double 5.000000e-01, %7
ret double %8
}

LLVM IR (-O2):
@M_SQRT1_2 = global double 0.000000e+00
define double @rnormal(double %0) {
%2 = fneg double %0
%3 = load double, double* @M_SQRT1_2
%4 = fmul double %3, %2
%5 = tail call double @erfc(double %4)
%6 = fmul double %5, 5.000000e-01
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ message;

/* Variables and functions */
int /*<<< orphan*/ color_set(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ mvaddstr(int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void broken_status(char *toolname) {
  char message[80];
  snprintf(message, sizeof(message), "Your %s is broken.", toolname);
  color_set(4, NULL);
  mvaddstr(20 + 1, 0, message);
}


x86 assembly (clang, -O0):
<broken_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x50,%esi
lea    0xeb0(%rip),%rdx
call   1030 <snprintf@plt>
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <color_set@plt>
lea    -0x60(%rbp),%rdx
mov    $0x15,%edi
xor    %esi,%esi
call   1040 <mvaddstr@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<broken_status>:
push   %rbx
sub    $0x50,%rsp
mov    %rdi,%rcx
lea    0xec1(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1030 <snprintf@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1050 <color_set@plt>
mov    $0x15,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <mvaddstr@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Your %s is broken.\00"
define void @broken_status(i8* %0) {
%2 = alloca i8*
%3 = alloca [80 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 80, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @color_set(i32 4, i32* null)
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%9 = call i32 @mvaddstr(i32 21, i32 0, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Your %s is broken.\00"
define void @broken_status(i8* %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 80, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @color_set(i32 4, i32* null)
%6 = call i32 @mvaddstr(i32 21, i32 0, i8* %3)
ret void
}
/* Variables and functions */
int main_ui_show();
int device_main_ui_show() { return main_ui_show(); }


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

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

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

LLVM IR (-O2):
define i32 @device_main_ui_show() {
%1 = tail call i32 (...) @main_ui_show()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void cleanData(void *data) { printf("Clean %d\n", *(int *)data); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Clean %d\0A\00"
define void @cleanData(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Clean %d\0A\00"
define void @cleanData(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
short const *GetTitleW54();
const short int *gettitlew() { return GetTitleW54(); }


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

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

LLVM IR (-O0):
define i16* @gettitlew() {
%1 = call i16* (...) @GetTitleW54()
ret i16* %1
}

LLVM IR (-O2):
define i16* @gettitlew() {
%1 = tail call i16* (...) @GetTitleW54()
ret i16* %1
}
int pwm(int duty, int length) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pwm(i32 %0, i32 %1) {
ret i32 0
}
int ft_isblank(int c) {
  if (c == ' ' || c == '\n' || c == '\t' || c == '\a' || c == '\v' || c == '\f')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     1143 <ft_isblank+0x43>
cmpl   $0xa,-0x8(%rbp)
je     1143 <ft_isblank+0x43>
cmpl   $0x9,-0x8(%rbp)
je     1143 <ft_isblank+0x43>
cmpl   $0x7,-0x8(%rbp)
je     1143 <ft_isblank+0x43>
cmpl   $0xb,-0x8(%rbp)
je     1143 <ft_isblank+0x43>
cmpl   $0xc,-0x8(%rbp)
jne    114f <ft_isblank+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <ft_isblank+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isblank>:
cmp    $0x20,%edi
ja     111d <ft_isblank+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100001e80,%rdx
bt     %rcx,%rdx
jae    111d <ft_isblank+0x1d>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_isblank(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 12, label %3
i32 11, label %3
i32 10, label %3
i32 9, label %3
i32 7, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int hweight32(unsigned long);
int hweight64(unsigned long);
int hweight_long(unsigned long a) {
  return sizeof(a) == 4 ? hweight32(a) : hweight64(a);
}


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

x86 assembly (clang, -O2):
<hweight_long>:
jmp    1030 <hweight64@plt>

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

LLVM IR (-O2):
define i32 @hweight_long(i64 %0) {
%2 = tail call i32 @hweight64(i64 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ __CRAB_assume(int);
int nd();
int32_t compute1(int32_t *t) {
  int idx = nd();
  __CRAB_assume(idx >= 0);
  __CRAB_assume(idx <= 3);
  return t[idx];
}


x86 assembly (clang, -O0):
<compute1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <nd@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assume@plt>
cmpl   $0x3,-0xc(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assume@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute1>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <nd@plt>
mov    %eax,%ebp
mov    %eax,%edi
not    %edi
shr    $0x1f,%edi
call   1040 <__CRAB_assume@plt>
xor    %edi,%edi
cmp    $0x4,%ebp
setl   %dil
call   1040 <__CRAB_assume@plt>
movslq %ebp,%rax
mov    (%rbx,%rax,4),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @compute1(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 (...) @nd()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @__CRAB_assume(i32 %7)
%9 = load i32, i32* %3
%10 = icmp sle i32 %9, 3
%11 = zext i1 %10 to i32
%12 = call i32 @__CRAB_assume(i32 %11)
%13 = load i32*, i32** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @compute1(i32* nocapture %0) {
%2 = tail call i32 (...) @nd()
%3 = xor i32 %2, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @__CRAB_assume(i32 %4)
%6 = icmp slt i32 %2, 4
%7 = zext i1 %6 to i32
%8 = tail call i32 @__CRAB_assume(i32 %7)
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
ret i32 %11
}
void fnSwap(int *x, int *y) {
  int temp;
  temp = *x;
  *x = *y;
  *y = temp;
}


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

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

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

LLVM IR (-O2):
define void @fnSwap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fd_nrf8001_get_device_address_error(int);
int /*<<< orphan*/ fd_nrf8001_get_device_address_success(int *, int);
void fd_nrf8001_dispatch_get_device_address_response(
    uint8_t status, uint8_t *response_data,
    uint32_t response_data_length __attribute__((unused))) {
  if (status != 0x00) {
    fd_nrf8001_get_device_address_error(status);
    return;
  }
  uint8_t *address = response_data;
  uint8_t configuration_id = response_data[6];
  fd_nrf8001_get_device_address_success(address, configuration_id);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <fd_nrf8001_dispatch_get_device_address_response+0x29>
mov    -0x4(%rbp),%edi
call   1030 <fd_nrf8001_get_device_address_error@plt>
jmp    1167 <fd_nrf8001_dispatch_get_device_address_response+0x47>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <fd_nrf8001_get_device_address_success@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
test   %edi,%edi
je     1129 <fd_nrf8001_dispatch_get_device_address_response+0x9>
jmp    1030 <fd_nrf8001_get_device_address_error@plt>
mov    0x18(%rsi),%eax
mov    %rsi,%rdi
mov    %eax,%esi
jmp    1040 <fd_nrf8001_get_device_address_success@plt>

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

LLVM IR (-O2):
define void @fd_nrf8001_dispatch_get_device_address_response(i32 %0, i32* %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @fd_nrf8001_get_device_address_error(i32 %0)
br label %11
7: ; preds = %3
%8 = getelementptr inbounds i32, i32* %1, i64 6
%9 = load i32, i32* %8
%10 = tail call i32 @fd_nrf8001_get_device_address_success(i32* %1, i32 %9)
br label %11
11: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0;
  int i = 0;
  for (; i < 10; i++) {
    a += i;
  }
  printf("%i\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 45)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x74() {
  Assert_real((isbdigit(116) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              585, ("isbdigit should be 0 for t"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x74>:
push   %rbp
mov    %rsp,%rbp
mov    $0x74,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x249,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x74>:
push   %rax
mov    $0x74,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x249,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for t\00"
define void @t_isbdigit_0x74() {
%1 = call i64 @isbdigit(i32 116)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 585, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for t\00"
define void @t_isbdigit_0x74() {
%1 = tail call i64 @isbdigit(i32 116)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 585, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int reset_release_bulk(struct reset_ctl_bulk *bulk) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.reset_ctl_bulk = type opaque
define i32 @reset_release_bulk(%struct.reset_ctl_bulk* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xbc() {
  Assert_real((iscntrl(188) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              945, ("iscntrl should be 0 for 0xbc"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0xbc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbc,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3b1,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0xbc>:
push   %rax
mov    $0xbc,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3b1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xbc\00"
define void @t_iscntrl_0xbc() {
%1 = call i64 @iscntrl(i32 188)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 945, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xbc\00"
define void @t_iscntrl_0xbc() {
%1 = tail call i64 @iscntrl(i32 188)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 945, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long long endian_fix32(unsigned long long);
__attribute__((always_)) unsigned long long endian_fix64(unsigned long long x) {
  return endian_fix32(x >> 32) + ((unsigned long long)endian_fix32(x) << 32);
}


x86 assembly (clang, -O0):
<endian_fix64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
shr    $0x20,%rdi
call   1030 <endian_fix32@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <endian_fix32@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
shl    $0x20,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_fix64>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
shr    $0x20,%rdi
call   1030 <endian_fix32@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <endian_fix32@plt>
shl    $0x20,%rax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @endian_fix64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = call i64 @endian_fix32(i64 %4)
%6 = load i64, i64* %2
%7 = call i64 @endian_fix32(i64 %6)
%8 = shl i64 %7, 32
%9 = add i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @endian_fix64(i64 %0) {
%2 = lshr i64 %0, 32
%3 = tail call i64 @endian_fix32(i64 %2)
%4 = tail call i64 @endian_fix32(i64 %0)
%5 = shl i64 %4, 32
%6 = add i64 %5, %3
ret i64 %6
}
void XtCvtStringToTranslationTable() {}


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

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

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

LLVM IR (-O2):
define void @XtCvtStringToTranslationTable() {
ret void
}
int securestore_key_query(char *keyname, unsigned int *query_return) {
  return -1;
}


x86 assembly (clang, -O0):
<securestore_key_query>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @securestore_key_query(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 -1
}
void Drv_UART_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @Drv_UART_Init() {
ret void
}
char *insert_linefeed(char *str) {
  *(str++) = '\n';
  *(str++) = '\r';
  *str = '\0';
  return str;
}


x86 assembly (clang, -O0):
<insert_linefeed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0xa,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0xd,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_linefeed>:
movw   $0xd0a,(%rdi)
movb   $0x0,0x2(%rdi)
lea    0x2(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @insert_linefeed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i32 1
store i8* %4, i8** %2
store i8 10, i8* %3
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
store i8 13, i8* %5
%7 = load i8*, i8** %2
store i8 0, i8* %7
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define i8* @insert_linefeed(i8* writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 10, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 13, i8* %2
store i8 0, i8* %3
ret i8* %3
}
int cmp(const void *a, const void *b) {
  int aa = *((int *)a);
  int bb = *((int *)b);
  return (aa) - (bb);
}


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

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

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int __test() {
  unsigned x = -1;
  int y = 3;
  return x > y;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__test() {
%1 = alloca i32
%2 = alloca i32
store i32 -1, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = icmp ugt i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @__test() {
ret i32 1
}