xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ glColor3f(int, int, int);
void changeColor(int R, int G, int B) { glColor3f(R / 255, G / 255, B / 255); }


x86 assembly (clang, -O0):
<changeColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x8(%rbp),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0xc(%rbp),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <glColor3f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeColor>:
movslq %edi,%rdi
imul   $0xffffffff80808081,%rdi,%rax
shr    $0x20,%rax
add    %eax,%edi
mov    %edi,%eax
shr    $0x1f,%eax
sar    $0x7,%edi
add    %eax,%edi
movslq %esi,%rsi
imul   $0xffffffff80808081,%rsi,%rax
shr    $0x20,%rax
add    %eax,%esi
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0x7,%esi
add    %eax,%esi
movslq %edx,%rdx
imul   $0xffffffff80808081,%rdx,%rax
shr    $0x20,%rax
add    %eax,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0x7,%edx
add    %eax,%edx
jmp    1030 <glColor3f@plt>

LLVM IR (-O0):
define void @changeColor(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 = sdiv i32 %7, 255
%9 = load i32, i32* %5
%10 = sdiv i32 %9, 255
%11 = load i32, i32* %6
%12 = sdiv i32 %11, 255
%13 = call i32 @glColor3f(i32 %8, i32 %10, i32 %12)
ret void
}

LLVM IR (-O2):
define void @changeColor(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %0, 255
%5 = sdiv i32 %1, 255
%6 = sdiv i32 %2, 255
%7 = tail call i32 @glColor3f(i32 %4, i32 %5, i32 %6)
ret void
}
/* Variables and functions */
int lp_internal_iconfig(int, char *);
int lp_chn_status(int chn) { return lp_internal_iconfig(chn, "state"); }


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

x86 assembly (clang, -O2):
<lp_chn_status>:
lea    0xee9(%rip),%rsi
jmp    1030 <lp_internal_iconfig@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"state\00"
define i32 @lp_chn_status(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lp_internal_iconfig(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"state\00"
define i32 @lp_chn_status(i32 %0) {
%2 = tail call i32 @lp_internal_iconfig(i32 %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int validate_tags(char **tags, size_t tag_count) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @validate_tags(i8** nocapture readnone %0, i64 %1) {
ret i32 1
}
/* Type definitions */
struct http_response {
  int dummy;
};

/* Variables and functions */
int http_response2(int, struct http_response *, int);
int http_response(int sock, struct http_response *resp) {
  return http_response2(sock, resp, 1);
}


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

x86 assembly (clang, -O2):
<http_response>:
mov    $0x1,%edx
jmp    1030 <http_response2@plt>

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

LLVM IR (-O2):
%struct.http_response = type { i32 }
define i32 @http_response(i32 %0, %struct.http_response* %1) {
%3 = tail call i32 @http_response2(i32 %0, %struct.http_response* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printProfile(int);
void profFini() { printProfile(1); }


x86 assembly (clang, -O0):
<profFini>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <printProfile@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @profFini() {
%1 = call i32 @printProfile(i32 1)
ret void
}

LLVM IR (-O2):
define void @profFini() {
%1 = tail call i32 @printProfile(i32 1)
ret void
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_27(int Salt, int Parameter) {
  unsigned b = Salt * 0x58E937F9 + 0x1075;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_27>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x58e937f9,-0x4(%rbp),%eax
add    $0x1075,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_27>:
imul   $0x58e937f9,%edi,%edi
add    $0x1075,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_27(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 1491679225
%8 = add nsw i32 %7, 4213
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @yahoo_M1Common(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @yahoo_f01_27(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 1491679225
%4 = add nsw i32 %3, 4213
%5 = tail call i32 @yahoo_M1Common(i32 %4, i32 %1)
ret i32 %5
}
/* Variables and functions */
unsigned int strlen(char *);
char toupper(char);
void toupper_string(char *text) {
  unsigned int j;
  for (j = 0; j < strlen(text); j++) {
    text[j] = toupper(text[j]);
  }
}


x86 assembly (clang, -O0):
<toupper_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jae    1179 <toupper_string+0x59>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <toupper_string+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
je     1161 <toupper_string+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%eax
cmp    %rax,%rbx
jb     1140 <toupper_string+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @toupper_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = zext i32 %10 to i64
%12 = icmp ult i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
int NJ_is_whitespace(char c) {
  if (c == ' ' || c == '\n' || c == '\r' || c == '\v' || c == '\f' ||
      c == '\t') {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<NJ_is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1158 <NJ_is_whitespace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1158 <NJ_is_whitespace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
je     1158 <NJ_is_whitespace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xb,%eax
je     1158 <NJ_is_whitespace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xc,%eax
je     1158 <NJ_is_whitespace+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    1164 <NJ_is_whitespace+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <NJ_is_whitespace+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NJ_is_whitespace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%cl
jae    110e <NJ_is_whitespace+0xe>
ret
cmp    $0x20,%dil
je     110d <NJ_is_whitespace+0xd>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @NJ_is_whitespace(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 eq i32 %5, 32
br i1 %6, label %27, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 10
br i1 %10, label %27, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 13
br i1 %14, label %27, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 11
br i1 %18, label %27, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 12
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 9
br i1 %26, label %27, label %28
27: ; preds = %23, %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %29
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @NJ_is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 12, label %3
i8 11, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
char *getenv(char *);
int get_color(void) {
  char *color;
  color = getenv("KBUILD_COLOR");
  if (*color > '0' || *color <= '7')
    return *color - '0';
  else
    return 0;
}


x86 assembly (clang, -O0):
<get_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jg     1148 <get_color+0x38>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x37,%eax
jg     115a <get_color+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <get_color+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_color>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
movsbl (%rax),%eax
add    $0xffffffd0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"KBUILD_COLOR\00"
define i32 @get_color() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sgt i32 %6, 48
br i1 %7, label %13, label %8
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 55
br i1 %12, label %13, label %18
13: ; preds = %8, %0
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %16, 48
store i32 %17, i32* %1
br label %19
18: ; preds = %8
store i32 0, i32* %1
br label %19
19: ; preds = %18, %13
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [13 x i8] c"KBUILD_COLOR\00"
define i32 @get_color() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = load i8, i8* %1
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, -48
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ init_sg_arv_crv();
int /*<<< orphan*/ init_srv_crv_arr();
int /*<<< orphan*/ init_sw_rec_arr();
int /*<<< orphan*/ initial_frame_queue();
int /*<<< orphan*/ initial_group_arv_crv();
int /*<<< orphan*/ initial_output_port_vl();
int /*<<< orphan*/ initial_vl_path();
void initial_snat() {
  initial_vl_path();
  initial_output_port_vl();
  init_srv_crv_arr();
  initial_group_arv_crv();
  init_sg_arv_crv();
  init_sw_rec_arr();
  initial_frame_queue();
}


x86 assembly (clang, -O0):
<initial_snat>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <initial_vl_path@plt>
mov    $0x0,%al
call   1090 <initial_output_port_vl@plt>
mov    $0x0,%al
call   1070 <init_srv_crv_arr@plt>
mov    $0x0,%al
call   1030 <initial_group_arv_crv@plt>
mov    $0x0,%al
call   1080 <init_sg_arv_crv@plt>
mov    $0x0,%al
call   1050 <init_sw_rec_arr@plt>
mov    $0x0,%al
call   1040 <initial_frame_queue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initial_snat>:
push   %rax
xor    %eax,%eax
call   1060 <initial_vl_path@plt>
xor    %eax,%eax
call   1090 <initial_output_port_vl@plt>
xor    %eax,%eax
call   1070 <init_srv_crv_arr@plt>
xor    %eax,%eax
call   1030 <initial_group_arv_crv@plt>
xor    %eax,%eax
call   1080 <init_sg_arv_crv@plt>
xor    %eax,%eax
call   1050 <init_sw_rec_arr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <initial_frame_queue@plt>

LLVM IR (-O0):
define void @initial_snat() {
%1 = call i32 (...) @initial_vl_path()
%2 = call i32 (...) @initial_output_port_vl()
%3 = call i32 (...) @init_srv_crv_arr()
%4 = call i32 (...) @initial_group_arv_crv()
%5 = call i32 (...) @init_sg_arv_crv()
%6 = call i32 (...) @init_sw_rec_arr()
%7 = call i32 (...) @initial_frame_queue()
ret void
}

LLVM IR (-O2):
define void @initial_snat() {
%1 = tail call i32 (...) @initial_vl_path()
%2 = tail call i32 (...) @initial_output_port_vl()
%3 = tail call i32 (...) @init_srv_crv_arr()
%4 = tail call i32 (...) @initial_group_arv_crv()
%5 = tail call i32 (...) @init_sg_arv_crv()
%6 = tail call i32 (...) @init_sw_rec_arr()
%7 = tail call i32 (...) @initial_frame_queue()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  int a, b;
  a = 2;
  b = 4;
  if ((a = 2) & (b = 4))
    printf(" TAK\n");
  else
    printf("NIE\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1151 <main+0x41>
jmp    1162 <main+0x52>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <main+0x5e>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [4 x i8] c"NIE\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ devtag_lookup(char *, int, char const *);
char *strdup(char *);
char *devtag_get(const char *devname) {
  char buf[64];
  buf[0] = 0;
  devtag_lookup(buf, sizeof(buf), devname);
  return strdup(buf);
}


x86 assembly (clang, -O0):
<devtag_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x50(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x40,%esi
call   1040 <devtag_lookup@plt>
lea    -0x50(%rbp),%rdi
call   1030 <strdup@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<devtag_get>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rdx
movb   $0x0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1040 <devtag_lookup@plt>
mov    %rbx,%rdi
call   1030 <strdup@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @devtag_get(i8* %0) {
%2 = alloca i8*
%3 = alloca [64 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @devtag_lookup(i8* %5, i32 64, i8* %6)
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%9 = call i8* @strdup(i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @devtag_get(i8* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
%4 = call i32 @devtag_lookup(i8* %3, i32 64, i8* %0)
%5 = call i8* @strdup(i8* %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ perf_0();
int main() { perf_0(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <perf_0@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @perf_0()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @perf_0()
ret i32 0
}
/* Variables and functions */
int FindMultipleSum(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  int number = 0;
  fflush(stdin);
  scanf("%d", &number);
  printf("%d\n", FindMultipleSum(number));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xe8e(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1040 <FindMultipleSum@plt>
mov    %eax,%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xea2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <FindMultipleSum@plt>
lea    0xe8b(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = load i32, i32* @stdin
%6 = tail call i32 @fflush(i32 %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = call i32 @FindMultipleSum(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
syslog_DEBUG() {}


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

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

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

LLVM IR (-O2):
define i32 @syslog_DEBUG() {
ret i32 undef
}
char *fn1() {
  static char *pa[5] = {"A001", "A002"};
  return *pa;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f25(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@fn1.pa = internal global [5 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* null, i8* null, i8* null]
@.str = [5 x i8] c"A001\00"
@.str.1 = [5 x i8] c"A002\00"
define i8* @fn1() {
%1 = load i8*, i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @fn1.pa, i64 0, i64 0)
ret i8* %1
}

LLVM IR (-O2):
@.str = [5 x i8] c"A001\00"
define i8* @fn1() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ txxbuf;

/* Variables and functions */
int /*<<< orphan*/ spi_transfer_array(int, unsigned char *, unsigned char *,
                                      int);
void spi_reg_set(int fd, unsigned char addr, unsigned char data) {
  unsigned char txxbuf[2] = {addr, data};
  unsigned char rxxbuf[2];
  spi_transfer_array(fd, txxbuf, rxxbuf, sizeof(txxbuf));
  return;
}


x86 assembly (clang, -O0):
<spi_reg_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %edi,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xa(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <spi_transfer_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_reg_set>:
push   %rax
mov    %sil,0x4(%rsp)
mov    %dl,0x5(%rsp)
lea    0x4(%rsp),%rsi
lea    0x6(%rsp),%rdx
mov    $0x2,%ecx
call   1030 <spi_transfer_array@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @spi_reg_set(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca [2 x i8]
%8 = alloca [2 x i8]
store i32 %0, i32* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%10 = load i8, i8* %5
store i8 %10, i8* %9
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %6
store i8 %12, i8* %11
%13 = load i32, i32* %4
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%16 = call i32 @spi_transfer_array(i32 %13, i8* %14, i8* %15, i32 2)
ret void
}

LLVM IR (-O2):
define void @spi_reg_set(i32 %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca [2 x i8]
%5 = alloca [2 x i8]
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 %1, i8* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 %2, i8* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%9 = call i32 @spi_transfer_array(i32 %0, i8* %6, i8* %8, i32 2)
ret void
}
void ft_bricked_tank(struct tank *tank, void *ignored) {}


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

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

LLVM IR (-O0):
%struct.tank = type opaque
define void @ft_bricked_tank(%struct.tank* %0, i8* %1) {
%3 = alloca %struct.tank*
%4 = alloca i8*
store %struct.tank* %0, %struct.tank** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.tank = type opaque
define void @ft_bricked_tank(%struct.tank* nocapture %0, i8* nocapture %1) {
ret void
}
float av_clipf_c(float a, float amin, float amax) {
  if (a < amin)
    return amin;
  else if (a > amax)
    return amax;
  else
    return a;
}


x86 assembly (clang, -O0):
<av_clipf_c>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <av_clipf_c+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <av_clipf_c+0x5d>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1153 <av_clipf_c+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <av_clipf_c+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_clipf_c>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @av_clipf_c(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %6
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %5
%15 = load float, float* %7
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %7
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %5
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @av_clipf_c(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pwmOff();
int /*<<< orphan*/ pwmOn();
int /*<<< orphan*/ system(char *);
void ruotaSX() {
  printf("SX\n\r");
  pwmOff();
  pwmOn();
  system("echo  1550000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle");
  system("echo  1550000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle");
}


x86 assembly (clang, -O0):
<ruotaSX>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <pwmOff@plt>
mov    $0x0,%al
call   1050 <pwmOn@plt>
lea    0xea0(%rip),%rdi
call   1030 <system@plt>
lea    0xecc(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ruotaSX>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <pwmOff@plt>
xor    %eax,%eax
call   1050 <pwmOn@plt>
lea    0xea3(%rip),%rdi
call   1030 <system@plt>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"SX\0A\0D\00"
@.str.1 = [56 x i8] c"echo 1550000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle\00"
@.str.2 = [56 x i8] c"echo 1550000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle\00"
define void @ruotaSX() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @pwmOff()
%3 = call i32 (...) @pwmOn()
%4 = call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"SX\0A\0D\00"
@.str.1 = [56 x i8] c"echo 1550000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle\00"
@.str.2 = [56 x i8] c"echo 1550000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle\00"
define void @ruotaSX() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @pwmOff()
%3 = tail call i32 (...) @pwmOn()
%4 = tail call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void trc_4() { fprintf(stderr, "trc_4\n"); }


x86 assembly (clang, -O0):
<trc_4>:
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):
<trc_4>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"trc_4\0A\00"
define void @trc_4() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  while (1) {
    break;
  }
  for (int i = 0; i < 20; i++) {
    printf("Hello\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
jmp    1124 <main+0x14>
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1141 <main+0x31>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void delayacct_tsk_free(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @delayacct_tsk_free(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ ceil(double);
int roundup(double f) {
  int i = (int)ceil((double)f);
  return (i);
}


x86 assembly (clang, -O0):
<roundup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @roundup(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = call i64 @ceil(double %4)
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @roundup(double %0) {
%2 = tail call i64 @ceil(double %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
void test_PTHREAD_SCOPE_SYSTEM(void) { int dummy = "PTHREAD_SCOPE_SYSTEM"; }


x86 assembly (clang, -O0):
<test_PTHREAD_SCOPE_SYSTEM>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"PTHREAD_SCOPE_SYSTEM\00"
define void @test_PTHREAD_SCOPE_SYSTEM() {
%1 = alloca i32
store i32 ptrtoint ([21 x i8]* @.str to i32), i32* %1
ret void
}

LLVM IR (-O2):
define void @test_PTHREAD_SCOPE_SYSTEM() {
ret void
}
void list_sort(struct element *list,
               int (*compare)(const void *, const void *)) {}


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

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

LLVM IR (-O0):
%struct.element = type opaque
define void @list_sort(%struct.element* %0, i32 (i8*, i8*)* %1) {
%3 = alloca %struct.element*
%4 = alloca i32 (i8*, i8*)*
store %struct.element* %0, %struct.element** %3
store i32 (i8*, i8*)* %1, i32 (i8*, i8*)** %4
ret void
}

LLVM IR (-O2):
%struct.element = type opaque
define void @list_sort(%struct.element* nocapture %0, i32 (i8*, i8*)* nocapture %1) {
ret void
}
long big_msg_receive(long *source, struct Msg *msgpt) {
  long res = 4;
  long src;
  __asm__ volatile("int $0x80"
                   : "=a"(res), "=b"(src)
                   : "0"(res), "b"(*source), "c"((long)msgpt));
  if (res == 1) {
    *source = src;
    return 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<big_msg_receive>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movq   $0x4,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rbx
mov    -0x20(%rbp),%rcx
int    $0x80
mov    %rax,-0x28(%rbp)
mov    %rbx,-0x30(%rbp)
cmpq   $0x1,-0x28(%rbp)
jne    1151 <big_msg_receive+0x51>
mov    -0x30(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movq   $0x1,-0x10(%rbp)
jmp    1159 <big_msg_receive+0x59>
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<big_msg_receive>:
push   %rbx
mov    %rsi,%rcx
mov    (%rdi),%rbx
mov    $0x4,%eax
int    $0x80
mov    %rax,%rcx
mov    $0xffffffffffffffff,%rax
cmp    $0x1,%rcx
jne    1126 <big_msg_receive+0x26>
mov    %rbx,(%rdi)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Msg = type opaque
define i64 @big_msg_receive(i64* %0, %struct.Msg* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca %struct.Msg*
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %4
store %struct.Msg* %1, %struct.Msg** %5
store i64 4, i64* %6
%8 = load i64, i64* %6
%9 = load i64*, i64** %4
%10 = load i64, i64* %9
%11 = load %struct.Msg*, %struct.Msg** %5
%12 = ptrtoint %struct.Msg* %11 to i64
%13 = call { i64, i64 } asm sideeffect "int $$0x80", "={ax},={bx},0,{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %8, i64 %10, i64 %12)
%14 = extractvalue { i64, i64 } %13, 0
%15 = extractvalue { i64, i64 } %13, 1
store i64 %14, i64* %6
store i64 %15, i64* %7
%16 = load i64, i64* %6
%17 = icmp eq i64 %16, 1
br i1 %17, label %18, label %21
18: ; preds = %2
%19 = load i64, i64* %7
%20 = load i64*, i64** %4
store i64 %19, i64* %20
store i64 1, i64* %3
br label %22
21: ; preds = %2
store i64 -1, i64* %3
br label %22
22: ; preds = %21, %18
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
%struct.Msg = type opaque
define i64 @big_msg_receive(i64* nocapture %0, %struct.Msg* %1) {
%3 = load i64, i64* %0
%4 = ptrtoint %struct.Msg* %1 to i64
%5 = tail call { i64, i64 } asm sideeffect "int $$0x80", "={ax},={bx},0,{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 4, i64 %3, i64 %4)
%6 = extractvalue { i64, i64 } %5, 0
%7 = icmp eq i64 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = extractvalue { i64, i64 } %5, 1
store i64 %9, i64* %0
br label %10
10: ; preds = %2, %8
%11 = phi i64 [ 1, %8 ], [ -1, %2 ]
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct ns_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ns_send_mqtt_short_command(struct ns_connection *, int,
                                              int /*<<< orphan*/);
void ns_mqtt_pubrec(struct ns_connection *nc, uint16_t message_id) {
  ns_send_mqtt_short_command(nc, 5, message_id);
}


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

x86 assembly (clang, -O2):
<ns_mqtt_pubrec>:
mov    %esi,%edx
mov    $0x5,%esi
jmp    1030 <ns_send_mqtt_short_command@plt>

LLVM IR (-O0):
%struct.ns_connection = type { i32 }
define void @ns_mqtt_pubrec(%struct.ns_connection* %0, i32 %1) {
%3 = alloca %struct.ns_connection*
%4 = alloca i32
store %struct.ns_connection* %0, %struct.ns_connection** %3
store i32 %1, i32* %4
%5 = load %struct.ns_connection*, %struct.ns_connection** %3
%6 = load i32, i32* %4
%7 = call i32 @ns_send_mqtt_short_command(%struct.ns_connection* %5, i32 5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.ns_connection = type { i32 }
define void @ns_mqtt_pubrec(%struct.ns_connection* %0, i32 %1) {
%3 = tail call i32 @ns_send_mqtt_short_command(%struct.ns_connection* %0, i32 5, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dropbear_exit(char *);
void *realloc(void *, size_t);
void *m_realloc(void *ptr, size_t size) {
  void *ret;
  if (size == 0)
    dropbear_exit("m_realloc failed");
  ret = realloc(ptr, size);
  if (ret == NULL)
    dropbear_exit("m_realloc failed");
  return ret;
}


x86 assembly (clang, -O0):
<m_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1147 <m_realloc+0x27>
lea    0xebe(%rip),%rdi
call   1040 <dropbear_exit@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <m_realloc+0x4f>
lea    0xe96(%rip),%rdi
call   1040 <dropbear_exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
jne    113b <m_realloc+0x1b>
lea    0xeca(%rip),%rdi
call   1040 <dropbear_exit@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115a <m_realloc+0x3a>
lea    0xeab(%rip),%rdi
call   1040 <dropbear_exit@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"m_realloc failed\00"
define i8* @m_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @dropbear_exit(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i8* @realloc(i8* %11, i64 %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @dropbear_exit(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %10
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [17 x i8] c"m_realloc failed\00"
define noalias i8* @m_realloc(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @dropbear_exit(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = tail call i8* @realloc(i8* %0, i64 %1)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @dropbear_exit(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret i8* %7
}
int pqos_pid_fini(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pqos_pid_fini() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int rootless_allows_task_for_pid(pid_t pid) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @rootless_allows_task_for_pid(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t I2CSlaveStatus(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(0x40002000 + 0x00000004))));
}


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

x86 assembly (clang, -O2):
<I2CSlaveStatus>:
mov    %rdi,-0x8(%rsp)
mov    0x40002004,%rax
40
ret

LLVM IR (-O0):
define i64 @I2CSlaveStatus(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073750020 to i64*)
ret i64 %3
}

LLVM IR (-O2):
define i64 @I2CSlaveStatus(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073750020 to i64*)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, double, double);
void printFactRow(int i, int fact, double appx1, double appx2) {
  printf("%4d\t%9d\t%12.6e\t\t%12.6e\n", i, fact, appx1, appx2);
}


x86 assembly (clang, -O0):
<printFactRow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printFactRow>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [24 x i8] c"%4d\09%9d\09%12.6e\09\09%12.6e\0A\00"
define void @printFactRow(i32 %0, i32 %1, double %2, double %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, double %2, double %3)
ret void
}
void XSyncQueryExtension() {}


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

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

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

LLVM IR (-O2):
define void @XSyncQueryExtension() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M460_f(char *s) {
  debug("M460_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M460_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M460_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M460_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M460_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M460_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M460_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
scalar_t__ isalnum(int);
int ischarid(int c) {
  return isalnum(c) || c == ':' || c == '.' || c == '_' || c == '-';
}


x86 assembly (clang, -O0):
<ischarid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116c <ischarid+0x5c>
mov    $0x1,%al
cmpl   $0x3a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <ischarid+0x5c>
mov    $0x1,%al
cmpl   $0x2e,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <ischarid+0x5c>
mov    $0x1,%al
cmpl   $0x5f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116c <ischarid+0x5c>
cmpl   $0x2d,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ischarid>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1127 <ischarid+0x17>
pop    %rbx
ret
lea    -0x2e(%rbx),%ecx
cmp    $0x31,%ecx
ja     113f <ischarid+0x2f>
movabs $0x2000000001001,%rdx
bt     %rcx,%rdx
jb     1125 <ischarid+0x15>
xor    %eax,%eax
cmp    $0x2d,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ischarid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 58
br i1 %8, label %18, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 46
br i1 %11, label %18, label %12
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 95
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 45
br label %18
18: ; preds = %15, %12, %9, %6, %1
%19 = phi i1 [ true, %12 ], [ true, %9 ], [ true, %6 ], [ true, %1 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @ischarid(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
switch i32 %0, label %6 [
i32 95, label %9
i32 58, label %9
i32 46, label %9
]
6: ; preds = %5
%7 = icmp eq i32 %0, 45
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %5, %5, %1, %6
%10 = phi i32 [ 1, %5 ], [ %8, %6 ], [ 1, %1 ], [ 1, %5 ], [ 1, %5 ]
ret i32 %10
}