xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ emit_andimm(int, int, int);
void emit_movzbl_reg(int rs, int rt) { emit_andimm(rs, 0xff, rt); }


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

x86 assembly (clang, -O2):
<emit_movzbl_reg>:
mov    %esi,%edx
mov    $0xff,%esi
jmp    1030 <emit_andimm@plt>

LLVM IR (-O0):
define void @emit_movzbl_reg(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 = call i32 @emit_andimm(i32 %5, i32 255, i32 %6)
ret void
}

LLVM IR (-O2):
define void @emit_movzbl_reg(i32 %0, i32 %1) {
%3 = tail call i32 @emit_andimm(i32 %0, i32 255, i32 %1)
ret void
}
int is_separator(char c) { return c == '/'; }


x86 assembly (clang, -O0):
<is_separator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_separator(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, 47
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_separator(i8 signext %0) {
%2 = icmp eq i8 %0, 47
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int INT_MAX;
int INT_MIN;
int is_undefined_add(int a, int b) {
  return (a > 0 && b > INT_MAX - a) || (a < 0 && b < INT_MIN - a);
}


x86 assembly (clang, -O0):
<is_undefined_add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1130 <is_undefined_add+0x30>
mov    -0x8(%rbp),%ecx
mov    0x2eca(%rip),%rax
mov    (%rax),%edx
sub    -0x4(%rbp),%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
jg     115c <is_undefined_add+0x5c>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xa(%rbp)
jge    1156 <is_undefined_add+0x56>
mov    -0x8(%rbp),%eax
mov    0x2e97(%rip),%rcx
mov    (%rcx),%ecx
sub    -0x4(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_undefined_add>:
test   %edi,%edi
jle    1118 <is_undefined_add+0x18>
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
sub    %edi,%eax
cmp    %esi,%eax
setl   %al
movzbl %al,%eax
ret
js     1120 <is_undefined_add+0x20>
xor    %eax,%eax
movzbl %al,%eax
ret
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
sub    %edi,%eax
cmp    %esi,%eax
setg   %al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define i32 @is_undefined_add(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @INT_MAX
%6 = sub nsw i32 %5, %0
%7 = icmp slt i32 %6, %1
br label %14
8: ; preds = %2
%9 = icmp slt i32 %0, 0
br i1 %9, label %10, label %14
10: ; preds = %8
%11 = load i32, i32* @INT_MIN
%12 = sub nsw i32 %11, %0
%13 = icmp sgt i32 %12, %1
br label %14
14: ; preds = %4, %8, %10
%15 = phi i1 [ false, %8 ], [ %13, %10 ], [ %7, %4 ]
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void message_erreur() {
  printf("HTTP/1.1 400 Bad Request\r\n");
  printf("Connection: close\r\n");
  printf("Content-Length: 17\r\n");
}


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

x86 assembly (clang, -O2):
<message_erreur>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"HTTP/1.1 400 Bad Request\0D\0A\00"
@.str.1 = [20 x i8] c"Connection: close\0D\0A\00"
@.str.2 = [21 x i8] c"Content-Length: 17\0D\0A\00"
define void @message_erreur() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"HTTP/1.1 400 Bad Request\0D\00"
@str.3 = [19 x i8] c"Connection: close\0D\00"
@str.4 = [20 x i8] c"Content-Length: 17\0D\00"
define void @message_erreur() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0))
ret void
}
char *erase_tab(char *str) {
  int i;
  i = 0;
  while (str[i]) {
    if (str[i] == '\t')
      str[i] = ' ';
    i++;
  }
  return (str);
}


x86 assembly (clang, -O0):
<erase_tab>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1150 <erase_tab+0x50>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
jne    1142 <erase_tab+0x42>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <erase_tab+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase_tab>:
mov    %rdi,%rax
mov    %rdi,%rcx
jmp    1117 <erase_tab+0x17>
nopl   0x0(%rax,%rax,1)
movb   $0x20,(%rcx)
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x9,%dl
je     1110 <erase_tab+0x10>
test   %dl,%dl
jne    1113 <erase_tab+0x13>
ret

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

LLVM IR (-O2):
define i8* @erase_tab(i8* returned %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 9, label %6
]
6: ; preds = %2
store i8 32, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret i8* %0
}
int emac2_aoctetstransmittedok_set(unsigned int dev_id,
                                   union emac2_aoctetstransmittedok_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac2_aoctetstransmittedok_u = type opaque
define i32 @emac2_aoctetstransmittedok_set(i32 %0, %union.emac2_aoctetstransmittedok_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_aoctetstransmittedok_u*
store i32 %0, i32* %3
store %union.emac2_aoctetstransmittedok_u* %1, %union.emac2_aoctetstransmittedok_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_aoctetstransmittedok_u = type opaque
define i32 @emac2_aoctetstransmittedok_set(i32 %0, %union.emac2_aoctetstransmittedok_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int strcmp(char const *, char const *);
int picolQsortCompStr(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
}


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

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

LLVM IR (-O0):
define i32 @picolQsortCompStr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @picolQsortCompStr(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
struct blockbuilder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ putbyte(struct blockbuilder *, int);
void putend(struct blockbuilder *bb, int more) {
  putbyte(bb, (0x3e + !!more) << 2);
}


x86 assembly (clang, -O0):
<putend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
add    $0x3e,%esi
shl    $0x2,%esi
call   1030 <putbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putend>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
lea    0xf8(,%rax,4),%esi
jmp    1030 <putbyte@plt>

LLVM IR (-O0):
%struct.blockbuilder = type { i32 }
define void @putend(%struct.blockbuilder* %0, i32 %1) {
%3 = alloca %struct.blockbuilder*
%4 = alloca i32
store %struct.blockbuilder* %0, %struct.blockbuilder** %3
store i32 %1, i32* %4
%5 = load %struct.blockbuilder*, %struct.blockbuilder** %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = add nsw i32 62, %10
%12 = shl i32 %11, 2
%13 = call i32 @putbyte(%struct.blockbuilder* %5, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.blockbuilder = type { i32 }
define void @putend(%struct.blockbuilder* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 248, i32 252
%5 = tail call i32 @putbyte(%struct.blockbuilder* %0, i32 %4)
ret void
}
int isLeapYear(int year) {
  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112f <isLeapYear+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <isLeapYear+0x43>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <isLeapYear+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <isLeapYear+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeapYear>:
test   $0x3,%dil
sete   %al
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
cmp    $0x28f5c29,%edx
setae  %dl
and    %al,%dl
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
setb   %al
or     %dl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @isLeapYear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp ne i32 %4, 0
%6 = and i1 %3, %5
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ *MD5(int /*<<< orphan*/ *, int /*<<< orphan*/,
                        int /*<<< orphan*/ *);
u_char *hash_md5(u_char *msg, u_int m_len, u_char *hash) {
  return MD5(msg, m_len, hash);
}


x86 assembly (clang, -O0):
<hash_md5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <MD5@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_md5>:
jmp    1030 <MD5@plt>

LLVM IR (-O0):
define i32* @hash_md5(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 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32* @MD5(i32* %7, i32 %8, i32* %9)
ret i32* %10
}

LLVM IR (-O2):
define i32* @hash_md5(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32* @MD5(i32* %0, i32 %1, i32* %2)
ret i32* %4
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ is_power_of_two_non_zero(scalar_t__);
int is_power_of_two(uint32_t x) {
  return x != 0 && is_power_of_two_non_zero(x);
}


x86 assembly (clang, -O0):
<is_power_of_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113f <is_power_of_two+0x2f>
mov    -0x8(%rbp),%rdi
call   1030 <is_power_of_two_non_zero@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):
<is_power_of_two>:
test   %rdi,%rdi
je     112b <is_power_of_two+0x1b>
push   %rax
call   1030 <is_power_of_two_non_zero@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_power_of_two(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = call i64 @is_power_of_two_non_zero(i64 %6)
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_power_of_two(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @is_power_of_two_non_zero(i64 %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int sysfs_modify_freq_policy_min(unsigned int, unsigned long);
int cpufreq_modify_policy_min(unsigned int cpu, unsigned long min_freq) {
  return sysfs_modify_freq_policy_min(cpu, min_freq);
}


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

x86 assembly (clang, -O2):
<cpufreq_modify_policy_min>:
jmp    1030 <sysfs_modify_freq_policy_min@plt>

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

LLVM IR (-O2):
define i32 @cpufreq_modify_policy_min(i32 %0, i64 %1) {
%3 = tail call i32 @sysfs_modify_freq_policy_min(i32 %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ConvertDecToOther(int, int);
int main(void) { ConvertDecToOther(8, 1178); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x49a,%esi
call   1030 <ConvertDecToOther@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
mov    $0x49a,%esi
call   1030 <ConvertDecToOther@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @ConvertDecToOther(i32 8, i32 1178)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ConvertDecToOther(i32 8, i32 1178)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char const *const);
int dialog_yesno(char const *, char const *const, int /*<<< orphan*/,
                 int /*<<< orphan*/);
int j_yesno(const char *t, int ac, const char *const *av) {
  return dialog_yesno(t, av[2], atoi(av[3]), atoi(av[4]));
}


x86 assembly (clang, -O0):
<j_yesno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rdi
call   1040 <atoi@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
call   1030 <dialog_yesno@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_yesno>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    0x10(%rdx),%r15
mov    0x18(%rdx),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x20(%rbx),%rdi
call   1040 <atoi@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <dialog_yesno@plt>

LLVM IR (-O0):
define i32 @j_yesno(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %6
%9 = getelementptr inbounds i8*, i8** %8, i64 2
%10 = load i8*, i8** %9
%11 = load i8**, i8*** %6
%12 = getelementptr inbounds i8*, i8** %11, i64 3
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
%15 = load i8**, i8*** %6
%16 = getelementptr inbounds i8*, i8** %15, i64 4
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
%19 = call i32 @dialog_yesno(i8* %7, i8* %10, i32 %14, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @j_yesno(i8* %0, i32 %1, i8** nocapture %2) {
%4 = getelementptr inbounds i8*, i8** %2, i64 2
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8*, i8** %2, i64 3
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = getelementptr inbounds i8*, i8** %2, i64 4
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = tail call i32 @dialog_yesno(i8* %0, i8* %5, i32 %8, i32 %11)
ret i32 %12
}
int peon(int j) {
  if (j == 1) {
    return 2;
  } else {
    return 4;
  }
}


x86 assembly (clang, -O0):
<peon>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <peon+0x1d>
movl   $0x2,-0x4(%rbp)
jmp    1124 <peon+0x24>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<peon>:
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
add    %eax,%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @peon(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 2, i32* %2
br label %8
7: ; preds = %1
store i32 4, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @peon(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 2, i32 4
ret i32 %3
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ e(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void cloexec_test() {
  if (close(3) == 0)
    e(1001);
  if (close(6) != 0)
    e(1002);
  if (close(10) == 0)
    e(1003);
  fflush(stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<cloexec_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jne    1162 <cloexec_test+0x22>
mov    $0x3e9,%edi
call   1050 <e@plt>
mov    $0x6,%edi
call   1030 <close@plt>
cmp    $0x0,%rax
je     1180 <cloexec_test+0x40>
mov    $0x3ea,%edi
call   1050 <e@plt>
mov    $0xa,%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jne    119e <cloexec_test+0x5e>
mov    $0x3eb,%edi
call   1050 <e@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<cloexec_test>:
push   %rax
mov    $0x3,%edi
call   1030 <close@plt>
test   %rax,%rax
jne    115a <cloexec_test+0x1a>
mov    $0x3e9,%edi
call   1050 <e@plt>
mov    $0x6,%edi
call   1030 <close@plt>
test   %rax,%rax
je     1173 <cloexec_test+0x33>
mov    $0x3ea,%edi
call   1050 <e@plt>
mov    $0xa,%edi
call   1030 <close@plt>
test   %rax,%rax
jne    118c <cloexec_test+0x4c>
mov    $0x3eb,%edi
call   1050 <e@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @cloexec_test() {
%1 = call i64 @close(i32 3)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @e(i32 1001)
br label %5
5: ; preds = %3, %0
%6 = call i64 @close(i32 6)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @e(i32 1002)
br label %10
10: ; preds = %8, %5
%11 = call i64 @close(i32 10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @e(i32 1003)
br label %15
15: ; preds = %13, %10
%16 = load i32, i32* @stdout
%17 = call i32 @fflush(i32 %16)
%18 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
define void @cloexec_test() {
%1 = tail call i64 @close(i32 3)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @e(i32 1001)
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @close(i32 6)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @e(i32 1002)
br label %10
10: ; preds = %8, %5
%11 = tail call i64 @close(i32 10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @e(i32 1003)
br label %15
15: ; preds = %13, %10
%16 = load i32, i32* @stdout
%17 = tail call i32 @fflush(i32 %16)
%18 = tail call i32 @exit(i32 0)
unreachable
}
void gs_swap_buffers(long shell) {}


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

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

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

LLVM IR (-O2):
define void @gs_swap_buffers(i64 %0) {
ret void
}
usrCharOnOff(on_off) int on_off;
{
  p1('\033');
  p1('%');
  p1(!!on_off);
}


x86 assembly (clang, -O0):
<usrCharOnOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x1b,%edi
mov    $0x0,%al
call   1030 <p1@plt>
mov    $0x25,%edi
mov    $0x0,%al
call   1030 <p1@plt>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <p1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usrCharOnOff>:
push   %rbx
mov    %edi,%ebx
mov    $0x1b,%edi
xor    %eax,%eax
call   1030 <p1@plt>
mov    $0x25,%edi
xor    %eax,%eax
call   1030 <p1@plt>
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
xor    %eax,%eax
pop    %rbx
jmp    1030 <p1@plt>

LLVM IR (-O0):
define i32 @usrCharOnOff(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 27)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 37)
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %10)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @usrCharOnOff(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 27)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 37)
%4 = icmp ne i32 %0, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @p1 to i32 (i32, ...)*)(i32 %5)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) { fprintf(stderr, "Usage: idl2wrs <interface>\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: idl2wrs <interface>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: idl2wrs <interface>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
void initInterrupts() {
  (*(volatile unsigned int *)((0x3FF0000 + 0x4008)) = (0x01ffbff));
}


x86 assembly (clang, -O0):
<initInterrupts>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3ff4008,%eax
movl   $0x1ffbff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initInterrupts>:
movl   $0x1ffbff,0x3ff4008
ret

LLVM IR (-O0):
define void @initInterrupts() {
store volatile i32 2096127, i32* inttoptr (i64 67059720 to i32*)
ret void
}

LLVM IR (-O2):
define void @initInterrupts() {
store volatile i32 2096127, i32* inttoptr (i64 67059720 to i32*)
ret void
}
void intel_qrk_imr_runt_setparams(void) {}


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

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

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

LLVM IR (-O2):
define void @intel_qrk_imr_runt_setparams() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void druck(char *string, int a, int b, int c) { printf(string, a, b, c); }


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

x86 assembly (clang, -O2):
<druck>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @druck(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
bool IsSpanCompletelyInside(int start, int len, int max) {
  if (start < 0)
    return false;
  if (start + len > max)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<IsSpanCompletelyInside>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1123 <IsSpanCompletelyInside+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1145 <IsSpanCompletelyInside+0x45>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113e <IsSpanCompletelyInside+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1145 <IsSpanCompletelyInside+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsSpanCompletelyInside>:
test   %edi,%edi
setns  %al
add    %edi,%esi
cmp    %edx,%esi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @IsSpanCompletelyInside(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, -1
%5 = add nsw i32 %1, %0
%6 = icmp sle i32 %5, %2
%7 = select i1 %4, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rotl_64f(short dummy, uint64_t x) { return (x << 16) | (x >> 48); }


x86 assembly (clang, -O0):
<rotl_64f>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%edx
mov    $0x30,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rotl_64f(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = load i32, i32* %4
%8 = ashr i32 %7, 48
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rotl_64f(i16 signext %0, i32 %1) {
ret i32 poison
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
char *alloc_str_err(const char *err_msg, size_t n) {
  char *err_buf = malloc(n * sizeof(char));
  if (err_buf == 0) {
    return NULL;
  } else {
    strcpy(err_buf, err_msg);
    return err_buf;
  }
}


x86 assembly (clang, -O0):
<alloc_str_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
shl    $0x0,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <alloc_str_err+0x39>
movq   $0x0,-0x8(%rbp)
jmp    116e <alloc_str_err+0x4e>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_str_err>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1142 <alloc_str_err+0x22>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @alloc_str_err(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @strcpy(i8* %3, i8* %0)
br label %7
7: ; preds = %2, %5
ret i8* %3
}
int isdigitstr(const char *str) {
  if (*str == 0)
    return 0;
  for (; *str; str++)
    if (!(*str >= '0' && *str <= '9'))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isdigitstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1124 <isdigitstr+0x24>
movl   $0x0,-0x4(%rbp)
jmp    117f <isdigitstr+0x7f>
jmp    1129 <isdigitstr+0x29>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1178 <isdigitstr+0x78>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1156 <isdigitstr+0x56>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    1162 <isdigitstr+0x62>
movl   $0x0,-0x4(%rbp)
jmp    117f <isdigitstr+0x7f>
jmp    1167 <isdigitstr+0x67>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1129 <isdigitstr+0x29>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigitstr>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1128 <isdigitstr+0x28>
add    $0x1,%rdi
nopl   0x0(%rax)
add    $0xd0,%cl
cmp    $0x9,%cl
ja     1128 <isdigitstr+0x28>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <isdigitstr+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isdigitstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8* [ %10, %9 ], [ %0, %1 ]
%6 = phi i8 [ %11, %9 ], [ %2, %1 ]
%7 = add i8 %6, -48
%8 = icmp ult i8 %7, 10
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 1, %9 ]
ret i32 %14
}
void av_new_packet() {}


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

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

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

LLVM IR (-O2):
define void @av_new_packet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_isr_handler();
__attribute__((weak)) void gpioa_isr_handler(void) { default_isr_handler(); }


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

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

LLVM IR (-O0):
define weak void @gpioa_isr_handler() {
%1 = call i32 (...) @default_isr_handler()
ret void
}

LLVM IR (-O2):
define weak void @gpioa_isr_handler() {
%1 = tail call i32 (...) @default_isr_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, unsigned char *, int);
unsigned int U4(unsigned char *p) {
  unsigned int u;
  memcpy(&u, p, 4);
  return u;
}


x86 assembly (clang, -O0):
<U4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U4>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @U4(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
double SYSTEM_ABSD(double i) { return i >= 0.0 ? i : -i; }


x86 assembly (clang, -O0):
<SYSTEM_ABSD>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112a <SYSTEM_ABSD+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <SYSTEM_ABSD+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SYSTEM_ABSD>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @SYSTEM_ABSD(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fneg double %8
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}

LLVM IR (-O2):
define double @SYSTEM_ABSD(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
/* Variables and functions */
double sqrt(double);
double calcVelocity(double r, double en) {
  return sqrt((en + (3.986E5 / r)) * 2);
}


x86 assembly (clang, -O0):
<calcVelocity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed9(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  0xec0(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcVelocity>:
movapd %xmm0,%xmm2
movsd  0xee4(%rip),%xmm0
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1137 <calcVelocity+0x27>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @calcVelocity(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fdiv double 3.986000e+05, %6
%8 = fadd double %5, %7
%9 = fmul double %8, 2.000000e+00
%10 = call double @sqrt(double %9)
ret double %10
}

LLVM IR (-O2):
define double @calcVelocity(double %0, double %1) {
%3 = fdiv double 3.986000e+05, %0
%4 = fadd double %3, %1
%5 = fmul double %4, 2.000000e+00
%6 = tail call double @sqrt(double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_iochannel_is_hungup() {
  printf("NOT IMPLEMENTED:"
         "pa_iochannel_is_hungup"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_iochannel_is_hungup\00"
define i32 @pa_iochannel_is_hungup() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ tp_sub(struct timespec *, struct timespec *,
                          struct timespec *);
float tp_to_sec(struct timespec *);
float tp_get_sec(clockid_t clock_id, struct timespec *tp) {
  struct timespec now;
  assert(0 == clock_gettime(clock_id, &now));
  struct timespec delta;
  tp_sub(&now, tp, &delta);
  return tp_to_sec(&delta);
}


x86 assembly (clang, -O0):
<tp_get_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1040 <clock_gettime@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rdx
call   1050 <tp_sub@plt>
lea    -0x20(%rbp),%rdi
call   1030 <tp_to_sec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_get_sec>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r15
lea    0x8(%rsp),%r14
mov    %r14,%rsi
call   1040 <clock_gettime@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <tp_sub@plt>
mov    %rbx,%rdi
call   1030 <tp_to_sec@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define float @tp_get_sec(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%7 = load i32, i32* %3
%8 = call i64 @clock_gettime(i32 %7, %struct.timespec* %5)
%9 = icmp eq i64 0, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load %struct.timespec*, %struct.timespec** %4
%13 = call i32 @tp_sub(%struct.timespec* %5, %struct.timespec* %12, %struct.timespec* %6)
%14 = call float @tp_to_sec(%struct.timespec* %6)
ret float %14
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define float @tp_get_sec(i32 %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
%5 = bitcast %struct.timespec* %3 to i8*
%6 = call i64 @clock_gettime(i32 %0, %struct.timespec* %3)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = bitcast %struct.timespec* %4 to i8*
%11 = call i32 @tp_sub(%struct.timespec* %3, %struct.timespec* %1, %struct.timespec* %4)
%12 = call float @tp_to_sec(%struct.timespec* %4)
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ SuffSuffIsSuffix(void const *, void const *);
int SuffSuffIsSuffixP(const void *s, const void *sd) {
  return (!SuffSuffIsSuffix(s, sd));
}


x86 assembly (clang, -O0):
<SuffSuffIsSuffixP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <SuffSuffIsSuffix@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SuffSuffIsSuffixP>:
push   %rax
call   1030 <SuffSuffIsSuffix@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SuffSuffIsSuffixP(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @SuffSuffIsSuffix(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @SuffSuffIsSuffixP(i8* %0, i8* %1) {
%3 = tail call i32 @SuffSuffIsSuffix(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d\n", a + b);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
void snd_ak4113_suspend(struct ak4113 *chip) {}


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

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

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

LLVM IR (-O2):
%struct.ak4113 = type opaque
define void @snd_ak4113_suspend(%struct.ak4113* nocapture %0) {
ret void
}