xunge/DecIR huggingface dataset:
void cmd_user(char *prefix, char **params, int n_params) {}


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

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

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

LLVM IR (-O2):
define void @cmd_user(i8* nocapture %0, i8** nocapture %1, i32 %2) {
ret void
}
main() {
  struct {
    int x;
    int y;
  } z;
  z.x = 1;
  z.y = 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, i32 }
define i32 @main() {
%1 = alloca %struct.anon
%2 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
store i32 1, i32* %2
%3 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 1
store i32 2, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ uart_write_str(char const *);
void cout(const char *str) { uart_write_str(str); }


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

x86 assembly (clang, -O2):
<cout>:
jmp    1030 <uart_write_str@plt>

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

LLVM IR (-O2):
define void @cout(i8* %0) {
%2 = tail call i32 @uart_write_str(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ choose();
one_shot_event_broadcaster() {
  choose();
  choose();
}


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

x86 assembly (clang, -O2):
<one_shot_event_broadcaster>:
push   %rax
xor    %eax,%eax
call   1030 <choose@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <choose@plt>

LLVM IR (-O0):
define i32 @one_shot_event_broadcaster() {
%1 = alloca i32
%2 = call i32 (...) @choose()
%3 = call i32 (...) @choose()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @one_shot_event_broadcaster() {
%1 = tail call i32 (...) @choose()
%2 = tail call i32 (...) @choose()
ret i32 undef
}
__attribute__((pure)) _Complex long foo_long(int x) {
  _Complex long r;
  __real r = x + 1;
  __imag r = x - 1;
  return r;
}


x86 assembly (clang, -O0):
<foo_long>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_long>:
lea    0x1(%rdi),%eax
cltq
add    $0xffffffff,%edi
movslq %edi,%rdx
ret

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

LLVM IR (-O2):
define { i64, i64 } @foo_long(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = sext i32 %2 to i64
%4 = add nsw i32 %0, -1
%5 = sext i32 %4 to i64
%6 = insertvalue { i64, i64 } poison, i64 %3, 0
%7 = insertvalue { i64, i64 } %6, i64 %5, 1
ret { i64, i64 } %7
}
int xor4(int i, int j) { return ((j / 2 + i / 3) % 2) ? 0 : 1; }


x86 assembly (clang, -O0):
<xor4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor4>:
mov    %esi,%ecx
shr    $0x1f,%ecx
add    %esi,%ecx
shr    %ecx
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
add    %ecx,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @xor4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 2
%7 = load i32, i32* %3
%8 = sdiv i32 %7, 3
%9 = add nsw i32 %6, %8
%10 = srem i32 %9, 2
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
ret i32 %13
}

LLVM IR (-O2):
define i32 @xor4(i32 %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = sdiv i32 %0, 3
%5 = add nsw i32 %3, %4
%6 = and i32 %5, 1
%7 = xor i32 %6, 1
ret i32 %7
}
void INT_Excep_PERIB_INTB200(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB200() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ writew(char *, int);
void write_status(int value) {
  char *file = "/tmp/det_wan_type";
  if (writew(file, value))
    return;
  printf("WAN Detecting: writing status value %d failed firstly!\n", value);
  writew(file, value);
}


x86 assembly (clang, -O0):
<write_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <writew@plt>
cmp    $0x0,%rax
je     1151 <write_status+0x31>
jmp    116c <write_status+0x4c>
mov    -0x4(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <writew@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_status>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1040 <writew@plt>
test   %rax,%rax
je     1138 <write_status+0x18>
pop    %rbx
ret
lea    0xed3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <writew@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"/tmp/det_wan_type\00"
@.str.1 = [56 x i8] c"WAN Detecting: writing status value %d failed firstly!\0A\00"
define void @write_status(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* %2
%6 = call i64 @writew(i8* %4, i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %15
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i8*, i8** %3
%13 = load i32, i32* %2
%14 = call i64 @writew(i8* %12, i32 %13)
br label %15
15: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"/tmp/det_wan_type\00"
@.str.1 = [56 x i8] c"WAN Detecting: writing status value %d failed firstly!\0A\00"
define void @write_status(i32 %0) {
%2 = tail call i64 @writew(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%6 = tail call i64 @writew(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %1, %4
ret void
}
int is_prime(int n) {
  int i;
  for (i = 2; i <= n - 1; i++) {
    if (n % i == 0) {
      return 0;
    }
  }
  if (i == n) {
    return 1;
  }
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     114e <is_prime+0x4e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113b <is_prime+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1161 <is_prime+0x61>
jmp    1140 <is_prime+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1161 <is_prime+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <is_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <is_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <is_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
void sfun(void) {}


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

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

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

LLVM IR (-O2):
define void @sfun() {
ret void
}
/* Type definitions */
struct Vector {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Vector *);
void vector_release(struct Vector *vector) { free(vector); }


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

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

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

LLVM IR (-O2):
%struct.Vector = type { i32 }
define void @vector_release(%struct.Vector* nocapture %0) {
%2 = tail call i32 @free(%struct.Vector* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char const *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
const char *current_time(const char *format) {
  static char date[1024];
  time_t now;
  struct tm tnow;
  time(&now);
  tnow = *localtime(&now);
  strftime(date, 32, format, &tnow);
  return date;
}


x86 assembly (clang, -O0):
<current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
lea    0x2ef2(%rip),%rdi
mov    $0x20,%esi
lea    -0x10(%rbp),%rcx
call   1050 <strftime@plt>
lea    0x2edd(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_time>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,(%rsp)
lea    0x2ef8(%rip),%rbx
mov    %rsp,%rcx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %r14,%rdx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@current_time.date = internal global [1024 x i8] zeroinitializer
define i8* @current_time(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm
store i8* %0, i8** %2
%5 = call i32 @time(i32* %3)
%6 = call %struct.tm* @localtime(i32* %3)
%7 = bitcast %struct.tm* %4 to i8*
%8 = bitcast %struct.tm* %6 to i8*
%9 = load i8*, i8** %2
%10 = call i32 @strftime(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @current_time.date, i64 0, i64 0), i32 32, i8* %9, %struct.tm* %4)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @current_time.date, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@current_time.date = internal global [1024 x i8] zeroinitializer
define i8* @current_time(i8* %0) {
%2 = alloca i32
%3 = alloca %struct.tm
%4 = bitcast i32* %2 to i8*
%5 = bitcast %struct.tm* %3 to i8*
%6 = call i32 @time(i32* %2)
%7 = call %struct.tm* @localtime(i32* %2)
%8 = getelementptr %struct.tm, %struct.tm* %7, i64 0, i32 0
%9 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
%10 = load i32, i32* %8
store i32 %10, i32* %9
%11 = call i32 @strftime(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @current_time.date, i64 0, i64 0), i32 32, i8* %0, %struct.tm* %3)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @current_time.date, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_wifi_power(long);
long strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  long value = 0;
  if (argc != 2) {
    printf("wrong number of arguments\n");
    return -1;
  }
  value = strtol(argv[1], NULL, 10);
  set_wifi_power(value);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1170 <main+0x40>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    119a <main+0x6a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <set_wifi_power@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    1152 <main+0x22>
mov    0x8(%rsi),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,%rdi
call   1050 <set_wifi_power@plt>
jmp    1163 <main+0x33>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"wrong number of arguments\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %18
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @strtol(i8* %14, i32* null, i32 10)
store i64 %15, i64* %6
%16 = load i64, i64* %6
%17 = call i32 @set_wifi_power(i64 %16)
store i32 0, i32* %3
br label %18
18: ; preds = %11, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@str = [26 x i8] c"wrong number of arguments\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strtol(i8* nocapture %8, i32* null, i32 10)
%10 = tail call i32 @set_wifi_power(i64 %9)
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %12
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int add_raw_data(struct buffer *, int, unsigned char *, int);
int add_randvect_avp(struct buffer *buf, unsigned char *c, int len) {
  return add_raw_data(buf, 36, c, len);
}


x86 assembly (clang, -O0):
<add_randvect_avp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x24,%esi
call   1030 <add_raw_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_randvect_avp>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x24,%esi
jmp    1030 <add_raw_data@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @add_randvect_avp(%struct.buffer* %0, i8* %1, i32 %2) {
%4 = alloca %struct.buffer*
%5 = alloca i8*
%6 = alloca i32
store %struct.buffer* %0, %struct.buffer** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.buffer*, %struct.buffer** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @add_raw_data(%struct.buffer* %7, i32 36, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @add_randvect_avp(%struct.buffer* %0, i8* %1, i32 %2) {
%4 = tail call i32 @add_raw_data(%struct.buffer* %0, i32 36, i8* %1, i32 %2)
ret i32 %4
}
int isright_brace(char c) { return ']' == c ? 1 : 0; }


x86 assembly (clang, -O0):
<isright_brace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%esi
mov    $0x5d,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isright_brace>:
xor    %eax,%eax
cmp    $0x5d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isright_brace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 93, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @isright_brace(i8 signext %0) {
%2 = icmp eq i8 %0, 93
%3 = zext i1 %2 to i32
ret i32 %3
}
double area2(float *v0, float *v1, float *v2) {
  return (v1[0] - v0[0]) * (v2[1] - v0[1]) - (v2[0] - v0[0]) * (v1[1] - v0[1]);
}


x86 assembly (clang, -O0):
<area2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm2
mov    -0x8(%rbp),%rax
subss  0x4(%rax),%xmm2
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
subss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm3
mov    -0x8(%rbp),%rax
subss  0x4(%rax),%xmm3
mulss  %xmm3,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<area2>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  (%rsi),%xmm2
movss  0x4(%rsi),%xmm3
subss  %xmm0,%xmm2
movss  (%rdx),%xmm4
movss  0x4(%rdx),%xmm5
subss  %xmm1,%xmm5
mulss  %xmm2,%xmm5
subss  %xmm0,%xmm4
subss  %xmm1,%xmm3
mulss  %xmm4,%xmm3
subss  %xmm3,%xmm5
xorps  %xmm0,%xmm0
cvtss2sd %xmm5,%xmm0
ret

LLVM IR (-O0):
define double @area2(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 1
%19 = load float, float* %18
%20 = fsub float %16, %19
%21 = load float*, float** %6
%22 = getelementptr inbounds float, float* %21, i64 0
%23 = load float, float* %22
%24 = load float*, float** %4
%25 = getelementptr inbounds float, float* %24, i64 0
%26 = load float, float* %25
%27 = fsub float %23, %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 1
%30 = load float, float* %29
%31 = load float*, float** %4
%32 = getelementptr inbounds float, float* %31, i64 1
%33 = load float, float* %32
%34 = fsub float %30, %33
%35 = fmul float %27, %34
%36 = fneg float %35
%37 = call float @llvm.fmuladd.f32(float %13, float %20, float %36)
%38 = fpext float %37 to double
ret double %38
}

LLVM IR (-O2):
define double @area2(float* nocapture %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %0
%6 = fsub float %4, %5
%7 = getelementptr inbounds float, float* %2, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = load float, float* %2
%13 = fsub float %12, %5
%14 = getelementptr inbounds float, float* %1, i64 1
%15 = load float, float* %14
%16 = fsub float %15, %10
%17 = fneg float %13
%18 = fmul float %16, %17
%19 = tail call float @llvm.fmuladd.f32(float %6, float %11, float %18)
%20 = fpext float %19 to double
ret double %20
}
double Km2Miles(const double valueKm) { return valueKm / 1.609344; }


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

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

LLVM IR (-O0):
define double @Km2Miles(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 0x3FF9BFDF7E8038A0
ret double %4
}

LLVM IR (-O2):
define double @Km2Miles(double %0) {
%2 = fdiv double %0, 0x3FF9BFDF7E8038A0
ret double %2
}
void INT_Excep_ICU_IRQ3(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_IRQ3() {
ret void
}
int test_fun(int x, int y, int z) {
  int c = 0;
  while ((x > z) && (y > z)) {
    x = x - 1;
    y = y - 1;
    c = c + 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jle    1131 <test_fun+0x31>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1141 <test_fun+0x41>
jmp    1161 <test_fun+0x61>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <test_fun+0x14>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
xor    %eax,%eax
cmp    %edx,%edi
jle    1122 <test_fun+0x22>
cmp    %edx,%esi
jle    1122 <test_fun+0x22>
not    %edx
add    %edx,%edi
add    %esi,%edx
cmp    %edi,%edx
cmovae %edi,%edx
add    $0x1,%edx
test   %edi,%edi
mov    $0x1,%eax
cmovne %edx,%eax
ret

LLVM IR (-O0):
define i32 @test_fun(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %18, %3
%9 = load i32, i32* %4
%10 = load i32, i32* %6
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ false, %8 ], [ %15, %12 ]
br i1 %17, label %18, label %25
18: ; preds = %16
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %4
%21 = load i32, i32* %5
%22 = sub nsw i32 %21, 1
store i32 %22, i32* %5
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %8
25: ; preds = %16
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @test_fun(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = icmp sgt i32 %1, %2
%6 = and i1 %4, %5
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = xor i32 %2, -1
%9 = add i32 %8, %0
%10 = xor i32 %2, -1
%11 = add i32 %10, %1
%12 = icmp eq i32 %9, 0
%13 = call i32 @llvm.umin.i32(i32 %11, i32 %9)
%14 = add i32 %13, 1
%15 = select i1 %12, i32 1, i32 %14
br label %16
16: ; preds = %7, %3
%17 = phi i32 [ 0, %3 ], [ %15, %7 ]
ret i32 %17
}
void INT_Excep_RIIC2_EEI2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RIIC2_EEI2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sub() { printf("sub() called\n"); }


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"sub() called\0A\00"
define void @sub() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"sub() called\00"
define void @sub() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int system(char *);
void sighup(int n __attribute__((unused))) {
  if (system("openvt -s -l bash") == -1) {
    perror("system");
    exit(1);
  }
  signal(SIGHUP, sighup);
}


x86 assembly (clang, -O0):
<sighup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <system@plt>
cmp    $0xffffffff,%eax
jne    1176 <sighup+0x36>
lea    0xeab(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
mov    0x2e5a(%rip),%rsi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighup>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <system@plt>
cmp    $0xffffffff,%eax
je     1168 <sighup+0x28>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    0x2e7e(%rip),%rsi
pop    %rax
jmp    1040 <signal@plt>
lea    0xea3(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"openvt -s -l bash\00"
@.str.1 = [7 x i8] c"system\00"
@SIGHUP = global i32 0
define void @sighup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = load i32, i32* @SIGHUP
%10 = call i32 @signal(i32 %9, void (i32)* @sighup)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"openvt -s -l bash\00"
@.str.1 = [7 x i8] c"system\00"
@SIGHUP = global i32 0
define void @sighup(i32 %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = load i32, i32* @SIGHUP
%9 = tail call i32 @signal(i32 %8, void (i32)* @sighup)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i8080_hal_memory_write_byte(int, int);
void i8080_hal_memory_write_word(int addr, int word) {
  i8080_hal_memory_write_byte(addr, word & 0xff);
  i8080_hal_memory_write_byte(addr + 1, (word >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<i8080_hal_memory_write_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
and    $0xff,%esi
call   1030 <i8080_hal_memory_write_byte@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
sar    $0x8,%esi
and    $0xff,%esi
call   1030 <i8080_hal_memory_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i8080_hal_memory_write_word>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
mov    %edi,%ebx
movzbl %al,%esi
mov    %eax,%ebp
call   1030 <i8080_hal_memory_write_byte@plt>
add    $0x1,%ebx
mov    %ebp,%eax
movzbl %ah,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <i8080_hal_memory_write_byte@plt>

LLVM IR (-O0):
define void @i8080_hal_memory_write_word(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 = and i32 %6, 255
%8 = call i32 @i8080_hal_memory_write_byte(i32 %5, i32 %7)
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
%14 = call i32 @i8080_hal_memory_write_byte(i32 %10, i32 %13)
ret void
}

LLVM IR (-O2):
define void @i8080_hal_memory_write_word(i32 %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @i8080_hal_memory_write_byte(i32 %0, i32 %3)
%5 = add nsw i32 %0, 1
%6 = lshr i32 %1, 8
%7 = and i32 %6, 255
%8 = tail call i32 @i8080_hal_memory_write_byte(i32 %5, i32 %7)
ret void
}
extern void _kill(int pid, int sig) {
  (void)pid, (void)sig;
  return;
}


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

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

LLVM IR (-O0):
define void @_kill(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
ret void
}

LLVM IR (-O2):
define void @_kill(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ send(int, void *, size_t, int /*<<< orphan*/);
ssize_t mywrite(int fd, void *buf, size_t len) { return send(fd, buf, len, 0); }


x86 assembly (clang, -O0):
<mywrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mywrite>:
xor    %ecx,%ecx
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define i32 @mywrite(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ by_at(int /*<<< orphan*/);
int /*<<< orphan*/ shr();
void shr_by_at(uint32_t x) {
  by_at(x);
  shr();
}


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

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

LLVM IR (-O0):
define void @shr_by_at(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by_at(i32 %3)
%5 = call i32 (...) @shr()
ret void
}

LLVM IR (-O2):
define void @shr_by_at(i32 %0) {
%2 = tail call i32 @by_at(i32 %0)
%3 = tail call i32 (...) @shr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  bool a = 6 < 5;
  bool b = true;
  printf("%d\n", a);
  printf("%d\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
long long gcd(long long, long long);
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cqto
idiv   %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %rsi,%rbx
imul   %rdi,%rbx
call   1030 <gcd@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     1133 <lcm+0x23>
mov    %rbx,%rax
cqto
idiv   %rcx
pop    %rbx
ret
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i64 @lcm(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul nsw i64 %5, %6
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i64 @gcd(i64 %8, i64 %9)
%11 = sdiv i64 %7, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @lcm(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
%4 = tail call i64 @gcd(i64 %0, i64 %1)
%5 = sdiv i64 %3, %4
ret i64 %5
}
int irint(float f) { return (int)(f + 0.5); }


x86 assembly (clang, -O0):
<irint>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<irint>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @irint(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @irint(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 5.000000e-01
%4 = fptosi double %3 to i32
ret i32 %4
}
/* Variables and functions */
int __infer_nondet_int();
int flock(int fd, int operation) {
  int ret;
  ret = __infer_nondet_int();
  if (ret < -1 || ret > 0)
    while (1)
      ;
  return ret;
}


x86 assembly (clang, -O0):
<flock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jl     113c <flock+0x2c>
cmpl   $0x0,-0xc(%rbp)
jle    1146 <flock+0x36>
jmp    1141 <flock+0x31>
jmp    1141 <flock+0x31>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flock>:
push   %rax
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
lea    -0x1(%rax),%ecx
cmp    $0xfffffffd,%ecx
ja     1122 <flock+0x12>
jmp    1120 <flock+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @flock(i32 %0, i32 %1) {
%3 = tail call i32 (...) @__infer_nondet_int()
%4 = add i32 %3, -1
%5 = icmp ult i32 %4, -2
br i1 %5, label %6, label %7
6: ; preds = %2, %6
br label %6
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
void baz_3(int a, int b, int c) {
  if (a && b > 10)
    foo();
  if (b < 5 && c)
    bar();
}


x86 assembly (clang, -O0):
<baz_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114c <baz_3+0x2c>
cmpl   $0xa,-0x8(%rbp)
jle    114c <baz_3+0x2c>
mov    $0x0,%al
call   1040 <foo@plt>
cmpl   $0x5,-0x8(%rbp)
jge    1167 <baz_3+0x47>
cmpl   $0x0,-0xc(%rbp)
je     1167 <baz_3+0x47>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz_3>:
test   %edi,%edi
je     1130 <baz_3+0x10>
cmp    $0xb,%esi
jl     1130 <baz_3+0x10>
xor    %eax,%eax
jmp    1040 <foo@plt>
cmp    $0x4,%esi
jg     1140 <baz_3+0x20>
test   %edx,%edx
je     1140 <baz_3+0x20>
xor    %eax,%eax
jmp    1030 <bar@plt>
ret

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

LLVM IR (-O2):
define void @baz_3(i32 %0, i32 %1, i32 %2) {
%4 = icmp ne i32 %0, 0
%5 = icmp sgt i32 %1, 10
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (...) @foo()
br label %15
9: ; preds = %3
%10 = icmp slt i32 %1, 5
%11 = icmp ne i32 %2, 0
%12 = and i1 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = tail call i32 (...) @bar()
br label %15
15: ; preds = %7, %13, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ helpOtherus();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello from got-bot for push event\n");
  helpOtherus();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"Hello from got-bot for push event\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @helpOtherus()
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"Hello from got-bot for push event\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @helpOtherus()
ret i32 0
}
float test_asinf(float x) { return __builtin_asinf(x); }


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

x86 assembly (clang, -O2):
<test_asinf>:
jmp    1030 <asinf@plt>

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

LLVM IR (-O2):
define float @test_asinf(float %0) {
%2 = tail call float @asinf(float %0)
ret float %2
}
/* Variables and functions */
scalar_t__ json_is_literal(char const *);
scalar_t__ json_is_number(char const *);
scalar_t__ json_is_string(char const *);
bool json_is_valid(const char *str) {
  return json_is_string(str) || json_is_number(str) || json_is_literal(str);
}


x86 assembly (clang, -O0):
<json_is_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <json_is_string@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1185 <json_is_valid+0x55>
mov    -0x8(%rbp),%rdi
call   1050 <json_is_number@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1185 <json_is_valid+0x55>
mov    -0x8(%rbp),%rdi
call   1030 <json_is_literal@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_is_valid>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <json_is_string@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1163 <json_is_valid+0x33>
mov    %rbx,%rdi
call   1050 <json_is_number@plt>
test   %rax,%rax
jne    1163 <json_is_valid+0x33>
mov    %rbx,%rdi
call   1030 <json_is_literal@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @json_is_valid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @json_is_string(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @json_is_number(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = call i64 @json_is_literal(i8* %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @json_is_valid(i8* %0) {
%2 = tail call i64 @json_is_string(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @json_is_number(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @json_is_literal(i8* %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;
typedef unsigned long *sigjmp_buf;
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ SIG_SETMASK;
int setjmp(void *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
int sigsetjmp(sigjmp_buf buf, int save) {
  unsigned long *flag = buf + sizeof(jmp_buf) / sizeof(long);
  sigset_t *mask = (void *)(flag + 1);
  if ((*flag = save))
    sigprocmask(SIG_SETMASK, NULL, mask);
  return setjmp((void *)buf);
}


x86 assembly (clang, -O0):
<sigsetjmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
movslq -0xc(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
je     116e <sigsetjmp+0x4e>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <sigprocmask@plt>
mov    -0x8(%rbp),%rdi
call   1040 <setjmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigsetjmp>:
push   %rbx
mov    %rdi,%rbx
movslq %esi,%rax
mov    %rax,(%rdi)
test   %eax,%eax
je     1142 <sigsetjmp+0x22>
lea    0x8(%rbx),%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <sigprocmask@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <setjmp@plt>

LLVM IR (-O0):
@SIG_SETMASK = global i32 0
define i32 @sigsetjmp(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i64*
%6 = alloca i32*
store i64* %0, i64** %3
store i32 %1, i32* %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
store i64* %8, i64** %5
%9 = load i64*, i64** %5
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = bitcast i64* %10 to i8*
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %6
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = load i64*, i64** %5
store i64 %14, i64* %15
%16 = icmp ne i64 %14, 0
br i1 %16, label %17, label %21
17: ; preds = %2
%18 = load i32, i32* @SIG_SETMASK
%19 = load i32*, i32** %6
%20 = call i32 @sigprocmask(i32 %18, i32* null, i32* %19)
br label %21
21: ; preds = %17, %2
%22 = load i64*, i64** %3
%23 = bitcast i64* %22 to i8*
%24 = call i32 @setjmp(i8* %23)
ret i32 %24
}

LLVM IR (-O2):
@SIG_SETMASK = global i32 0
define i32 @sigsetjmp(i64* %0, i32 %1) {
%3 = sext i32 %1 to i64
store i64 %3, i64* %0
%4 = icmp eq i32 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = getelementptr inbounds i64, i64* %0, i64 1
%7 = bitcast i64* %6 to i32*
%8 = load i32, i32* @SIG_SETMASK
%9 = tail call i32 @sigprocmask(i32 %8, i32* null, i32* %7)
br label %10
10: ; preds = %5, %2
%11 = bitcast i64* %0 to i8*
%12 = tail call i32 @setjmp(i8* %11)
ret i32 %12
}