xunge/DecIR huggingface dataset:
/* Variables and functions */
int GET32(int);
int /*<<< orphan*/ PUT32(int, unsigned int);
void uart_putc(char c) {
  if (c == '\n')
    uart_putc('\r');
  while (1) {
    if (GET32(0x20215054) & 0x20)
      break;
  }
  PUT32(0x20215040, (unsigned int)c);
}


x86 assembly (clang, -O0):
<uart_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1155 <uart_putc+0x25>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
jmp    115a <uart_putc+0x2a>
mov    $0x20215054,%edi
call   1050 <GET32@plt>
and    $0x20,%eax
cmp    $0x0,%eax
je     1175 <uart_putc+0x45>
jmp    117a <uart_putc+0x4a>
jmp    115a <uart_putc+0x2a>
movsbl -0x1(%rbp),%esi
mov    $0x20215040,%edi
call   1040 <PUT32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_putc>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%bl
jne    1150 <uart_putc+0x30>
nopl   0x0(%rax,%rax,1)
mov    $0x20215054,%edi
call   1040 <GET32@plt>
test   $0x20,%al
je     1130 <uart_putc+0x10>
mov    $0x20215040,%edi
mov    $0xd,%esi
call   1030 <PUT32@plt>
nopl   (%rax)
mov    $0x20215054,%edi
call   1040 <GET32@plt>
test   $0x20,%al
je     1150 <uart_putc+0x30>
movsbl %bl,%esi
mov    $0x20215040,%edi
pop    %rbx
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @uart_putc(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 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %1
br label %8
8: ; preds = %7, %13
%9 = call i32 @GET32(i32 539054164)
%10 = and i32 %9, 32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
br label %14
13: ; preds = %8
br label %8
14: ; preds = %12
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = call i32 @PUT32(i32 539054144, i32 %16)
ret void
}

LLVM IR (-O2):
define void @uart_putc(i8 signext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = tail call i32 @GET32(i32 539054164)
%5 = and i32 %4, 32
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = tail call i32 @PUT32(i32 539054144, i32 13)
br label %9
9: ; preds = %7, %1
br label %10
10: ; preds = %9, %10
%11 = tail call i32 @GET32(i32 539054164)
%12 = and i32 %11, 32
%13 = icmp eq i32 %12, 0
br i1 %13, label %10, label %14
14: ; preds = %10
%15 = sext i8 %0 to i32
%16 = tail call i32 @PUT32(i32 539054144, i32 %15)
ret void
}
int std_none(struct usb_dev *dev) {
  (void)dev;
  return -1;
}


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

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

LLVM IR (-O0):
%struct.usb_dev = type opaque
define i32 @std_none(%struct.usb_dev* %0) {
%2 = alloca %struct.usb_dev*
store %struct.usb_dev* %0, %struct.usb_dev** %2
%3 = load %struct.usb_dev*, %struct.usb_dev** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.usb_dev = type opaque
define i32 @std_none(%struct.usb_dev* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ debug_ol(char *);
int /*<<< orphan*/ ol(char *);
doublereg() {
  debug_ol("; doublereg");
  ol("lsld");
}


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

x86 assembly (clang, -O2):
<doublereg>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <debug_ol@plt>
lea    0xed8(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"; doublereg\00"
@.str.1 = [5 x i8] c"lsld\00"
define i32 @doublereg() {
%1 = alloca i32
%2 = call i32 @debug_ol(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"; doublereg\00"
@.str.1 = [5 x i8] c"lsld\00"
define i32 @doublereg() {
%1 = tail call i32 @debug_ol(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_window_ask_refresh(int);
void config_change_read_marker(const void *pointer, void *data,
                               struct t_config_option *option) {
  (void)pointer;
  (void)data;
  (void)option;
  gui_window_ask_refresh(1);
}


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

x86 assembly (clang, -O2):
<config_change_read_marker>:
mov    $0x1,%edi
jmp    1030 <gui_window_ask_refresh@plt>

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

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @config_change_read_marker(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2) {
%4 = tail call i32 @gui_window_ask_refresh(i32 1)
ret void
}
int ft_any(char **tab, int (*f)(char *)) {
  int i;
  i = 0;
  while (tab[i]) {
    if (f(tab[i]) == 1)
      return (1);
    i++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_any>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     115f <ft_any+0x5f>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rdi
call   *%rax
cmp    $0x1,%eax
jne    1151 <ft_any+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1166 <ft_any+0x66>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <ft_any+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_any>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbp
mov    (%rdi),%rdi
xor    %r14d,%r14d
test   %rdi,%rdi
je     113c <ft_any+0x3c>
mov    %rsi,%rbx
add    $0x8,%rbp
nopl   0x0(%rax)
call   *%rbx
cmp    $0x1,%eax
je     1136 <ft_any+0x36>
mov    0x0(%rbp),%rdi
add    $0x8,%rbp
test   %rdi,%rdi
jne    1120 <ft_any+0x20>
jmp    113c <ft_any+0x3c>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ft_any(i8** nocapture %0, i32 (i8*)* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %15, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8*, i8** %0, i64 %14
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %15, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %14, %5 ], [ 0, %2 ]
%11 = phi i8* [ %7, %5 ], [ %3, %2 ]
%12 = tail call i32 %1(i8* %11)
%13 = icmp eq i32 %12, 1
%14 = add nuw i64 %10, 1
br i1 %13, label %15, label %5
15: ; preds = %9, %5, %2
%16 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sdt(char *);
main() {
  char cha[30];
  printf("input a string:");
  sdt(cha);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <sdt@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rdi
call   1040 <sdt@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"input a string:\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%4 = call i32 @sdt(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"input a string:\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sdt(i8* %2)
ret i32 0
}
int isDigit(char c) {
  if ((c >= '0') && (c <= '9'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <isDigit+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <isDigit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <isDigit+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isDigit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @isDigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void start_randomcounting(int delay_value) {
  printf("/* DIY : Student has to implement this */\n");
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"/* DIY : Student has to implement this */\0A\00"
define void @start_randomcounting(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"/* DIY : Student has to implement this */\00"
define void @start_randomcounting(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *analyse(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *mystr = "abc35*ghj+*+";
  char *a = analyse(mystr);
  printf("Result: %s \n", a);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"abc35*ghj+*+\00"
@.str.1 = [13 x i8] c"Result: %s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @analyse(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"abc35*ghj+*+\00"
@.str.1 = [13 x i8] c"Result: %s \0A\00"
define i32 @main() {
%1 = tail call i8* @analyse(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Type definitions */
typedef char *pid_t;

/* Variables and functions */
pid_t setsid(void) {
  long __res;
  __asm__ volatile("int $0x80" : "=a"(__res) : "0"(66));
  do {
    return (pid_t)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<setsid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x42,%eax
int    $0x80
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setsid>:
mov    $0x42,%eax
int    $0x80
ret

LLVM IR (-O0):
define i8* @setsid() {
%1 = alloca i64
%2 = call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 66)
store i64 %2, i64* %1
br label %3
3: ; preds = %0
%4 = load i64, i64* %1
%5 = inttoptr i64 %4 to i8*
br label %6
6: ; preds = %3
ret i8* %5
}

LLVM IR (-O2):
define i8* @setsid() {
%1 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 66)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
unsigned char iowTouchByte(int);
unsigned char iowReadByte(void) { return iowTouchByte(0xFF); }


x86 assembly (clang, -O0):
<iowReadByte>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
call   1030 <iowTouchByte@plt>
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @iowReadByte() {
%1 = call zeroext i8 @iowTouchByte(i32 255)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @iowReadByte() {
%1 = tail call zeroext i8 @iowTouchByte(i32 255)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, int /*<<< orphan*/);
int /*<<< orphan*/ qNT(double);
int main(void) {
  double q = 0.0;
  for (; q <= 100; q += 5) {
    printf("q = %lf, qNT(q) = %lf\n", q, qNT(q));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec1(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1188 <main+0x68>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <qNT@plt>
movsd  -0x18(%rbp),%xmm0
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe8f(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1137 <main+0x17>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xorpd  %xmm0,%xmm0
mov    $0xfffffffb,%ebp
lea    0xed5(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
call   1040 <qNT@plt>
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
addsd  0xe95(%rip),%xmm0
add    $0x5,%ebp
cmp    $0x60,%ebp
jb     1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"q = %lf, qNT(q) = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %3
3: ; preds = %11, %0
%4 = load double, double* %2
%5 = fcmp ole double %4, 1.000000e+02
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load double, double* %2
%8 = load double, double* %2
%9 = call i32 @qNT(double %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %7, i32 %9)
br label %11
11: ; preds = %6
%12 = load double, double* %2
%13 = fadd double %12, 5.000000e+00
store double %13, double* %2
br label %3
14: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"q = %lf, qNT(q) = %lf\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = sitofp i32 %2 to double
%4 = tail call i32 @qNT(double %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %3, i32 %4)
%6 = add nuw nsw i32 %2, 5
%7 = icmp ugt i32 %2, 95
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
int main(int argc, char **argv) {
  int retval = 0;
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void consoleSetUnderline(int underline) {}


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

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

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

LLVM IR (-O2):
define void @consoleSetUnderline(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
char *alloca(scalar_t__);
scalar_t__ casepath(char const *, char *);
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ errno;
scalar_t__ strlen(char const *);
void casechdir(char const *path) {
  char *r = alloca(strlen(path) + 2);
  if (casepath(path, r)) {
    chdir(r);
  } else {
    errno = ENOENT;
  }
}


x86 assembly (clang, -O0):
<casechdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x2,%rdi
call   1060 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <casepath@plt>
cmp    $0x0,%rax
je     118a <casechdir+0x4a>
mov    -0x10(%rbp),%rdi
call   1050 <chdir@plt>
jmp    119c <casechdir+0x5c>
mov    0x2e3f(%rip),%rax
mov    (%rax),%ecx
mov    0x2e46(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<casechdir>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x2(%rax),%rdi
call   1060 <alloca@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <casepath@plt>
test   %rax,%rax
je     1177 <casechdir+0x37>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <chdir@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%eax
mov    0x2e59(%rip),%rcx
mov    %eax,(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define void @casechdir(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 2
%7 = call i8* @alloca(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %2
%9 = load i8*, i8** %3
%10 = call i64 @casepath(i8* %8, i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i32 @chdir(i8* %13)
br label %17
15: ; preds = %1
%16 = load i32, i32* @ENOENT
store i32 %16, i32* @errno
br label %17
17: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define void @casechdir(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 2
%4 = tail call i8* @alloca(i64 %3)
%5 = tail call i64 @casepath(i8* %0, i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @chdir(i8* %4)
br label %11
9: ; preds = %1
%10 = load i32, i32* @ENOENT
store i32 %10, i32* @errno
br label %11
11: ; preds = %9, %7
ret void
}
long int baz(long int s, long int a) { return a; }


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

x86 assembly (clang, -O2):
<baz>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @baz(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @baz(i64 %0, i64 returned %1) {
ret i64 %1
}
/* Variables and functions */
char *malloc(size_t);
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *getInfo() {
  char *name;
  size_t size;
  size = strlen("Diagonals (C) 2004 Panayotis Katsaloulis "
                "http://www.panayotis.com under GNU GPL");
  name = malloc(size + 1);
  strncpy(name,
          ("Diagonals (C) 2004 Panayotis Katsaloulis http://www.panayotis.com "
           "under GNU GPL"),
          size + 1);
  return name;
}


x86 assembly (clang, -O0):
<getInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
lea    0xe94(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInfo>:
push   %rbx
mov    $0x50,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    $0x50,%edx
mov    %rax,%rdi
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [80 x i8] c"Diagonals (C) 2004 Panayotis Katsaloulis http://www.panayotis.com under GNU GPL\00"
define i8* @getInfo() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i64 @strlen(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 1
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = load i64, i64* %2
%9 = add i64 %8, 1
%10 = call i32 @strncpy(i8* %7, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [80 x i8] c"Diagonals (C) 2004 Panayotis Katsaloulis http://www.panayotis.com under GNU GPL\00"
define i8* @getInfo() {
%1 = tail call dereferenceable_or_null(80) i8* @malloc(i64 80)
%2 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i64 80)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ glClearColor(double, double, double, double);
void init(void) { glClearColor(1.0, 1.0, 1.0, 0.0); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm2
xorps  %xmm3,%xmm3
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1030 <glClearColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
movsd  0xee8(%rip),%xmm0
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
jmp    1030 <glClearColor@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 @glClearColor(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 @glClearColor(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 0.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CrestInit();
void __globinit_heapSort(void) {
  { __CrestInit(); }
}


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

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

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

LLVM IR (-O2):
define void @__globinit_heapSort() {
%1 = tail call i32 (...) @__CrestInit()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void setInitializerHasRun(uint64_t *guard_object) {
  *((uint8_t *)guard_object) = 1;
}


x86 assembly (clang, -O0):
<setInitializerHasRun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setInitializerHasRun>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @setInitializerHasRun(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void uDMAIntUnregister(unsigned long ulIntChannel) {
  IntDisable(ulIntChannel);
  IntUnregister(ulIntChannel);
}


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

x86 assembly (clang, -O2):
<uDMAIntUnregister>:
push   %rbx
mov    %rdi,%rbx
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <IntUnregister@plt>

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

LLVM IR (-O2):
define void @uDMAIntUnregister(i64 %0) {
%2 = tail call i32 @IntDisable(i64 %0)
%3 = tail call i32 @IntUnregister(i64 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ val;
typedef int uint32_t;

/* Variables and functions */
uint32_t __fswahw32(uint32_t val) {
  return ((uint32_t)((((uint32_t)(val) & (uint32_t)0x0000ffffUL) << 16) |
                     (((uint32_t)(val) & (uint32_t)0xffff0000UL) >> 16)));
}


x86 assembly (clang, -O0):
<__fswahw32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
and    $0xffff0000,%ecx
sar    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fswahw32>:
mov    %edi,%eax
shl    $0x10,%eax
sar    $0x10,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @__fswahw32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = shl i32 %4, 16
%6 = load i32, i32* %2
%7 = and i32 %6, -65536
%8 = ashr i32 %7, 16
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @__fswahw32(i32 %0) {
%2 = shl i32 %0, 16
%3 = ashr i32 %0, 16
%4 = or i32 %2, %3
ret i32 %4
}
double bds_tgd(int tgd) {
  tgd &= 0x3FF;
  return (tgd & 0x200) ? -1E10 * ((~tgd) & 0x1FF) : 1E-10 * (tgd & 0x1FF);
}


x86 assembly (clang, -O0):
<bds_tgd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3ff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
je     1148 <bds_tgd+0x48>
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    $0x1ff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1165 <bds_tgd+0x65>
mov    -0x4(%rbp),%eax
and    $0x1ff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xea4(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bds_tgd>:
mov    %edi,%eax
and    $0x1ff,%eax
mov    %eax,%ecx
xor    $0x1ff,%ecx
xor    %edx,%edx
test   $0x200,%edi
cmove  %eax,%ecx
cvtsi2sd %ecx,%xmm0
sete   %dl
lea    0xed8(%rip),%rax
mulsd  (%rax,%rdx,8),%xmm0
ret

LLVM IR (-O0):
define double @bds_tgd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1023
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 512
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %2
%10 = xor i32 %9, -1
%11 = and i32 %10, 511
%12 = sitofp i32 %11 to double
%13 = fmul double -1.000000e+10, %12
br label %19
14: ; preds = %1
%15 = load i32, i32* %2
%16 = and i32 %15, 511
%17 = sitofp i32 %16 to double
%18 = fmul double 1.000000e-10, %17
br label %19
19: ; preds = %14, %8
%20 = phi double [ %13, %8 ], [ %18, %14 ]
ret double %20
}

LLVM IR (-O2):
define double @bds_tgd(i32 %0) {
%2 = and i32 %0, 512
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 511
%5 = xor i32 %4, 511
%6 = select i1 %3, i32 %4, i32 %5
%7 = select i1 %3, double 1.000000e-10, double -1.000000e+10
%8 = sitofp i32 %6 to double
%9 = fmul double %7, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ kfree_skb(void *);
void __skb_array_destroy_skb(void *ptr) { kfree_skb(ptr); }


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

x86 assembly (clang, -O2):
<__skb_array_destroy_skb>:
jmp    1030 <kfree_skb@plt>

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

LLVM IR (-O2):
define void @__skb_array_destroy_skb(i8* %0) {
%2 = tail call i32 @kfree_skb(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tapPop(char *img, char *fname, char *oname) {
  printf("Not developed yet\n");
}


x86 assembly (clang, -O0):
<tapPop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"Not developed yet\0A\00"
define void @tapPop(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"Not developed yet\00"
define void @tapPop(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
int ratio(int n) {
  int sum = 0;
  while (1) {
    while (n > 0) {
      sum += (n % 10);
      n = n / 10;
    }
    if (sum < 10)
      break;
    n = sum;
    sum = 0;
  }
  return sum;
}


x86 assembly (clang, -O0):
<ratio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    1113 <ratio+0x13>
cmpl   $0x0,-0x4(%rbp)
jle    1141 <ratio+0x41>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1113 <ratio+0x13>
cmpl   $0xa,-0x8(%rbp)
jge    1150 <ratio+0x50>
jmp    1162 <ratio+0x62>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    110e <ratio+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ratio>:
mov    $0xcccccccd,%r8d
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
test   %edi,%edi
jle    1144 <ratio+0x44>
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
add    %ecx,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1120 <ratio+0x20>
mov    %eax,%edi
cmp    $0x9,%eax
ja     1110 <ratio+0x10>
ret

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

LLVM IR (-O2):
define i32 @ratio(i32 %0) {
br label %2
2: ; preds = %12, %1
%3 = phi i32 [ %0, %1 ], [ %9, %12 ]
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 0, %2 ]
%7 = phi i32 [ %10, %5 ], [ %3, %2 ]
%8 = urem i32 %7, 10
%9 = add nuw nsw i32 %6, %8
%10 = udiv i32 %7, 10
%11 = icmp ult i32 %7, 10
br i1 %11, label %12, label %5
12: ; preds = %5
%13 = icmp ult i32 %9, 10
br i1 %13, label %14, label %2
14: ; preds = %2, %12
%15 = phi i32 [ %9, %12 ], [ 0, %2 ]
ret i32 %15
}
void gtk_color_selection_palette_to_string() {}


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

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

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

LLVM IR (-O2):
define void @gtk_color_selection_palette_to_string() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ errno;
char const *strerror(int /*<<< orphan*/);
const char *mq_last_error(void) {
  int32_t tmp = errno;
  return strerror((tmp >= 0) ? tmp : -tmp);
}


x86 assembly (clang, -O0):
<mq_last_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1139 <mq_last_error+0x29>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <mq_last_error+0x31>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <strerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mq_last_error>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,%edi
neg    %edi
cmovs  %eax,%edi
jmp    1030 <strerror@plt>

LLVM IR (-O0):
@errno = global i32 0
define i8* @mq_last_error() {
%1 = alloca i32
%2 = load i32, i32* @errno
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* %1
br label %10
7: ; preds = %0
%8 = load i32, i32* %1
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
%12 = call i8* @strerror(i32 %11)
ret i8* %12
}

LLVM IR (-O2):
@errno = global i32 0
define i8* @mq_last_error() {
%1 = load i32, i32* @errno
%2 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%3 = tail call i8* @strerror(i32 %2)
ret i8* %3
}
/* Variables and functions */
scalar_t__ ClientBroadcast();
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (ClientBroadcast()) {
    printf(" client broadcast failed!\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <ClientBroadcast@plt>
cmp    $0x0,%rax
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <main+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <ClientBroadcast@plt>
test   %rax,%rax
je     1140 <main+0x20>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c" client broadcast failed!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @ClientBroadcast()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@str = [26 x i8] c" client broadcast failed!\00"
define i32 @main() {
%1 = tail call i64 (...) @ClientBroadcast()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ -1, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  printf("Enter the value of x:\n");
  scanf("%d", &x);
  printf("The factorial of x is :%d", fact(x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <fact@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter the value of x:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"The factorial of x is :%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @fact(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"The factorial of x is :%d\00"
@str = [22 x i8] c"Enter the value of x:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fact(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
char *fmenor(int c, char *pcadena[], char *(*comparar)()) {
  char *menor;
  menor = *pcadena;
  while (--c > 0)
    menor = comparar(menor, *++pcadena);
  return menor;
}


x86 assembly (clang, -O0):
<fmenor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jle    1158 <fmenor+0x58>
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x10(%rbp)
mov    0x8(%rax),%rsi
mov    $0x0,%al
call   *%rcx
mov    %rax,-0x20(%rbp)
jmp    111e <fmenor+0x1e>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmenor>:
push   %rbp
push   %r14
push   %rbx
mov    (%rsi),%rax
cmp    $0x2,%edi
jl     1137 <fmenor+0x37>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
add    $0x8,%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%rsi
mov    %rax,%rdi
xor    %eax,%eax
call   *%r14
add    $0xffffffff,%ebp
add    $0x8,%rbx
cmp    $0x2,%ebp
ja     1120 <fmenor+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @fmenor(i32 %0, i8** nocapture %1, i8* (...)* nocapture %2) {
%4 = load i8*, i8** %1
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = bitcast i8* (...)* %2 to i8* (i8*, i8*, ...)*
br label %8
8: ; preds = %6, %8
%9 = phi i8* [ %4, %6 ], [ %15, %8 ]
%10 = phi i32 [ %0, %6 ], [ %12, %8 ]
%11 = phi i8** [ %1, %6 ], [ %13, %8 ]
%12 = add nsw i32 %10, -1
%13 = getelementptr inbounds i8*, i8** %11, i64 1
%14 = load i8*, i8** %13
%15 = tail call i8* (i8*, i8*, ...) %7(i8* %9, i8* %14)
%16 = icmp ugt i32 %10, 2
br i1 %16, label %8, label %17
17: ; preds = %8, %3
%18 = phi i8* [ %4, %3 ], [ %15, %8 ]
ret i8* %18
}
void debug_asmlink_test() {}


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

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

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

LLVM IR (-O2):
define void @debug_asmlink_test() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  kill(3509, SIGKILL);
  printf("process 3530 was killed\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    $0xdb5,%edi
call   1040 <kill@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGKILL = global i32 0
@.str = [25 x i8] c"process 3530 was killed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SIGKILL
%3 = call i32 @kill(i32 3509, i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@SIGKILL = global i32 0
@str = [24 x i8] c"process 3530 was killed\00"
define i32 @main() {
%1 = load i32, i32* @SIGKILL
%2 = tail call i32 @kill(i32 3509, i32 %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x96() {
  Assert_real((isxdigit(150) == 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_isxdigit.c",
              755, ("isxdigit should be 0 for 0x96"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x96>:
push   %rax
mov    $0x96,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2f3,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x96\00"
define void @t_isxdigit_0x96() {
%1 = call i64 @isxdigit(i32 150)
%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 755, i8* getelementptr inbounds ([30 x i8], [30 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x96\00"
define void @t_isxdigit_0x96() {
%1 = tail call i64 @isxdigit(i32 150)
%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 755, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
void multiplicacion(void) {
  int a, b;
  printf(" Dos numeros para Multiplicar\n");
  scanf("%d %d", &a, &b);
  printf("multiplicacion: %d\n", a * b);
}


x86 assembly (clang, -O0):
<multiplicacion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplicacion>:
push   %rax
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    (%rsp),%esi
imul   0x4(%rsp),%esi
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [31 x i8] c" Dos numeros para Multiplicar\0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [20 x i8] c"multiplicacion: %d\0A\00"
define void @multiplicacion() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [20 x i8] c"multiplicacion: %d\0A\00"
@str = [30 x i8] c" Dos numeros para Multiplicar\00"
define void @multiplicacion() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, %7
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret void
}